eece 481 static mos gate and flip-flop circuitscourses.ece.ubc.ca/481/lectures/lecture_08.pdfeece481...

30
1 EECE 481 Static MOS Gate and Flip-Flop Circuits Lecture 8 EECE 481 Lecture 8 Reza Molavi Dept. of ECE University of British Columbia [email protected] Slides Courtesy : Dr. Res Saleh (UBC), Dr. D. Sengupta (AMD), Dr. B. Razavi (UCLA)

Upload: lethuy

Post on 30-Apr-2018

223 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

1

EECE 481

Static MOS Gate and Flip-Flop Circuits Lecture 8

EECE 481 Lecture 8

Reza Molavi

Dept. of ECE

University of British Columbia

[email protected]

Slides Courtesy : Dr. Res Saleh (UBC), Dr. D. Sengupta (AMD), Dr. B. Razavi (UCLA)

Page 2: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

2 EECE481 Lecture 08

Combinational MOS Logic

• Now that we understand the logic abstraction and the properties of valid logic gates, we can consider the issues of design basic building blocks of digital systems

• Typical combinational gate is a multiple input – single output system

• Performs Boolean operations on multiple input variables, drives one or more gates

• Design parameters and considerations:

– Propagation delay

– Static and dynamic power

– Area

– Noise margins (VTC)

V1

Combinational

Logic Circuit

V2

V3

Vn

Vout

= f (V1, V

2, V

3, ... V

n)

Fanins =

no. of inputs

Fanouts = no. of gates driven

Page 3: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

3 EECE481 Lecture 08

Pull-up and Pull-down Networks

• PMOS pull-up and NMOS pull-down networks are duals of each other

• Configuration of pull-up and pull-down networks create a current connection from the output to either Vdd or Gnd, based on the inputs

• PMOS devices have lower drive capability and thus require wider devices to achieve the same on-resistance as its pull-down counterpart

A

B

C

:

A

B

C

:

p-complex

n-complex

F Basic Structure

Of all CMOS logic gates

VDD

Page 4: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

4 EECE481 Lecture 08

Static CMOS Logic Gates

• These are the most common type of static gates

• Can implement any Boolean expression with these two gates

• Why is static CMOS so popular?

– It’s very robust!

– it will eventually produce the right answer

– Power, shrinking VDD, more circuit noise, process variations, etc.

limit use of other design styles

A

B A

B

F

F

Page 5: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

5 EECE481 Lecture 08

More Properties of Static CMOS Logic

• Fully complementary

• Low static power dissipation!

• Outputs swing full rail – Vdd (VOH) to Gnd (VOL)

• Works fine at low Vdd voltages

– But lower Vdd = less current = slower speed

• Combinational operation

– Feed it some inputs, wait some delay, result comes out

– No clocks required for normal operation

• Moderately good performance

– Drive strength is proportional to transistor size

– Large loads require large W

• Dual logic networks for N- and P-Channel devices

Page 6: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

6 EECE481 Lecture 08

“Beta Ratio” for Static Gates

• The ratio between the NMOS and PMOS device is called the beta ratio

• We need to size CMOS static gates to deliver a target speed. But how?

• Start by sizing the inverter to deliver the target speed, then map size to gate

• Suppose:

Reqp (PMOS) 2.5 Reqn (NMOS) under identical conditions

(actually Reqp=30kW and Reqn=12.5kW)

• Then ratio between PMOS:NMOS should be 2.5:1

• Beta ratio sets:

– Switching point of the gate output drive

– Input capacitance

– L-to-H vs. H-to-L transition times

– Usually find a 2:1 ratio in CMOS inverter

W

2W Is 2:1 the right ratio?

For equal rise and fall times.

How about for minimum delay?

2.5:1

1.7:1

Page 7: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

7 EECE481 Lecture 08

NAND and NOR Sizing

4W

4W

WW

2W2W

2W

2W

2W

W

(a) (b) (c)

CL CL CL

Inverter NAND NOR

• Drive strength determined by device widths - W (assume L is minimum size)

• For the moment, consider only CL(we are ignoring the device self-capacitance)

• Pick the right sizes for the basic inverter and then assign values to gates

• What does that mean for parallel and series combinations?

– For parallel transistors, direct mapping from inverter

– For series transistors, need to compute equivalent sizes

First Design Inverter Then Map Results to Gates

Page 8: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

8 EECE481 Lecture 08

Equivalent Sizes

poly diffusion

3W 3W

L

L

L

3L

Actual Layout Equivalent Device

poly

A

B

C

F F

Consider a three-input NAND gate (NMOS portion only):

Page 9: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

9 EECE481 Lecture 08

VTC and Noise Margins

V

V OUT V OUT

I N V

V OUT V OUT

I N

NOR gate NAND gate

inverter inverter

Both inputs tied

One input only

Both inputs tied

One input only

A

BA

B

FF

Page 10: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

10 EECE481 Lecture 08

Complex Logic Circuits

• The ability to easily build complex logic gates is one of the most

attractive features of MOS logic circuits

• Design principle of the pull-down network:

– OR operations are performed by parallel connected drivers

– AND operations are performed by series connected drivers

– Inversion is provided by the nature of MOS circuit operation

• Don’t get too carried away… Use this knowledge wisely

– Remember that complex functions don’t have to be

implemented with a single gate

– Can break up very complicated Boolean expressions into a

cascade of gate stages

– Limit series stacks to 3~4

• We will use De Morgan’s Law to build the dual networks

Page 11: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

11 EECE481 Lecture 08

Review of DeMorgan’s Law

• De Morgan’s theorem:

The complement of any logic function is found by complementing

all input variables and replacing all AND operations with OR and all

OR operations with AND

• Use De Morgan’s law to find the complement of a function for the pull-

down network (if needed)

• Use Duality to find the pull-up network

=

=

a

b

a

b

a

b

a

b

ab a b

a b a b

Page 12: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

12 EECE481 Lecture 08

Complex CMOS Gate Design Example

• Implement an AND-OR-INVERT (AOI) function

Z = (A • B + C)

• Get the expression into forms that enable easy implementation of pull-up and pull-down networks

Z = (A B +C) Z = (A + B) C

pull-up

A

B

C

Z = A B + C

pull-down

A B

C Z = (A + B) C

B

C

A

A

B

C

Z

Complement of Z Dual of Complement of Z Combine Results

Page 13: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

13 EECE481 Lecture 08

XOR and XNOR Gates

VDD

a

a a

a b

b

b b

VDD

a

a a

a b

b

b b

a

b

f a

b

f

f = ab + ab f = ab + a b

Page 14: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

14 EECE481 Lecture 08

CMOS Multiplexer

VDD

s

a

b

a

s

b

s

s

f

f = as+bs

a

b

1

0

s

Page 15: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

15 EECE481 Lecture 08

The Bad News

• Slows down dramatically for large fanins due to long series

stack of transistors

– fanin = number of inputs

– PMOS series stacks worse than nMOS series stacks

• Large number of transistors

– 2n devices for n-input NAND

– At least 2 devices per input

• Bigger layout

– n+ to p+ spacing rule and well spacing rule

– Large device sizes required to counteract series stack

• Limit the fanin to 3 or 4…or delay and area will be too large

Page 16: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

16 EECE481 Lecture 08

Eight-Input AND gate

8W

8W

8W

8W

8W

8W

8W

8W

2W

This is not acceptable

Page 17: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

17 EECE481 Lecture 08

Multi-level Logic Implementations

NAND2-INV-NAND2-INV NAND2-NOR2-NAND2-INV

• There are many more options to try

• Which is the best? We need a quick way of answering this question

Page 18: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

18 EECE481 Lecture 08

Pseudo-NMOS Logic – NOR gate

A

BZ = A+B

A B Z

0 00 1

1 0

1 1

10

0

0

WLoad

WB

WAA B

Z

• Design issues:

– Sizing Ratio

• Ratio pull-up to pull-down (VOL & VOH)

• Propagation delay

– Subthreshold current can degrade VOH slightly

– VOL decreases as more devices turning on

Page 19: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

19 EECE481 Lecture 08

Pseudo-nMOS Logic – NAND Gate

A

B

Z

A

BZ = A B

A B Z

0 00 1

1 0

1 1

11

1

0

WA

WB

• Issues

– Sizing Ratio

• Need to make pull-down devices wider

– Parasitic cap goes up with bigger devices

– Lower devices in stack slower compared to upper ones because

they see more capacitance

Page 20: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

20 EECE481 Lecture 08

AND8 Option - Use Pseudo-NMOS

Wp

Wn

1 2 . . . 8

1 2 . . . 8

Page 21: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

21 EECE481 Lecture 08

Properties of Static Pseudo-NMOS Gates

• DC power

– always conducting current when output is low

• VOL and VOH depend on sizing ratio and input states

• Poor low-to-high transition

• Large fanin NAND gates tend to get big due to ratioing

• As transistor count increases, power consumption is too high

– Cannot use this approach for all gates on the chip

• But what are its advantages?

– Good for wide NOR structures

• Memory decoder

– Smaller number of transistors (area) / logic function

Page 22: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

22 EECE481 Lecture 08

Flip-flops and latches are important logic elements used for storage

We typically build finite state machines from combinational logic (next state logic)

and latches or flip-flops (storage elements) to store the state information.

We then control latches and flip-flops with a clock to create synchronous logic

circuits. The clock ensures that we can tell the difference between previous,

current and future states of the logic circuit

Flip-Flops and Latches

Clock

this nextprev

D Q

Clk

D Q

Clk

Logic

N

Page 23: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

23 EECE481 Lecture 08

Latch vs. Flip-flop

Latch (level-sensitive, transparent)

When the clock is high it passes In value to Out

When the clock is low, it holds value that In had when the clock fell

Flip-Flop (edge-triggered, non transparent)

On the rising edge of clock (pos-edge trig), it transfers the value of In to Out

It holds the value at all other times.

InIn

OutOut

ClkClk

In

Out Out

In

Latch Flip-Flop

CLK CLK

Page 24: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

24 EECE481 Lecture 08

FF Clocking Overhead

D in

Clk

Qout

T setup + T clk-q

T hold

will work Flip Flop won’t work

may work

FF have setup and hold times that must be satisfied:

If Din arrives before setup time and is stable after the hold time, FF will work; if Din

arrives after hold time, it will fail; in between, it may or may not work; FF delays the

slowest signal by the setup + clk-q delay in the worst case

Page 25: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

25 EECE481 Lecture 08

Latch Clocking Overhead

Latch

T d-q

T hold

T setup

Latches also have setup and hold times that must be satisfied:

But latch has small setup and hold times; however, it delays the late arriving signals

by Td-q and this is more important than the setup and hold times.

D in

Clk

Qout

Page 26: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

26 EECE481 Lecture 08

SR Latch with NOR Gates

• Simplest FF is a cross-coupled pair of NOR gates

• When S=1, Q=1

• When R=1, Q=0

• By setting both S=0 and R=0, the previous state is held

• Illegal state occurs when R=1 and S=1 (actually, the final state

is determined by which signal goes low last)

S

R

Q

Q

S

R Q

Q S

0

0

1

1

R

0

1

0

1

Q

Q

0

1

0

Q

Q

1

0

0

Page 27: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

27 EECE481 Lecture 08

SR Latch with NAND Gates

• Similar to NOR latch except that the signals are active low

• Illegal state is now S=0 and R=0

• Hold state is S=1 and R=1

S

R Q

Q

S

R Q

Q S

1

0

1

0

R

1

1

0

0

Q

Q

1

0

1

Q

Q

0

1

1

Page 28: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

28 EECE481 Lecture 08

JK Flip-flop

• To avoid illegal state, use JK flip-flop

• In NAND implementation, J=K=1 flips the state of the output

• Clock is used to enable the output

• Will oscillate if clock is high too long when J=K=1

J

K

S

R Q

Q

Jn

0

0

1

1

Kn

0

1

0

1

Qn+1

Qn

0

1

Qn

CK

Q

Q

NAND

Latch

Q

QJ

K

CK

Page 29: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

29 EECE481 Lecture 08

Master-Slave JK Flip-flop

• Cascade of two JK Flip-flops

• Master activated by CK, Slave activated by CK

• Master latches new data, slave launches old data

J

K

S

R Q

Q

CKNAND

Latch

S

R Q

Q

NAND

Latch

Q

Q

Page 30: EECE 481 Static MOS Gate and Flip-Flop Circuitscourses.ece.ubc.ca/481/lectures/Lecture_08.pdfEECE481 Lecture 08 3 Pull-up and Pull-down Networks • PMOS pull-up and NMOS pull-down

30 EECE481 Lecture 08

Clocked D Flip-flop

• Very useful FF

• Widely used in IC design for temporary storage of data

• May be edge-triggered (Flip-flop) or level-sensitive (transparent D-

latch)

D Qn+1

0 0

1 1

D Q

CK Q

D-FF

D

CK

Q

Q

Can implement

As AOI function