01-Module1.1-VerilogElements
01-Module1.1-VerilogElements
Example:
Number Specifications
Sized Numbers Format: <size>’<base format><number>
Example:
Comments
// - Single Line comments
/* … */ - Multiple Line comments
Data Types
Informs the compiler whether to act as
Data Types transmission line or store data.
DATATYPE
DATATYPE
1 Net
2 Variable
DATATYPE
1 Net
- Connection between hardware
elements.
- Don’t store values.
- They have the value of the
drivers. For instance, in the figure, the
net out connected to the output
Net data type must be used when a
signal is: is driven by the driving output
1. Driven by the output of some value A&B.
devices
2. Declared as an input or inout.
3. In the left-hand side of
continuous assignment
statement.
Types of Nets
TYPE OF NET
1.1 Wire
2 Register
reg reset; // declare a variable
reset that can hold it's value
2.1 Integer
initial
begin
- uses the keyword real delta = 4e10; //assigned
scientific notation
- Store decimal/scientific delta = 2.13 //assigned a decimal
notations. value of 2.13
- 64-bit default size. end
- Cannot have a range
declaration.
- Default value is zero(0) Note: if a real value is
assigned to an integer value:
round-off to the nearest
integer. Ex: 2.3 → 2
Types of Registers
TYPE OF REG
Time
2.3 Registers
time save_sim_time; //Define a
time variable save_sim_time
initial
begin
DATATYPE
DATATYPE
1 Scalar
2 Vector
Starts with the keyword module and ends with the keyword
endmodule.
There are five components of within a module, not necessary that all
are found inside a single design.
Two Types of Verilog Modules / Design
MODULE
MODULE
1 DUT
2 Test Bench
EXAMPLE
EXAMPLE
1 D Flip-flop
1 Full Adder