













































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!














































Patrick Schaumont
Gate-level Modeling
Patrick Schaumont
bit comparator
byte comparator
latch
master/slave flip-flop
Primitive Gates
8 of them are for logic functions (focus of this class)
4 of them are for modeling tri-state signals
2 of them are enance signal strength
Patrick Schaumont
User Defined Primitives (Chapter 12 Palnitkar)
Standard Logic Functions
and(out, in1, in2)nand(out, in1, in2) or(out, in1, in2)
Patrick Schaumont
nor(out, in1, in2)xor(out, in1, in2)xnor(out, in1, in2)buf(out, in)not(out, in)
NAND Truth Table
in
Patrick Schaumont
in in
out
in
NAND Truth Table
in
Patrick Schaumont
in in
out
in
With any input '0', ouput MUST be '1'.
NAND Truth Table
in
Patrick Schaumont
in in
out
in
With an input unknown, we have no clue what the output may be
(even if we know the other input)
NOR Truth Table
in
in
Patrick Schaumont
in in
out
in
NOR Truth Table
in
in
Patrick Schaumont
in in
out
in
In all other cases, we don't know.
XOR Truth Table
in in
out
in
in
Patrick Schaumont
in
What should go here? 0 or X?
What would Verilog do?
Patrick Schaumont
What would Verilog do?
Patrick Schaumont
Gate Instantiation: Bit Comparator Example
Patrick Schaumont
Pseudocode:
if (A = 1) and (B = 0)
then Q is 1
else if (A=B) and (G = 1)
then Q is 1
else Q is 0
Gate Instantiation: Bit Comparator Example
Patrick Schaumont
if A > B then Q = 1
if ((A = B) and (G = 1)) then Q = 1