Verilog Hardare Description Language: Lectuer-3
Verilog Hardare Description Language: Lectuer-3
LANGUAGE
LECTUER-3
DIVYA SHAH
25/02/09
Structural Modeling
The module is implemented by connecting set of
primitives defined by the language (called built-in
primitives) or by the user (called user defined
primitives)
Logic Gates
and or xor nand nor xnor
Buffers
buf bufif0 bufif1 not notif0
notif1 pulldown pullup
Transistor
nmos pmos cmos rnmos
rpmos rcmos tran tranif0
tranif1 rtran rtranif0 rtranif1
GATE LEVEL MODELING
• VERILOG SUPPORTS BASIC LOGIC GATES OR PREDEFINED
PRIMITIVES
i0 y0
y1
i1
out
y2
i2
i3 y3
out1 out0
sel1
sel0
Example: 4-to-1 multiplexer Verilog structural model.
UDPs can have only one output and none of its inputs and
outputs can be a vectors.
Syntax
primitive primitive_name(port id’s);
output port_id_names;
input port_id_names;
table
inputs : output
endtable
endprimitives
Example: //combinational UDPs(mux_2_to 1)
primitive mux2to1(y,sel,in1,in2);
output y;
input sel,in1,in2;
table
// sel in1 in2 : y
0 0 ? : 0;
0 1 ? : 1; // “?” Can be 0,1 or x
1 ? 0 : 0;
1 ? 1 : 1;
x 0 0 : 0; // “x” unknown
x 1 1 : 1;
endtable
endprimitive
YOUR WORK
• WRITE A CODE OF 3:8 DECODER
USING GATE LEVEL MODELING
• WRITE A CODE OF 16:1 MUX USING 4:1
MUX
• WRITE A CODE OF 4 INPUT PRIORITY
ENCODER USING GATE LEVEL
MODELING