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 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
2 feedback Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019
A Strange Contraption 3 - + Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019
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
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
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
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
8 flip flop Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019
Another Contraption 9 NOR V OUT NOR V Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019
Closing Upper Key 10 NOR V OUT NOR V Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019
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
Closing Lower Key 12 NOR V OUT NOR V Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019
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
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
Re-Arranged 15 S NOR Q NOR R Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019
Symmetric 16 S Q NOR Q NOR R Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019
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
18 d-type flip flop Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019
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
Replace Set/Reset with Data 20 DATA Q NOR NOT Q NOR Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019
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
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
23 accumulative adder Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019
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
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
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
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
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
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
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
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
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
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
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
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
36 edge triggered flip-flop Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019
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
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
Edge Triggered D-Type Latch 39 D Q > CLK Q Symbol Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019
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
41 ripple counter Philipp Koehn Computer Systems Fundamental: Feedback and Flip-Flops 7 September 2019
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
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