chapter 3
play

Chapter 3 Professor Brendan Morris, SEB 3216, - PowerPoint PPT Presentation

Chapter 3 Professor Brendan Morris, SEB 3216, brendan.morris@unlv.edu http://www.ee.unlv.edu/~b1morris/cpe100/ CPE100: Digital Logic Design I Section 1004: Dr. Morris Sequential Logic Design Chapter 3 <1> Chapter 3 :: Topics


  1. Chapter 3 Professor Brendan Morris, SEB 3216, brendan.morris@unlv.edu http://www.ee.unlv.edu/~b1morris/cpe100/ CPE100: Digital Logic Design I Section 1004: Dr. Morris Sequential Logic Design Chapter 3 <1>

  2. Chapter 3 :: Topics • Introduction • Latches and Flip-Flops • Synchronous Logic Design • Finite State Machines • Timing of Sequential Logic • Parallelism Chapter 3 <2>

  3. Introduction • Previously, Combinational Logic design had outputs only depend on current value of inputs • Outputs of sequential logic depend on current and prior input values – it has memory . • Some definitions: • State: all the information about a circuit necessary to explain its future behavior • Latches and flip-flops: state elements that store one bit of state • Synchronous sequential circuits: combinational logic followed by a bank of flip-flops Chapter 3 <3>

  4. Sequential Circuits • Give sequence to events (i.e. a notion of time) • Have memory (short-term) • Use feedback from output to input to store information • Need to “remember” past output Chapter 3 <4>

  5. State Elements • The state of a circuit influences its future behavior • State elements store state • Bistable circuit • SR Latch • D Latch • D Flip-flop Chapter 3 <5>

  6. Bistable Circuit • Fundamental building block of other state elements • Two outputs: Q , Q (state) • No inputs 0 1 0 I1 Q Q Q I2 I1 1 0 1 I2 Q Redrawn circuit to emphasize symmetry Chapter 3 <6>

  7. Bistable Circuit Analysis • Consider the two possible cases: • Q = 0: 0 I1 Q 1 then Q = 1, Q = 0 (consistent) 0 1 I2 Q Chapter 3 <7>

  8. Bistable Circuit Analysis • Consider the two possible cases: • Q = 0: 0 I1 Q 1 then Q = 1, Q = 0 (consistent) 0 1 I2 Q • Q = 1: 1 I1 Q then Q = 0, Q = 1 (consistent) 0 1 0 I2 Q • Stores 1 bit of state in the state variable, Q (or Q) • But there are no inputs to control the state Chapter 3 <8>

  9. SR (Set/Reset) Latch • SR Latch R N1 Q • S – set Q=1 • R – reset Q=0 N2 Q S Chapter 3 <9>

  10. SR (Set/Reset) Latch • SR Latch R N1 Q N2 Q S • Consider the four possible cases: • S = 1, R = 0 • S = 0, R = 1 • S = 0, R = 0 • S = 1, R = 1 Chapter 3 <10>

  11. SR Latch Analysis • S = 1, R = 0: 0 R 1 N1 Q then Q = 1 and Q = 0 0 0 0 1 N2 Q S Chapter 3 <11>

  12. SR Latch Analysis • S = 1, R = 0: 0 R 1 N1 Q then Q = 1 and Q = 0 0 0 0 1 N2 Q S Chapter 3 <12>

  13. SR Latch Analysis • S = 1, R = 0: 0 R 1 N1 Q then Q = 1 and Q = 0 0 0 0 1 N2 Q S • S = 0, R = 1: 1 R 0 N1 Q then Q = 0 and Q = 1 1 0 1 0 N2 Q S Chapter 3 <13>

  14. SR Latch Analysis • S = 1, R = 0: 0 R 1 N1 Q then Q = 1 and Q = 0 0 Set the output 0 0 1 N2 Q S • S = 0, R = 1: 1 R 0 N1 Q then Q = 0 and Q = 1 1 Reset the output 0 1 0 N2 Q S Chapter 3 <14>

  15. SR Latch Analysis • S = 0, R = 0: Q prev = 0 Q prev = 1 then Q = Q prev 0 0 R 0 R 1 N1 Q N1 Q 0 N2 Q 0 N2 Q S S Chapter 3 <15>

  16. SR Latch Analysis • S = 0, R = 0: Q prev = 0 Q prev = 1 then Q = Q prev 0 0 R 0 R 1 N1 Q N1 Q 0 N2 Q 0 N2 Q S S Chapter 3 <16>

  17. SR Latch Analysis • S = 0, R = 0: Q prev = 0 Q prev = 1 then Q = Q prev 0 0 R 0 R 1 N1 Q N1 Q 0 N2 Q 0 N2 Q S S • S = 1, R = 1: 1 R 0 N1 Q 0 then Q = 0, Q = 0 0 0 1 N2 Q S Chapter 3 <17>

  18. SR Latch Analysis • S = 0, R = 0: Q prev = 0 Q prev = 1 then Q = Q prev 0 0 R 0 R 1 N1 Q N1 Q 0 N2 Q 0 N2 Q S S • S = 1, R = 1: 1 R 0 N1 Q 0 then Q = 0, Q = 0 0 0 1 N2 Q S Chapter 3 <18>

  19. SR Latch Analysis • S = 0, R = 0: Q prev = 0 Q prev = 1 then Q = Q prev 0 0 R 0 R N1 Q N1 Q Memory! 0 N2 Q 0 N2 Q S S • S = 1, R = 1: 1 R 0 N1 Q 0 then Q = 0, Q = 0 0 Invalid State 0 1 N2 Q S Q ≠ NOT Q Chapter 3 <19>

  20. SR Latch Symbol • SR stands for Set/Reset Latch – Stores one bit of state ( Q ) • Control what value is being stored with S , R inputs SR Latch • Set: Make the output 1 Symbol ( S = 1, R = 0, Q = 1 ) R Q • Reset: Make the output 0 S Q ( S = 0, R = 1, Q = 0 ) Chapter 3 <20> •

  21. D Latch • Two inputs: CLK , D • CLK : controls when the output changes • D (the data input): controls what the output changes to • Function D Latch • When CLK = 1 , Symbol D passes through to Q ( transparent ) CLK • When CLK = 0 , D Q Q holds its previous value ( opaque ) Q • Avoids invalid case when Q ≠ NOT Q Chapter 3 <21>

  22. D Latch Internal Circuit CLK CLK R R Q Q D D Q S S Q Q D Q CLK D D S R Q Q 0 X 1 0 1 1 Chapter 3 <22>

  23. D Latch Internal Circuit CLK CLK R R Q Q D D Q S S Q Q D Q CLK D D S R Q Q 0 X X 0 0 Q prev Q prev 1 0 1 0 1 0 1 1 1 0 1 0 1 0 Chapter 3 <23>

  24. D Flip-Flop • Inputs: CLK , D D Flip-Flop Symbols • Function – Samples D on rising edge of CLK D Q • When CLK rises from 0 to 1, D passes through to Q Q • Otherwise, Q holds its previous value – Q changes only on rising edge of CLK • Called edge-triggered • Activated on the clock edge Chapter 3 <24>

  25. D Flip-Flop Internal Circuit • Two back-to-back latches (L1 and L2) controlled by complementary clocks CLK • When CLK = 0 • L1 is transparent • CLK CLK L2 is opaque N1 – D passes through to N1 D D Q D Q Q L1 Q L2 Q Q Chapter 3 <25>

  26. D Flip-Flop Internal Circuit • Two back-to-back latches (L1 and L2) controlled by complementary clocks CLK • When CLK = 0 – L1 is transparent – L2 is opaque CLK CLK N1 – D passes through to N1 D D Q D Q Q • When CLK = 1 L1 Q L2 Q Q – L2 is transparent – L1 is opaque – N1 passes through to Q Chapter 3 <26>

  27. D Flip-Flop Internal Circuit • Two back-to-back latches (L1 and L2) controlled by complementary clocks CLK • When CLK = 0 – L1 is transparent – L2 is opaque CLK CLK N1 – D passes through to N1 D D Q D Q Q • When CLK = 1 L1 Q L2 Q Q – L2 is transparent – L1 is opaque – N1 passes through to Q • Thus, on the edge of the clock (when CLK rises from 0 1 ) – D passes through to Q Chapter 3 <27>

  28. D Latch vs. D Flip-Flop CLK D Q D Q Q Q CLK D Q (latch) Q (flop) Chapter 3 <28>

  29. D Latch vs. D Flip-Flop CLK D Q D Q Q Q CLK D Q (latch) Q (flop) Chapter 3 <29>

  30. Review SR Latch SR Latch D Latch D Flip-flop Symbol CLK R Q D Q D Q S Q Q Q CLK = 0→1 : Q = D S = 1 , R = 0: Q = 1 CLK = 1 : Q = D S = 0, R= 1 : Q = 0 CLK = 0 : Q = Q prev Otherwise : Q = Q prev Chapter 3 <30>

  31. Registers CLK D 0 D Q Q 0 CLK D 1 D Q Q 1 4 4 D 3:0 Q 3:0 D 2 D Q Q 2 D 3 D Q Q 3 Chapter 3 <31>

  32. Enabled Flip-Flops • Inputs: CLK , D , EN – The enable input ( EN ) controls when new data ( D ) is stored • Function • EN = 1: D passes through to Q on the clock edge • EN = 0: the flip-flop retains its previous state Internal Circuit Symbol EN CLK 0 D Q Q D Q D 1 EN Chapter 3 <32>

  33. Enabled Flip-Flops • Inputs: CLK , D , EN – The enable input ( EN ) controls when new data ( D ) is stored • Function • EN = 1: D passes through to Q on the clock edge • EN = 0: the flip-flop retains its previous state Internal Circuit Symbol EN CLK 0 D Q Q D Q D 1 EN Chapter 3 <33>

  34. Resettable Flip-Flops • Inputs: CLK , D , Reset • Function: • Reset = 1: Q is forced to 0 • Reset = 0: flip-flop behaves as ordinary D flip-flop Symbols D Q r Reset Chapter 3 <34>

  35. Resettable Flip-Flops • Two types: – Synchronous: resets at the clock edge only – Asynchronous: resets immediately when Reset = 1 • Asynchronously resettable flip-flop requires changing the internal circuitry of the flip-flop • Synchronously resettable flip-flop? Chapter 3 <35>

  36. Resettable Flip-Flops • Two types: – Synchronous: resets at the clock edge only – Asynchronous: resets immediately when Reset = 1 • Asynchronously resettable flip-flop requires changing the internal circuitry of the flip-flop • Synchronously resettable flip-flop? Internal Circuit CLK D D Q Q Reset Chapter 3 <36>

  37. Settable Flip-Flops • Inputs: CLK , D , Set • Function: • Set = 1: Q is set to 1 • Set = 0: the flip-flop behaves as ordinary D flip- flop Symbols D Q s Set Chapter 3 <37>

  38. Synchronous Sequential Logic Design • Registers inserted between combinational logic • Registers contain state of the system • State changes at clock edge: system synchronized to the clock Chapter 3 <38>

  39. Synchronous Sequential Logic Design • Rules of synchronous sequential circuit composition: • Every circuit element is either a register or a combinational circuit • At least one circuit element is a register • All registers receive the same clock signal • Every cyclic path contains at least one register Chapter 3 <39>

Recommend


More recommend