Digital Logic SequenAal Circuits 2 Quiz 1 Return Quiz - - PowerPoint PPT Presentation

digital logic sequenaal circuits
SMART_READER_LITE
LIVE PREVIEW

Digital Logic SequenAal Circuits 2 Quiz 1 Return Quiz - - PowerPoint PPT Presentation

Computer Systems and Networks ECPE 170 Jeff Shafer University of the Pacific Digital Logic SequenAal Circuits 2 Quiz 1 Return


slide-1
SLIDE 1

ì ¡

Computer ¡Systems ¡and ¡Networks ¡

ECPE ¡170 ¡– ¡Jeff ¡Shafer ¡– ¡University ¡of ¡the ¡Pacific ¡

Digital ¡Logic ¡ SequenAal ¡Circuits ¡

slide-2
SLIDE 2

Quiz ¡1 ¡

ì Return ¡Quiz ¡1 ¡and ¡review ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

2 ¡

slide-3
SLIDE 3

Upcoming ¡Events ¡

ì Quiz ¡2 ¡– ¡Friday ¡Feb ¡3rd ¡ ¡

ì Topics ¡may ¡or ¡may ¡not ¡include: ¡ ¡

ì Simplifying ¡Boolean ¡expressions ¡with ¡idenAAes ¡ ì ConverAng ¡between ¡a ¡truth ¡table ¡and ¡a ¡circuit ¡

diagram ¡(with ¡logic ¡gates) ¡

ì Common ¡combinaAonal ¡circuits: ¡adders, ¡decoders, ¡

mulAplexers, ¡shiQers ¡

ì Basic ¡operaAon ¡of ¡these ¡devices, ¡i.e. ¡inputs ¡and ¡outputs ¡

ì SequenAal ¡circuits: ¡SR, ¡JK, ¡D ¡flip-­‑flops ¡

ì Basic ¡operaAon ¡of ¡these ¡devices, ¡i.e. ¡inputs ¡and ¡outputs ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

3 ¡

slide-4
SLIDE 4

Recap ¡from ¡Last ¡Class ¡

ì Why ¡do ¡real ¡hardware ¡devices ¡use ¡NAND ¡/ ¡NOR ¡

gates ¡instead ¡of ¡AND ¡/ ¡OR ¡/ ¡NOT ¡gates? ¡

ì These ¡are ¡“universal” ¡gates ¡– ¡any ¡funcAon ¡can ¡be ¡

made ¡using ¡only ¡NAND ¡or ¡only ¡NOR ¡gates ¡

ì Simplifies ¡manufacturing ¡to ¡use ¡the ¡same ¡gate ¡type ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

4 ¡

slide-5
SLIDE 5

Recap ¡from ¡Last ¡Class ¡

ì What ¡is ¡a ¡combinaLonal ¡circuit? ¡

ì Circuit ¡where ¡output ¡is ¡based ¡on ¡input ¡only ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

5 ¡

slide-6
SLIDE 6

Recap ¡from ¡Last ¡Class ¡

ì What ¡is ¡the ¡difference ¡between ¡a ¡half-­‑adder ¡and ¡a ¡

full-­‑adder? ¡

ì Half ¡adder ¡adds ¡two ¡inputs ¡(x, ¡y) ¡and ¡produces ¡sum ¡

and ¡carry-­‑out ¡

ì Full ¡adder ¡adds ¡three ¡inputs ¡(x, ¡y, ¡carry-­‑in) ¡and ¡

produces ¡sum ¡and ¡carry-­‑out ¡

ì We ¡build ¡it ¡out ¡of ¡two ¡half-­‑adders! ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

6 ¡

slide-7
SLIDE 7

Combinational ¡Circuit ¡– ¡Multiplexer ¡

ì A ¡mulLplexer ¡selects ¡a ¡single ¡

  • utput ¡from ¡several ¡inputs ¡

ì Which ¡input ¡is ¡chosen? ¡

ì

Selected ¡by ¡the ¡value ¡on ¡the ¡ mulAplexer’s ¡control ¡lines ¡ ì To ¡select ¡from ¡n ¡inputs, ¡log2n ¡

control ¡lines ¡are ¡needed. ¡

7 ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-8
SLIDE 8

Combinational ¡Circuit ¡– ¡Multiplexer ¡

ì ImplementaAon ¡of ¡a ¡4-­‑to-­‑1 ¡mulAplexer ¡

8 ¡

If ¡S0 ¡= ¡1 ¡and ¡S1 ¡= ¡0, ¡ which ¡input ¡is ¡ transferred ¡to ¡the ¡

  • utput? ¡ ¡ ¡ ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-9
SLIDE 9

Combinational ¡Circuit ¡– ¡Shifter ¡

ì This ¡shiUer ¡moves ¡

the ¡bits ¡of ¡a ¡4-­‑bit ¡ input ¡one ¡posiAon ¡to ¡ the ¡leQ ¡or ¡right ¡

ì If ¡S ¡= ¡0, ¡in ¡which ¡

direcLon ¡do ¡the ¡ input ¡bits ¡shiU? ¡ ¡ ¡

ì

LeQ! ¡

9 ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-10
SLIDE 10

Combinational ¡Circuits ¡

ì Does ¡the ¡output ¡of ¡a ¡combinaLonal ¡circuit ¡change ¡

instantly ¡when ¡the ¡input ¡changes? ¡

ì No ¡– ¡takes ¡a ¡Any ¡(but ¡measurable) ¡length ¡of ¡Ame ¡ ì Electrical ¡signals ¡in ¡a ¡wire ¡have ¡a ¡finite ¡speed ¡ ì A ¡transistor ¡takes ¡a ¡finite ¡Ame ¡to ¡change ¡state ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

10 ¡

slide-11
SLIDE 11

ì ¡

Sequential ¡Circuits ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

11 ¡

slide-12
SLIDE 12

Sequential ¡Circuits ¡

ì CombinaAonal ¡logic ¡circuits ¡

ì Immediately ¡apply ¡Boolean ¡funcAon ¡to ¡set ¡of ¡inputs ¡ ì This ¡does ¡not ¡work ¡for ¡all ¡problems! ¡

ì What ¡if ¡we ¡want ¡a ¡circuit ¡that ¡changes ¡its ¡value ¡

based ¡on ¡(a) ¡its ¡inputs ¡and ¡(b) ¡its ¡current ¡state? ¡

ì These ¡circuits ¡have ¡to ¡“remember” ¡their ¡current ¡

state ¡

ì This ¡is ¡a ¡sequenLal ¡logic ¡circuit ¡

12 ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-13
SLIDE 13

Sequential ¡Circuits ¡

ì SequenAal ¡logic ¡circuits ¡require ¡a ¡means ¡by ¡which ¡

events ¡can ¡be ¡sequenced ¡

ì The ¡clock! ¡

ì What ¡is ¡a ¡clock? ¡

ì Not ¡a ¡“wall ¡clock” ¡ ì Circuit ¡that ¡sends ¡electrical ¡pulses ¡through ¡a ¡system ¡

13 ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-14
SLIDE 14

Sequential ¡Circuits ¡

ì State ¡changes ¡occur ¡in ¡sequenAal ¡circuits ¡only ¡when ¡

the ¡clock ¡“Acks” ¡

ì Circuits ¡can ¡change ¡state ¡on ¡the: ¡

ì Rising ¡edge, ¡or ¡ ì Falling ¡edge, ¡or ¡ ì When ¡the ¡clock ¡pulse ¡reaches ¡its ¡highest ¡voltage ¡

14 ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

Pick ¡1 ¡op)on, ¡not ¡all ¡3! ¡

slide-15
SLIDE 15

Sequential ¡Circuits ¡

ì Edge-­‑triggered ¡circuits ¡ ¡

ì Change ¡state ¡on ¡the ¡rising ¡edge ¡or ¡falling ¡edge ¡of ¡

the ¡clock ¡pulse ¡ ì Level-­‑triggered ¡circuits ¡ ¡

ì Change ¡state ¡when ¡the ¡clock ¡voltage ¡reaches ¡its ¡

highest ¡or ¡lowest ¡level ¡

15 ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-16
SLIDE 16

Sequential ¡Circuits ¡

ì How ¡can ¡we ¡make ¡a ¡circuit ¡that ¡uses ¡its ¡current ¡

  • utput ¡in ¡deciding ¡its ¡next ¡output? ¡

ì Feedback ¡– ¡loop ¡an ¡output ¡back ¡to ¡the ¡input ¡

ì Example: ¡ ¡

ì If ¡Q ¡is ¡0 ¡it ¡will ¡always ¡be ¡0 ¡ ì If ¡Q ¡is ¡1, ¡it ¡will ¡always ¡be ¡1 ¡

16 ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-17
SLIDE 17

Sequential ¡Circuits ¡– ¡SR ¡Flip-­‑flop ¡

ì SR ¡Flip-­‑flop ¡employs ¡feedback ¡

ì The ¡“SR” ¡stands ¡for ¡set/reset ¡ ì Basic ¡storage ¡element ¡

17 ¡

Internal ¡design ¡(clock ¡not ¡shown): ¡ Block ¡diagram ¡(with ¡clock): ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-18
SLIDE 18

Sequential ¡Circuits ¡– ¡SR ¡Flip-­‑flop ¡

ì What ¡does ¡the ¡truth ¡table ¡of ¡an ¡SR ¡flip-­‑flop ¡look ¡

like? ¡

ì Q(t) ¡is ¡the ¡value ¡of ¡the ¡output ¡Q ¡at ¡Ame ¡t ¡ ì Q(t+1) ¡is ¡the ¡value ¡of ¡Q ¡aQer ¡the ¡next ¡clock ¡pulse ¡

18 ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-19
SLIDE 19

Sequential ¡Circuits ¡– ¡SR ¡Flip-­‑flop ¡

ì The ¡SR ¡flip-­‑flop ¡actually ¡has ¡

three ¡inputs: ¡S, ¡R, ¡and ¡its ¡ current ¡output, ¡Q ¡

ì More ¡complete ¡truth ¡table ¡

ì

Two ¡undefined ¡values! ¡

ì

SR ¡flip-­‑flop ¡unstable ¡when ¡ “set” ¡and ¡“reset” ¡are ¡both ¡ acAve ¡

19 ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-20
SLIDE 20

Sequential ¡Circuits ¡– ¡JK ¡Flip-­‑flop ¡

ì JK ¡flip-­‑flop ¡removes ¡this ¡risk ¡

ì Ensures ¡that ¡both ¡“set” ¡and ¡“reset” ¡inputs ¡to ¡an ¡SR ¡

flip-­‑flop ¡will ¡never ¡both ¡be ¡1 ¡

ì “JK” ¡named ¡aQer ¡Jack ¡Kilby ¡

ì 2000 ¡Nobel ¡Prize ¡winner ¡for ¡invenAon ¡of ¡the ¡

integrated ¡circuit ¡while ¡at ¡Texas ¡Instruments ¡

20 ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-21
SLIDE 21

Sequential ¡Circuits ¡– ¡JK ¡Flip-­‑flop ¡

ì JK ¡flip-­‑flop ¡is ¡really ¡just ¡a ¡

wrapper ¡around ¡a ¡basic ¡SR ¡ flip-­‑flop ¡

ì JK ¡is ¡stable ¡for ¡all ¡inputs ¡

ì

J=K=1: ¡Toggle ¡output ¡

21 ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-22
SLIDE 22

Sequential ¡Circuits ¡– ¡D ¡Flip-­‑flop ¡

ì D ¡Flip-­‑Flop ¡

ì Another ¡modificaAon ¡of ¡the ¡SR ¡flip-­‑flop ¡ ì D=Data ¡(but ¡I ¡remember ¡D=Delay…) ¡

ì Output ¡of ¡the ¡flip-­‑flop ¡remains ¡the ¡same ¡during ¡

subsequent ¡clock ¡pulses ¡

ì Output ¡changes ¡only ¡when ¡D ¡changes ¡

22 ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-23
SLIDE 23

Sequential ¡Circuits ¡– ¡D ¡Flip-­‑flop ¡

ì D ¡flip-­‑flop ¡is ¡the ¡fundamental ¡circuit ¡of ¡computer ¡

memory ¡

ì Usually ¡illustrated ¡using ¡the ¡block ¡diagram ¡shown ¡

below ¡

23 ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-24
SLIDE 24

ì ¡

State ¡Machines ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

24 ¡

slide-25
SLIDE 25

State ¡Machines ¡

ì How ¡do ¡we ¡design ¡complicated ¡sequenAal ¡systems? ¡ ¡

ì

Finite ¡State ¡Machine ¡(FSM) ¡

ì

In ¡visual ¡form ¡

ì A ¡set ¡of ¡nodes ¡that ¡hold ¡the ¡states ¡of ¡the ¡machine ¡ ì A ¡set ¡of ¡arcs ¡that ¡connect ¡the ¡states ¡

ì Two ¡different ¡types ¡of ¡state ¡machines: ¡Moore ¡and ¡

Mealy ¡

ì

Both ¡produce ¡systems ¡that ¡produce ¡the ¡same ¡output ¡

ì

Differ ¡only ¡in ¡how ¡the ¡output ¡of ¡the ¡machines ¡are ¡ expressed ¡

ì Moore: ¡place ¡outputs ¡on ¡each ¡node ¡ ì Mealy: ¡present ¡outputs ¡on ¡the ¡transiAons ¡ ¡

25 ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-26
SLIDE 26

JK ¡Flip-­‑Flop ¡in ¡State ¡Machine ¡Form ¡

Moore ¡FSM ¡ Mealy ¡FSM ¡

26 ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

Output ¡ Inputs ¡(JK) ¡ State ¡ Output ¡ Inputs ¡(JK) ¡ State ¡

slide-27
SLIDE 27

Different ¡Implementations ¡

ì Although ¡the ¡behavior ¡of ¡Moore ¡and ¡Mealy ¡

machines ¡is ¡idenAcal, ¡their ¡implementaAons ¡differ: ¡

27 ¡

Moore ¡ machine: ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-28
SLIDE 28

Different ¡Implementations ¡

ì Although ¡the ¡behavior ¡of ¡Moore ¡and ¡Mealy ¡

machines ¡is ¡idenAcal, ¡their ¡implementaAons ¡differ: ¡

28 ¡

Mealy ¡ machine ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-29
SLIDE 29

Sequential ¡Circuit ¡Applications ¡

ì When ¡do ¡I ¡use ¡sequenAal ¡circuits? ¡

ì Whenever ¡the ¡applicaAon ¡is ¡“stateful” ¡ ì The ¡next ¡state ¡of ¡the ¡machine ¡depends ¡on ¡the ¡

current ¡state ¡of ¡the ¡machine ¡and ¡the ¡input ¡ ì Stateful ¡applicaAons ¡requires ¡both ¡combinaAonal ¡

and ¡sequenAal ¡logic ¡

ì Examples: ¡Register, ¡Memory, ¡Counters, ¡… ¡

29 ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-30
SLIDE 30

Sequential ¡Circuits ¡– ¡Register ¡

ì This ¡illustraAon ¡shows ¡a ¡4-­‑

bit ¡register ¡consisAng ¡of ¡D ¡ flip-­‑flops. ¡You ¡will ¡usually ¡ see ¡its ¡block ¡diagram ¡ (below) ¡instead. ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

30 ¡

slide-31
SLIDE 31

Sequential ¡Circuits ¡– ¡Group ¡of ¡Registers ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

31 ¡

slide-32
SLIDE 32

Sequential ¡Circuits ¡– ¡Binary ¡Counter ¡

ì Binary ¡counter ¡operaAon ¡

ì

JK ¡flip-­‑flops ¡toggle ¡when ¡ J=K=1 ¡

ì

Low-­‑order ¡bit ¡is ¡ complemented ¡at ¡each ¡ clock ¡pulse ¡

ì

Whenever ¡low ¡order ¡bit ¡ changes ¡from ¡0 ¡to ¡1, ¡the ¡ next ¡bit ¡is ¡complemented, ¡ and ¡so ¡on ¡through ¡the ¡

  • ther ¡flip-­‑flops ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

32 ¡

slide-33
SLIDE 33

Designing ¡Circuits ¡

ì

Do ¡designers ¡usually ¡lay ¡out ¡circuits ¡by ¡hand? ¡

ì

No ¡– ¡designers ¡today ¡rely ¡on ¡specialized ¡soQware ¡to ¡create ¡ efficient ¡circuits ¡

ì

SoQware ¡is ¡an ¡enabler ¡for ¡the ¡construcAon ¡of ¡bemer ¡ hardware! ¡

ì

Many ¡challenges ¡in ¡modern ¡hardware ¡designs ¡

ì

Sheer ¡number ¡of ¡gates ¡to ¡implement! ¡

ì Create ¡“building ¡blocks” ¡(modules) ¡that ¡can ¡be ¡quickly ¡

assembled ¡ ì

Timing ¡constraints ¡– ¡Result ¡is ¡correct, ¡but ¡when ¡is ¡it ¡correct? ¡

ì PropagaAon ¡delays ¡occur ¡between ¡the ¡Ame ¡when ¡a ¡circuit’s ¡

inputs ¡are ¡energized ¡and ¡when ¡the ¡output ¡is ¡accurate ¡and ¡ stable ¡

33 ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-34
SLIDE 34

ì ¡ “Bonus” ¡Slides ¡ ¡ – ¡Algorithmic ¡State ¡Machines ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

34 ¡

slide-35
SLIDE 35

Algorithmic ¡State ¡Machine ¡ ¡

ì Moore ¡and ¡Mealy ¡machines ¡are ¡challenging ¡to ¡draw ¡

for ¡complex ¡designs ¡

ì An ¡interacAon ¡of ¡numerous ¡signals ¡is ¡required ¡to ¡

advance ¡a ¡machine ¡from ¡one ¡state ¡to ¡the ¡next ¡ ì Alternate ¡approach: ¡Algorithmic ¡State ¡Machine ¡

ì A ¡block ¡diagram ¡approach ¡to ¡describing ¡digital ¡

systems ¡

35 ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

slide-36
SLIDE 36

Algorithmic ¡State ¡Machine ¡ ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

36 ¡

slide-37
SLIDE 37

Algorithmic ¡State ¡Machine ¡– ¡Microwave ¡ Oven ¡ ¡

Spring ¡2012 ¡ Computer ¡Systems ¡and ¡Networks ¡

37 ¡