feedback and flip flops
play

Feedback and Flip-Flops Philipp Koehn 7 September 2019 Philipp - PowerPoint PPT Presentation

Feedback and Flip-Flops Philipp Koehn 7 September 2019 Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019 The Story So Far 1 We can encode numbers We can do calculation ... but its all a bit


  1. Feedback and Flip-Flops Philipp Koehn 7 September 2019 Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  2. The Story So Far 1 • We can encode numbers • We can do calculation • ... but it’s all a bit static • How about a counter? → this requires "memory" Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  3. 2 feedback Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  4. A Strange Contraption 3 - + Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  5. Let’s Turn It On 4 - + Electricity is on → this opens the normally closed key Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  6. Let’s Turn It On 5 - + Electricity is off → this closes the normally closed key Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  7. What Do We Have? 6 • A Buzzer • A Clock • An Oscillator NOT (symbol) Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  8. Oscillator 7 • Period of oscillator • Frequency: cycles per second • Unit: 1 cycle per second: 1 Hertz • Modern computes: Billions of Hertz = Gigahertz (GHz) Heinrich Hertz 1857--1894 Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  9. 8 flip flop Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  10. Another Contraption 9 NOR V OUT NOR V Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  11. Closing Upper Key 10 NOR V OUT NOR V Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  12. Opening Upper Key 11 NOR V OUT NOR V Same key configuration as initially But: Now OUT is on --- we remembered the key turn Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  13. Closing Lower Key 12 NOR V OUT NOR V Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  14. Opening Lower Key 13 NOR V OUT NOR V Back to initial state Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  15. Memory 14 • We have memory -- called Reset-Set Flip-Flop • Truth table UPPER LOWER OUT 0 0 OUT 0 1 0 1 0 1 1 1 Illegal • UPPER = SET • LOWER = RESET Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  16. Re-Arranged 15 S NOR Q NOR R Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  17. Symmetric 16 S Q NOR Q NOR R Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  18. Truth Table 17 ¯ S R Q Q 1 0 1 0 0 1 0 1 ¯ 0 0 Q Q 1 1 Illegal Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  19. 18 d-type flip flop Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  20. Vision 19 • Control bit ("clock") – on = write to memory – off = read from memory • Data bit – data item to be written • Output – current state of the memory Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  21. Replace Set/Reset with Data 20 DATA Q NOR NOT Q NOR Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  22. Add Control Bit ("Clock") 21 DATA AND Q NOR NOT CLOCK Q NOR AND Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  23. D-Type Flip-Flop 22 • Also called D-type latch • Circuit latches on one bit of memory and keeps it around • Truth table ¯ Data Clock Q Q 0 1 0 1 1 1 1 0 ¯ X 0 Q Q • Can also build these for multiple data bits Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  24. 23 accumulative adder Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  25. Design Goal 24 • Adder has initially value 0 • Adding a number → value increases • Resetting → value goes back to 0 Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  26. Ingredients 25 A7 A6 A5 A4 A3 A2 A1 A0 B7 B6 B5 B4 B3 B2 B1 B0 8-BIT ADDER CI CO S7 S6 S5 S4 S3 S2 S1 S0 D7 D6 D5 D4 D3 D2 D1 D0 8-BIT LATCH CLK Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  27. Ingredients 26 8 8 A B 8-BIT ADDER CI CO S 8 8 D 8-BIT LATCH CLK Q 8 Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  28. Building an Accumulative Adder 27 0 8 • Latch: current sum CLOCK D CLK 8-BIT LATCH Q • Clock on → set it to 0 8 Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  29. Building an Accumulative Adder 28 0 8 • Adder CLOCK D CLK 8-BIT LATCH IN Q • Combines 8 8 – current value A B 8-BIT ADDER – selected input CO S CI 8 OUT Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  30. Building an Accumulative Adder 29 0 8 • Can we pass output CLOCK D CLK 8-BIT LATCH IN directly to latch? Q 8 8 • Concerns A B 8-BIT ADDER – select between 0 and sum CO S CI – only stored when clock on 8 OUT Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  31. Building an Accumulative Adder 30 0 8 8 Clear A B 2-1 SELECTOR S 8 • 2-1 selector CLOCK D CLK 8-BIT LATCH IN Q • Either uses 0 or sum 8 8 A B • Built with AND gates 8-BIT ADDER CO S CI 8 • Still have runaway feedback loop... OUT Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  32. Building an Accumulative Adder 31 0 8 8 Clear A B 2-1 SELECTOR • Two Latches S 8 – one to store the sum CLOCK1 D CLK – one to store input to adder 8-BIT LATCH Q S 8 • Clock 1 CLOCK2 D CLK 8-BIT LATCH – carry out addition IN Q – store result 8 8 A B • Clock 2 8-BIT ADDER CO S CI – transfer to set up next addition 8 OUT Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  33. Building an Accumulative Adder 32 0 8 8 Clear A B 2-1 SELECTOR • Combine the clocks S Add 8 • Pressing the add key D CLK 8-BIT LATCH NOT – carry out addition Q S 8 – store result in upper latch D CLK 8-BIT LATCH IN Q • Release the add key 8 8 – transfer to lower latch A B – set up next addition 8-BIT ADDER CO S CI 8 OUT Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  34. What Else? 33 0 8 8 Clear A B 2-1 SELECTOR S • Remember the oscillator? Add 8 D CLK NOT 8-BIT LATCH NOT Q S 8 D CLK 8-BIT LATCH IN Q 8 8 A B 8-BIT ADDER CO S CI 8 OUT Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  35. What Else? 34 0 8 8 Clear A B 2-1 SELECTOR S 8 D NOT CLK 8-BIT LATCH NOT Q S 8 D CLK 8-BIT LATCH IN Q • Each cycle of oscillator: 8 8 A B keeps adding 8-BIT ADDER CO S CI 8 OUT Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  36. What Else? 35 0 8 8 Clear A B 2-1 SELECTOR S 8 D NOT CLK 8-BIT LATCH NOT Q S 8 D CLK 8-BIT LATCH IN Q • We have something interesting here 8 8 A B 8-BIT ADDER CO S CI 8 OUT Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  37. 36 edge triggered flip-flop Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  38. D-Type Latch 37 D Q LATCH CLK Q • When clock is on, save data • "Level-triggered" Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  39. D-Type Latch 38 D Q D Q LATCH LATCH NOT CLK Q CLK Q • "Edge-triggered": changes value, when switched from 0 to 1 Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  40. Edge Triggered D-Type Latch 39 D Q > CLK Q Symbol Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  41. Truth Table 40 ¯ Data Clock Q Q 0 ↑ 0 1 1 ↑ 1 0 ¯ X 0 Q Q Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  42. 41 ripple counter Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  43. Oscillator and Latch 42 D Q NOT > CLK Q ¯ Data Clock Q Q 1 0 0 1 1 ↑ 1 0 0 1 1 0 0 0 1 0 ↑ 0 0 1 1 1 0 1 1 0 0 1 Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

  44. Oscillator and Latch 43 D Q NOT > CLK Q ¯ Data Clock Q Q 1 0 0 1 1 ↑ 1 0 0 1 1 0 0 0 1 0 ↑ 0 0 1 1 1 0 1 1 0 0 1 Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019

Recommend


More recommend