Introduction To Verilog HDL
Introduction To Verilog HDL
How it started!
Module declaration
Data-flow style
Behavioral style
Structural style
Any mix of above
An example
Half adder structural model (gate-level)
Half adder data-flow model
Half adder behavioral model
Continuous assignments.
Half adder behavioral model
procedural assignments.
Language elements
A single line comment begins with ‘//’ and ends with a newline.
A block comment begins with ‘/*’ and ends with ‘*/’.
Identifiers
Equivalent to variable names
Identifiers can be up to 1024 characters.
Logic Values and Signal Strengths
Equality operators: = =, ! =,
Arithmetic operators: +, -, *, /, %
Unary : +, -
Behavioral constructs
Continuous assignment with ‘assign’ keyword.
Inside a module, but outside procedures.
LHS of continuous assignment must be a `net’ type.
Unit of Abbreviation
Measurement
seconds s
milliseconds ms
microseconds us
nanoseconds ns
picoseconds ps
femtoseconds fs
Example: `timescale 10 ns / 1 ns
i = 0;
while (I <= 15) begin
output = i;
#10 i = i + 1;
end
T Flip-Flop
endmodule
VERILOG CODE FOR 1 BIT FULL ADDER
Some More Gate Level Examples
An adder
instance
instancenames
names
and delays
and delays
module adder optional
optional
(output carryOut, sum ,
input aInput, bInput, carryIn);
sum