Presentation on theme: "ELEC516/10 Lecture 5 1 ELEC 516 VLSI System Design and Design Automation Spring 2010 Lecture 5: Flip-Flop/Latch Design Reading Assignment: Rabaey: Chapter."— Presentation transcript:
ELEC516/10 Lecture 5 1 ELEC 516 VLSI System Design and Design Automation Spring 2010 Lecture 5: Flip-Flop/Latch Design Reading Assignment: Rabaey: Chapter 7 Note: some of the figures in this slide set are adapted from the slide set of “ Digital Integrated Circuits” by Rabaey et. al., Copyright 2002
ELEC516/10 Lecture 5 2 Motivations: Why do we need sequential circuits? Need memory Pipeline the system so that new operations start before the old ones complete. Add registers to keep operations separate. Convert parallel operations to a sequence of serial operations (faster operations per cycle/ smaller). Need to process a sequence of inputs and want to reuse the same hardware (Finite State Machine)
ELEC516/10 Lecture 5 3 Sequential Logic F F s LOGIC t p,comb InOut 2 storage mechanisms positive feedback charge-based n Memory Element: n Stores a value as controlled by clock. n May have load signal, etc
ELEC516/10 Lecture 5 4 Memory Elements - Latches and flip-flops A generic memory element has an internal memory and some circuitry to control access to the internal memory. which is controlled by the clock input. Memory element differ in many key respect: –exactly what form of clock signal causes the input data value to be read; –how the behavior of data around the read signal from clock affects the stored value; –when the stored value is presented to the output; –whether there is a combinational path from the input to the output. 2 types of memory: latches and edge-triggered flip flop –latches - transparent while the internal memory is being set from the data input –edge-triggered flip-flops (or register) - not transparent, reading the input value and changing the flip-flop’s output are two separate events.
ELEC516/10 Lecture 5 5 Simple Circuit with Feedback One inverter with feedback –Self-oscillation, 2 gate delays for one period –Odd-number of inverters with feedback self-oscillation of 2x gate delays of one path Two inverters with feedback –Memory element (or states) –Basis for commercial static RAM designs –Read-only, but has no write function Memory with read/write capability –Selectively break the feedback path by transmission gates to load new value into the cell –A can be written to Z when LD = 1 Write SW On & Feedback SW Off –Z holds the value when LD = 0 Write SW Off & Feedback SW On "0" "1" “0?""1" Z LD LD’ LD LD’ A
ELEC516/10 Lecture 5 6 Latch versus Register Latch stores data when clock is low D Clk Q D Q Register stores data when clock rises Clk D D QQ
ELEC516/10 Lecture 5 7 Let’s build a latch Latches are multiplexers controlled by a clock: When CLK is high data will pass through otherwise the data is saved or kept unchanged feedback from output to input Can be realized using transmission gates
ELEC516/10 Lecture 5 8 Dynamic latch Stores charge on inverter gate capacitance: n Uses complementary transmission gate to ensure that storage node is always strongly driven. n Latch is transparent when transmission gate is closed. n Storage capacitance comes primarily from inverter gate capacitance. n Setup and hold times determined by transmission gate—must ensure that value stored on transmission gate is solid.
ELEC516/10 Lecture 5 9 Dynamic latch- Stored charge leakage Stored charge leaks away due to reverse-bias leakage current. Stored value is good for about 1 ms. Value must be rewritten to be valid. If not loaded every cycle, must ensure that latch is loaded often enough to keep data valid.
ELEC516/10 Lecture 5 10 Non-dynamic latches Must use feedback to restore value. Some latches are static on one phase (pseudo-static)—load on one phase, activate feedback on other phase. Example - Recirculating latch: Static on one phase:
ELEC516/10 Lecture 5 11 Latch-Based Design N latch is transparent when = 0 P latch is transparent when = 1 N Latch Logic P Latch
ELEC516/10 Lecture 5 12 Positive Feedback: Bi-Stability The circuit presents only three operation points When the gain of the inverter in the transient region is larger than 1, A and B are the only stable operation points & C is a metastable operation point.
ELEC516/10 Lecture 5 13 Meta-Stability Gain should be larger than 1 in the transition region C is an instable operating point. Every deviation (even small) causes the operation to run away (because of high gain). A and B are very stable operation points, the loop gain is much smaller than unity, eve a large deviation will not cause deviation from these operation points.
ELEC516/10 Lecture 5 14 Flip states in Bistable Circuit Two different approaches: –Cutting the feedback loop Open the loop and write data Multiplexer based Q = Clk’.Q + Clk.In –Overpowering the feedback loop Applying a trigger signal at the input of the flip- flop to overpower the stored value to a new value Careful sizing of the transistors in the feedback loop and the input is necessary
ELEC516/10 Lecture 5 15 Writing into a Static Latch D CLK D Converting into a MUX Forcing the state (can implement as NMOS-only) Use the clock as a decoupling signal, that distinguishes between the transparent and opaque states
ELEC516/10 Lecture 5 16 Other styles Very good style (Skew considerations) Fast and energy efficient Small and lower clock load but sizing problems Presents the lowest clock load
ELEC516/10 Lecture 5 17 Mux-Based Latch Positive level latch. When the D path is ON, the feedback is cut-off No sizing issues for correct operation. The number of transistors that the clock drives is an issue (clock has an activity factor of 1: CLK Load of four transistors.
ELEC516/10 Lecture 5 19 DFF Implementation (falling edge triggered) DQ GQ’ DQ G D C Q DQ C Ds Cs Master D latch Slave D latch Master/Slave latch arrangement
ELEC516/10 Lecture 5 20 DFF Internal Operation D C Q Ds Cs Master sampling Xfer to Slave Master sampling Xfer to Slave
ELEC516/10 Lecture 5 21 Flip-Flop: Timing Definitions n Setup time: time before clock during which data input must be stable. n Hold time: time after clock event for which data input must remain stable. n Clock-to-Q delay = T PFF
ELEC516/10 Lecture 5 22 Clk-Q Delay
ELEC516/10 Lecture 5 23 The setup time race Setup represents the race for new data to propagate around the feedback loop before clock closed the input gate. If data arrives too close to clock edge, it will not set up the feedback loop before clock closed the input TG
ELEC516/10 Lecture 5 24 The hold time race Hold time represents the race for clock to close the input gate before next cycle’s data disturbs the stored value If data changes too soon after the clock edge, clock might not had time to switch off the input gate and new data will corrupt feedback loop
ELEC516/10 Lecture 5 25 Setup Time
ELEC516/10 Lecture 5 26 Maximum Clock Frequency Also: t cdreg + t cdlogic > t hold t cd : contamination delay = minimum delay t clk-Q + t p,comb + t setup = T Modern high performance systems are characterized by low logic depth The register’s delay becomes very important as the registers because it accounts for both the setup and propagation delay. DEC Alpha up has a max logic depth of 12 gates, &15% of the delay corresponds to the register overhead.
ELEC516/10 Lecture 5 27 Reduced Clock Load Master-Slave Register Possible problem: reverse conduction Eliminate the feedback transmission gate.
ELEC516/10 Lecture 5 28 Clock Overlap Problem CLK A B (a) Schematic diagram (b) Overlapping clock pairs X D Q CLK Potential problems: 1.Race condition: data at the output change at the rising edge of the clock 2.Node A can be driven by both D and B when clock overlap Variations in the routing wires Used to route CLK & CLK’ Variations on the load Inverter’s delay
ELEC516/10 Lecture 5 31 Dynamic Latches and registers Disadvantage of static FF - complexity, larger size The requirement that the memory should hold state for extended periods of time can be relaxed in computational structure Dynamic - use the charge stored in capacitance to eliminate the use of inverter pair to latch data: Pseudo-static latch (Charge-Based Storage) A D Clk Clk’ Clk B Q Clk=1: The input data is sampled on storage node A, during this time the slave is on hold mode, node B at high impedance. On the falling edge of the clock, T2 turns ON and the value sampled on A propagates to the output. Setup time is the delay of the transmission gate Hold time is zero since the TG is turned off on the clock edge. Tc2q= delay of two inverters and a transmission gate.
ELEC516/10 Lecture 5 32 Making a Dynamic Latch Pseudo-Static Fully dynamic circuit presents a number of drawbacks: –Capacitive coupling can inject significant noise to the internal storage node. –Leakage current: Most modern processors require that the clock can be slowed down or completely halted to conserve power in low activity periods Most of these problems can be addressed by adding a weak feedback inverter Pseudo-Static Latch –Slight cost in delay and silicon area. –Improves noise immunity significantly –Dynamic latches should be made Pseudo-Static, keep for very special cases of highly controlled environment (full-custom, high performance data path design)
ELEC516/10 Lecture 5 33 Impact of non-overlapping clocks clk Overlapping Clocks Can Cause Race Conditions Undefined Signals A D Clk Clk’ Clk B Q (0,0) Overlap (1,1) Overlap During the (0,0) overlap, PMOS of T1 and PMOS of T2 are ON, creating a direct path from D to Q. The same problem appears during the (1,1) overlap. T1T2
ELEC516/10 Lecture 5 34 Flip-flop insensitive to clock overlap DIn V DD V M1 M3 M4 M2M6 M8 M7 M5 section C L1 C L2 X C 2 MOS LATCH
ELEC516/10 Lecture 5 35 C 2 MOS avoids Race Conditions During the (0,0) overlap, new data sampled on the falling edge of the clock will not appear at D output. Same remark applied during the (1,1) overlap.
ELEC516/10 Lecture 5 36 Operation of the C 2 MOS latch When = 1, M3 and M4 are on, the 1st section is in the evaluation mode and the second section is in a hold mode (high impedance). M7 and M8 are off, decoupling the output from the input. The input D retains its previous value stored on the output capacitance. When = 0, the first section is in hold mode and the second section is in evaluation mode, the value stored in CL1 propagates to the output node. A C 2 MOS register with ( - ) clocking is insensitive to overlap, as long as rise and fall times of the clock edges are sufficiently small.
ELEC516/10 Lecture 5 37 Dual Edge registers Dual Edge registers are very interesting as they permit to run the Clock 2 times slower lower power on the clock node.
ELEC516/10 Lecture 5 38 Pipelined Logic using C 2 MOS C 2 C 1 G C 3 NORA CMOS What are the constraints on F and G? No-race rule: A C 2 MOS-based pipelined circuit is race-free as long as the logic function F (static logic) between the latches are non-inverting
ELEC516/10 Lecture 5 39 Example 1 V DD Number of a static inversions should be even
ELEC516/10 Lecture 5 40 Doubled C 2 MOS Latches-True single- phase clock register Doubled n-C 2 MOS latch (transparent when CLK= 1) In V DD Out V DD Doubled p-C2 MOS latch (transparent when CLK= 0) In + Requires a single clock to build a positive & negative clock - Can suffer from charge sharing & noise pbs when clk low.
ELEC516/10 Lecture 5 41 TSPC - True Single Phase Clock Logic Including logic into the latch Inserting logic between latches
ELEC516/10 Lecture 5 42 Example of Including Logic in TSPC CLK V DD Q CLK V DD In AND latch Embedding logic into the latch reduces the delay overhead of the latch. This approach of embedding logic into the latch was extensively used in many high performance microprocessors including EV4 DEC Alpha.
ELEC516/10 Lecture 5 43 Master-Slave Flip-flops D (a) Positive edge-triggered D flip-flop (b) Negative edge-triggered D flip flop (c) Positive edge-triggered D flip-flop using split-output latches X Y
ELEC516/10 Lecture 5 44 Pulse-Triggered Latches An Alternative Approach Master-Slave Latches D Clk QD Q Data D Clk Q Data Pulse-Triggered Latch L1L2L Ways to design an edge-triggered sequential cell: IDEA: construct a short pulse around the rising (or falling) edge of the clock. This would be the NEW clock input. Hold time is equal to the length of the pulse. + Reduced clock load, small number of transistors required. + Glitch circuitry can be shared by multiple register. - increase in verification complexity: Need to make sure the glitch Is properly generated!!!!!
ELEC516/10 Lecture 5 45 Pulsed Latches Glitch corresponds to the delay of the AND + 2 Inv
ELEC516/10 Lecture 5 46 Pulsed Latches Hybrid Latch – Flip-flop (HLFF), AMD K-6 and K-7 : When the clock is low: M3 and M6 are off and P1 is ON. Node X is precharged to VDD, and the output is decoupled from X (Memory). CLKD’ is a delayed-inverted version of CLK. On the rising edge of the clock, M3 and M6 turn ON while M1 and M4 stay ON for a short period, and hence the latch is transparent and D is sampled. Once CLKD’ goes low node X is decoupled from D.
ELEC516/10 Lecture 5 47 Hybrid Latch-FF Timing Advantage: Setup time can be negative: Transparency window Is longer than the delay from input to the output. D injected after the clock.
ELEC516/10 Lecture 5 48 Pipelining REG LOG REG a b Out LOG REG Out REG a b
ELEC516/10 Lecture 5 51 Non-Bistable Sequential Circuits─ Schmitt Trigger VTC with hysteresis Restores signal slopes
ELEC516/10 Lecture 5 52 Noise Suppression using Schmitt Trigger
ELEC516/10 Lecture 5 53 CMOS Schmitt Trigger Moves switching threshold of the first inverter
ELEC516/10 Lecture 5 54 Schmitt Trigger Simulated VTC 2.5 V X (V) V M2 V M1 V in (V) Voltage-transfer characteristics with hysteresis.The effect of varying the ratio of the PMOS deviceM 4. The width isk* 0.5 m. m V x (V) k = 2 k = 3 k = 4 k = 1 V in (V)