17
1 Digital Design Copyright © 2006 Frank Vahid Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley and Sons Publishers, 2007. http://www.ddvahid.com Copyright © 2007 Frank Vahid Instructors of courses requiring Vahid's Digital Design textbook (published by John Wiley and Sons) have permission to modify and use these slides for customary course- related activities, subject to keeping this copyright notice in place and unmodified. These slides may be posted as unanimated pdf versions on publicly-accessible course websites.. PowerPoint source (or pdf with animations) may not be posted to publicly-accessible websites, but may be posted for students on internal protected sites or distributed directly to students by other electronic means. Instructors may make printouts of the slides available to students for a reasonable photocopying charge, without incurring royalties. Any other use requires explicit permission. Instructors may obtain PowerPoint source or obtain special use permissions from Wiley – see http://www.ddvahid.com for information.

Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley

  • View
    297

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley

1Digital DesignCopyright © 2006 Frank Vahid

Digital Design

Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley and Sons Publishers, 2007.

http://www.ddvahid.com

Copyright © 2007 Frank Vahid

Instructors of courses requiring Vahid's Digital Design textbook (published by John Wiley and Sons) have permission to modify and use these slides for customary course-related activities, subject to keeping this copyright notice in place and unmodified. These slides may be posted as unanimated pdf versions on publicly-accessible course websites.. PowerPoint source (or pdf with animations) may not be posted to publicly-accessible websites, but may be posted for students on internal protected sites or distributed directly to students by other electronic means. Instructors may make printouts of the slides available to students for a reasonable photocopying charge, without incurring royalties. Any other use requires explicit permission. Instructors may obtain PowerPoint source or obtain special use permissions from Wiley – see http://www.ddvahid.com for information.

Page 2: Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley

2Digital DesignCopyright © 2006 Frank Vahid

Switches• Electronic switches are the basis of

binary digital circuits– Electrical terminology

• Voltage: Difference in electric potential between two points

– Analogous to water pressure

• Current: Flow of charged particles– Analogous to water flow

• Resistance: Tendency of wire to resist current flow

– Analogous to water pipe diameter

• V = I * R (Ohm’s Law)

4.5 A

2 ohms

9V

0V 9V

+–

2.2

Page 3: Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley

3Digital DesignCopyright © 2006 Frank Vahid

Switches• A switch has three parts

– Source input, and output• Current wants to flow from

source input to output

– Control input• Voltage that controls whether

that current can flow

“off”

“on”

outputsourceinput

outputsourceinput

controlinput

controlinput

(b)

relay vacuum tube

discrete transistor

IC

quarter(to see the relative size)

a

Page 4: Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley

4Digital DesignCopyright © 2006 Frank Vahid

The CMOS Transistor• CMOS transistor

– Basic switch in modern ICs

gate

source drain

oxide

A positivevoltage here...

...attracts electrons here,turning the channel

between source and draininto aconductor.

(a)

IC package

IC

does notconduct

0

conducts

1gate

nMOS

does notconduct

1gate

pMOS

conducts

0

Silicon -- not quite a conductor or insulator:Semiconductor

2.3

a

Page 5: Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley

5Digital DesignCopyright © 2006 Frank Vahid

Logic Design• Combinational Circuits

– Output is function of inputs only– Design using logic gates as building block or truth table – Logic optimization

• Sequential Circuits– Using combinational circuits in conjunction with memory elements

(Circuits that operate one cycle at a time)– Design Using Finite State Machine and state encoding followed by

combinational circuit design – Optimization such as state minimization, state encoding, etc.

• Objectives– Delay, area, power, cost, etc.

Page 6: Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley

6Digital DesignCopyright © 2006 Frank Vahid

Boolean Logic GatesBuilding Blocks for Digital Circuits

(Because Switches are Hard to Work With)

• “Logic gates” are better digital circuit building blocks than switches (transistors)– Why?...

2.4

Page 7: Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley

7Digital DesignCopyright © 2006 Frank Vahid

Relating Boolean Algebra to Digital Design

• Implement Boolean operators using transistors– Call those implementations logic gates.

x0011

y0101

F0001

x0011

y0101

F0111

x01

F10

Fxx

yF

ORNOT

Fx

y

AND

0

1

y

x

x

y

F

1

0

Fx

Symbol

Truth table

Transistorcircuit

0

1

x y

Fy

x

Page 8: Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley

8Digital DesignCopyright © 2006 Frank Vahid

NOT/OR/AND Logic Gate Timing Diagrams

0

1

1

0

time

F

x

1

0x

y

F1

1

0

0

time

1

0x

y

F1

1

0

0

time

Page 9: Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley

9Digital DesignCopyright © 2006 Frank Vahid

Some Circuit Drawing Conventions

x

yF

no yes

no

not ok

ok

yes

Page 10: Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley

10Digital DesignCopyright © 2006 Frank Vahid

Representations of Boolean Functions

• A function can be represented in different ways– Above shows seven representations of the same functions F(a,b), using

four different methods: English, Equation, Circuit, and Truth Table

2.6

a

a

b

F

F

Circuit 1

Circuit 2

(c)

(d)

English 1: F outputs 1 when a is 0 and b is 0, or when a is 0 and b is 1.

English 2: F outputs 1 when a is 0, regardless of b’s value(a)

(b)

a

0

0

1

1

b

0

1

0

1

F

1

1

0

0

The function F

Truth table

Equation 2: F(a,b) = a’

Equation 1: F(a,b) = a’b’ + a’b

Page 11: Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley

11Digital DesignCopyright © 2006 Frank Vahid

Truth Table Representation of Boolean Functions• Define value of F for

each possible combination of input values– 2-input function: 4 rows– 3-input function: 8 rows– 4-input function: 16 rows

• Q: Use truth table to define function F(a,b,c) that is 1 when abc is 5 or greater in binary

c0011001100110011

d0101010101010101

a0000000011111111

b0000111100001111

Fc01010101

a00001111

b00110011

Fa0011

b0101

F

(a)

(b)

(c)

c01010101

a00001111

b00110011

F0

0

0

0

0

1

1

1

a

Page 12: Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley

12Digital DesignCopyright © 2006 Frank Vahid

Combinational Logic Design Process

Step Description

Step 1 Capture the function

Create a truth table or equations, whichever is most natural for the given problem, to describe the desired behavior of the combinational logic.

Step 2 Convert to equations

This step is only necessary if you captured the function using a truth table instead of equations. Create an equation for each output by ORing all the minterms for that output. Simplify the equations if desired.

Step 3 Implement as a gate-based circuit

For each output, create a circuit corresponding to the output’s equation. (Sharing gates among multiple outputs is OK optionally.)

2.7

Page 13: Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley

13Digital DesignCopyright © 2006 Frank Vahid

More Gates

• NAND: Opposite of AND (“NOT AND”)• NOR: Opposite of OR (“NOT OR”)• XOR: Exactly 1 input is 1, for 2-input

XOR. (For more inputs -- odd number of 1s)

• XNOR: Opposite of XOR (“NOT XOR”)

2.8

x0011

y0101

F1001

x0011

y0101

F0110

x0011

y0101

F1000

x0011

y0101

F1110

x

y

x

yFF

NORNAND XOR XNOR1

0

x y

Fx

y

1

0

x

x

y

y

F

NAND NOR

• NAND same as AND with power & ground switched

• Why? nMOS conducts 0s well, but not 1s (reasons beyond our scope) -- so NAND more efficient

• Likewise, NOR same as OR with power/ground switched

• AND in CMOS: NAND with NOT

• OR in CMOS: NOR with NOT

• So NAND/NOR more common

Page 14: Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley

14Digital DesignCopyright © 2006 Frank Vahid

More Gates: Example Uses

• Aircraft lavatory sign example– S = (abc)’

• Detecting all 0s– Use NOR

• Detecting equality – Use XNOR

• Detecting odd # of 1s– Use XOR– Useful for generating “parity”

bit common for detecting errors

S

Circuit

abc

000

1 a0b0

a1b1

a2b2

A=B

Page 15: Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley

15Digital DesignCopyright © 2006 Frank Vahid

Completeness of NAND• Any Boolean function can be implemented using just NAND

gates. Why?– Need AND, OR, and NOT– NOT: 1-input NAND (or 2-input NAND with inputs tied together)– AND: NAND followed by NOT– OR: NAND preceded by NOTs

• Likewise for NOR

Page 16: Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley

16Digital DesignCopyright © 2006 Frank Vahid

Additional ConsiderationsSchematic Capture and Simulation

• Schematic capture– Computer tool for user to capture logic circuit graphically

• Simulator– Computer tool to show what circuit outputs would be for given inputs

• Outputs commonly displayed as waveform

2.10

SimulateSimulate

d3

d2

d1

d0

i0

i1Outputs

Inputs

d3

d2

d1

d0

i0

i1Outputs

Inputs

Page 17: Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley

17Digital DesignCopyright © 2006 Frank Vahid

Additional ConsiderationsNon-Ideal Gate Behavior -- Delay

• Real gates have some delay– Outputs don’t change immediately after inputs change