Académique Documents
Professionnel Documents
Culture Documents
Structural and
Gate Level Modeling of
Combinational Circuits
Unit Outline
Verilog modules
Structural modeling
Test modules
Module Declaration
Module Declaration
inputs
module
outputs
modulemodule_name(portslist);
body
endmodule
Module Declaration
Exercise
Instantiation
Instantiation
top
f
sub1
UNIT_1
sub1
UNIT_0
Wire
top
f
sub1
w1
UNIT_0
CpE 425 Digital Systems Design
sub1
UNIT_1
9
Gate Primitives
Instantiation Example:
in_x
F
.
.
.
and
andinstance_name(F,in_0,in_1,,in_x);
Output first in the port map
10
Exercise
11
Buses
c[2]
m
sub1
x
y
z
c[1]
c[0]
b[2]
b[1]
b[0]
sub2
12
Explicit Port-mapping
sub1
x
y
z
c[1]
c[0]
b[2]
b[1]
b[0]
sub2
sub1blk1(m,c[2],c[1],c[0]);
sub1blk1(.y(c[1]),
.a(m),
.x(c[2]),
.z(c[0])
);
.self_port (external_wire)
13
Exercise
Create a Verilog description of a 4-input majority function that
outputs a '1' (representing true) if the number of 1s at the
inputs are more than the number of 0s; otherwise the output is
'0' (representing false).
Input:
A [3:0]
Output:
14
Testbench
UUT
a
sub1
15
UUT
a
b
sub1
16
Stimulus Generator
17
References
18