Hardware Description Language: B. Ramamurthy
Hardware Description Language: B. Ramamurthy
Language
1
B. RAMAMURTHY
04/06/21
HDL
2
04/06/21
HDL (contd.)
3
04/06/21
Verilog
4
04/06/21
Verilog
5
comp1
comp2 system
sub3
04/06/21
Verilog Design Concept
6
System
comp1 comp2
sub3
04/06/21
Primitives
7
04/06/21
Register
8
04/06/21
Register Types
9
04/06/21
Example
10
04/06/21
Assign
11
04/06/21
Lets get the Verilog module for this circuit
12
http://www.doulos.com/knowhow/verilog_d
esigners_guide/wire_assignments/
04/06/21
Solutions using “assign” and “wire”
13
module AOI (input A, B, C, D, output F);
/* start of a block comment
wire F;
wire AB, CD, O;
assign AB = A & B;
assign CD = C & D;
assign O = AB | CD;
assign F = ~O;
end of a block comment */
// Equivalent...
wire AB = A & B;
wire CD = C & D;
wire O = AB | CD;
wire F = ~O;
endmodule // end of Verilog code
04/06/21
Module abc in vabc
14
04/06/21
Module Definition + Gate Level Diagram
15
module abc (a, b, c, d, s1, s0);
input s1, s0;
output a, b, c,d;
not (s1_, s1), (s0_, s0);
and (a, s1_, s0_);
and (b, s1_, s0);
and (c, s1, s0_);
and (d, s1, s0);
endmodule
04/06/21
Verilog Module Example
16
This module can now be used for shifters of various sizes, simply by changing
the width parameter. Parameters can be changed per instance.
04/06/21
Net component (connectors)
17
Nets are the things that connect model components together. They are
usually thought of as wires in a circuit. Nets are declared in statements
like this:
net_type [range] [delay3] list_of_net_identifiers ;
or
net_type [drive_strength] [range] [delay3]
list_of_net_decl_assignments ;
Example:
wire w1, w2;
tri [31:0] bus32;
wire wire_number_5 = wire_number_2 & wire_number_3;
& here represents AND operation (AND gate)
04/06/21
4-bit Adder : Lets write Verilog Source
18
04/06/21
Lets examine a full-adder
19
04/06/21