Docsity

Gate-level Modeling of Digital Circuits: Lecture 4 by Patrick Schaumont - Prof. Patrick Ro, Study notes of Electrical and Electronics Engineering

Partial preview of the text

Download Gate-level Modeling of Digital Circuits: Lecture 4 by Patrick Schaumont - Prof. Patrick Ro and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

ECE 4514

Digital Design II

Spring 2007

Patrick Schaumont

Lecture 4: Gate Level Modeling

Patrick Schaumont

Gate-level Modeling 

In this lecture we focus on modeling and simulation ofgate networks



We will use structural modeling techniques



We will use delay modeling to estimate the delay of acircuit

Patrick Schaumont



We will discuss several examples:

bit comparator

byte comparator

latch

master/slave flip-flop

Primitive Gates 

A

primitive

is a module which you do not have to

describe as the simulator already knows it



There are 14 different primitive gates in Verilog

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



New primitive gates can be added

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 

Must deal with 'Z' and 'X' input (4-valued logic)



Z is undefined (floating), X is unknown

in

X

Z

Patrick Schaumont

in in

out

in

X

Z

NAND Truth Table 

Must deal with 'Z' and 'X' input (4-valued logic)



Z is undefined (floating), X is unknown

in

X

Z

Patrick Schaumont

in in

out

in

X

Z

With any input '0', ouput MUST be '1'.

NAND Truth Table 

Must deal with 'Z' and 'X' input (4-valued logic)



Z is undefined (floating), X is unknown

in

X

Z

Patrick Schaumont

in in

out

in

X

Z

X

X X

X

X

X

X

X

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

X

Z

Patrick Schaumont

in in

out

in

X

Z

NOR Truth Table

in

in

X

Z

X

X

Patrick Schaumont

in in

out

in

X

Z

X

X

X

X

X X

In all other cases, we don't know.

XOR Truth Table

in in

out

in

in

X

Z

X

X

X

X X

X X X

Patrick Schaumont

in

X

Z

X X

X X

X

X

What should go here? 0 or X?

What would Verilog do? 

If you answered 'it should be X', then what is theoutput of the following circuit?

in = X

out?

Patrick Schaumont

What would Verilog do? 

If you answered 'it should be X', then what is theoutput of the following circuit?

in = X

out?

Patrick Schaumont

in = 0

out = 1

in = 1

out = 1

Gate Instantiation: Bit Comparator Example 

Bit comparator: Q indicates if A > B

G is a cascading input

A B

G

Q

Patrick Schaumont

G

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

AB

G

Gate Instantiation: Bit Comparator Example 

Bit comparator: Q indicates if A > B

G is a cascading input

A B

G

Q

Patrick Schaumont

G

AB

G

if A > B then Q = 1

if ((A = B) and (G = 1)) then Q = 1