Chapter 7 Sequential Circuits Jin-Fu Li Advanced Reliable Systems (ARES) Lab. epartment of Electrical Engineering National Central University it Jungli, Taiwan
Outline Latches & Registers Sequencing Timing iagram Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 2
Combinational logic Sequencing Output depends on current inputs Sequential logic Output depends on current and previous inputs Requires separating previous, current, future Called state or tokens Ex: FSM, pipeline in CL out CL CL Finite State Machine Pipeline Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 3
Sequencing Elements Latch: Level sensitive A.k.a. transparent latch, latch Flip-flop: edge triggered Aka A.k.a. master-slave slave flip-flop flop, flip-flop flop, register Timing iagrams Transparent Opaque Edge-trigger Latc ch p Flo (latch) (fl (flop) Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 4
Latches Negative-level sensitive latch 0 1 Positive-level sensitive latch 0 1 Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 5
Registers Positive-edge triggered register (singlephase clock) 0 M 0 1 S 1 S M master slave Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 6
Registers Operations of the positive-edge triggered register =0 =1 Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 7
Registers CMOS circuit implementation of the positiveedge triggered register Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 8
Single-Phase Latch Positive active-static latch - 1. Low area cost 2. riving i capability of must override the feedback inverter - - Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 9
Typical Latch Symbolic Layouts V dd - - - V ss Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 10
CVSL (ifferential) Style Register The following figure shows latches based on a CVSL structure u An N and a P version are shown that are cascaded to form a register - Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 11
ouble-edge Triggered Register The following figure shows latches that t may be used to clock data on both edges of the clock Latch 1 Latch 2-2 -2 1-1 - 1 2 Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 12
ouble-edge Triggered Register ouble-edge triggered register can be implemented by combining Latch 1 & Latch 2 as follows Latch 2 2-2 - -1 1 Latch 1 Latch 1 enabled Latch 2 enabled 2=-2=low 1=-1=high Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 13
Asynchronously Register Asynchronously resettable register - -reset - - - -reset Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 14
Asynchronously Register Asynchronously resettable and settable register - -reset - - - -set Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 15
ynamic Latches & Registers ynamic single clock latches - - - - ynamic single clock registers - - - - - Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 16
Clock active high latch ynamic Latches n CLK X n n CLK X 0 1 1 H H L 1 0 0 1 X n-1 n-1 0 L 1 n-1 Clock active high latch with buffer X CLK - Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 17
Clock active low latch ynamic Latches CLK X CLK X n 0 1 1 0 L L H H X n 1 0 n 0 1 0 n-1 X n-1 n-1 Clock active low latch with buffer CLK X - Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 18
ynamic Latches Clock active high and low latches without feedback X CLK CLK X The problem of leakage current Assume that the capacitance of node X is 0.002pF and the leakage current I is 1nA Therefore, T=CV/I=0.002pFx5V/1nA=100us That is, the latch needs to be refreshed each 100us. Otherwise, the output will become highh Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 19
Sequencing Methods Flip-flops 2-Phase Latches Pulsed Latches Flip-Fl ops Flop T c Combinational Logic Flop 2-Phase Tran nsparent Latche es Pulsed φ 1 φ 2 φ p La atch T c /2 t nonoverlap La atch t nonoverlap φ 1 φ 2 φ 1 t pw Combinational Logic Combinational Logic Half-Cycle 1 Half-Cycle 1 La atch Latches φ p Latch Combinational Logic φ p Latch Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 20
Timing iagrams Contamination and Propagation elays t pd Logic Prop. elay A Combinational Logic Y A Y t cd t pd t cd t pcq Logic Cont. elay Latch/Flop Clk- Prop elay t setup t hold t ccq Latch/Flop Clk- Cont. elay Flop t pdq t pcq Latch - Prop elay Latch - Cont. elay t ccq t pcq t setup t hold Latch/Flop Setup Time Latch/Flop Hold Time t t setup hold t t ccq pcq Latch t cdq t pdq Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 21
Max-elay: Flip-Flops ( ) setup tpd Tc t + tpcq sequencing overhead F1 1 Combinational Logic 2 F2 T c t pcq t setup 1 t pd 2 Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 22
Max elay: 2-Phase Latches ( 2 ) tpd = tpd1+ tpd 2 Tc tpdq sequencing overhead φ 1 φ 2 φ 1 1 1 Combinational 2 2 Combinational 3 Logic 1 Logic 2 L1 L2 L3 3 φ 1 φ 2 T Tc 1 t pdq1 1 t pd1 2 t pdq2 2 t pd2 3 Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 23
Max elay: Pulsed Latches ( ) setup tpd Tc max tpdq, tpcq + t tpw sequencing overhead φ p φ p 1 L1 1 Combinational Logic 2 L2 2 T c 1 t pdq (a) t pw > t setup 1 t pd 2 φ p (b) t pw < t setup 1 2 t pcq T c t pw tpd tsetup Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 24
cd Min-elay: Flip-Flops t t t hold ccq F1 1 CL 2 F2 1 t ccq t cd 2 t hold Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 25
Min-elay: 2-Phase Latches t t t t t cd1, cd 2 hold ccq nonoverlap Hold time reduced by nonoverlap φ 1 L1 1 CL Paradox: hold applies twice each cycle, vs. only once for flops. 2 φ 2 L2 But a flop is made of two latches! φ 1 φ 2 t nonoverlap t ccq 1 t cd 2 t hold Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 26
Min-elay: Pulsed Latches t t t + t cd hold ccq pw Hold time increased by pulse width φ p L1 1 CL φ p 2 L2 φ p t pw 1 t ccq t hold t cd 2 Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 27
Time Borrowing In a flop-based system: ata launches on one rising edge Must setup before next rising edge If it arrives late, system fails If it arrives early, time is wasted Flops have hard edges In a latch-based system ata can pass through latch while transparent Long cycle of logic can borrow time into next As long as each loop completes in one cycle Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 28
Time Borrowing Example φ 1 φ 2 φ1 φ1 φ 2 (a) Latch Combinational Logic Latch Combinational Logic Latch Borrowing time across half-cycle boundary Borrowing time across pipeline stage boundary φ 1 φ 2 (b) La atch Combinational Logic La atch Combinational Logic Loops may borrow time internally but must complete within the cycle Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 29
How Much Borrowing? φ 1 φ 2 2-Phase Latches T borrow c setup + nonoverlap ( ) t t t 2 1 φ 1 L1 1 Combinational Logic 1 2 L2 2 Pulsed Latches t t t borrow pw setup φ 2 T c t nonoverlap T c /2 Nominal Half-Cycle 1 elay t borrow t setup 2 Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 30
Clock Skew We have assumed zero clock skew Clocks really have uncertainty in arrival time ecreases maximum propagation delay Increases minimum contamination delay ecreases time borrowing Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 31
Skew: Flip-Flops ( setup skew ) tpd Tc tpcq + t + t sequencing e overhead F1 1 Combinational Logic T c 2 F2 t t t + t cd hold ccq skew t pcq t skew 1 t pdq t setup 2 F1 1 CL 2 F2 t skew t hold 1 t ccq 2 t cd Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 32
Skew: Latches 2-Phase Latches ( 2 ) tpd Tc tpdq sequencing overhead φ 1 φ 2 φ 1 1 1 Combinational 2 2 Combinational 3 Logic 1 Logic 2 L1 L2 L3 3 t, t t t t + t cd 1 cd 2 hold ccq nonoverlap skew T t t + t + t 2 ( ) c borrow setup nonoverlap skew Pulsed Latches φ 1 φ 2 ( setup skew ) tpd Tc max tpdq, tpcq + t tpw + t t t + t t + t cd hold pw ccq sequencing overhead skew ( ) t t t + t borrow pw setup skew Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 33
Two-Phase Clocking If setup times are violated, reduce clock speed If hold times are violated, chip fails at any speed In this class, working chips are most important No tools to analyze clock skew An easy way to guarantee hold times is to use 2-phase latches with big nonoverlap times Call these clocks φ 1, φ 2 (ph1, ph2) Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 34
Safe Flip-Flop In class, use flip-flop with nonoverlapping clocks Very slow nonoverlap adds to setup time But no hold times In industry, use a better timing analyzer Add buffers to slow signals if hold time is at risk φ 2 φ 1 X φ 2 φ 1 φ 2 φ 1 φ 2 φ 1 Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 35
Clock istribution In a large CMOS chip, clock distribution is a serious problem For example, V dd=5v C reg =2000pF (20K register bits @ 0.1pF) T =10ns T rise/fall =1ns I peak =C(dv/dt)=(2000p)x(5/1n)=10A P d =C(V dd ) 2 f=2000px25x100=5w Methods for reducing the values of I peak nd P and P d Reduce C Interleaving the rise/fall time Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 36
Clock istribution Clocking is a floorplanning problem because clock delay varies with position on the chip Ways to improve clock distribution Physical design Make clock delays more even At least more predictable Circuit design Minimizing delays using several stages of drivers Two most common types of physical clocking networks H-tree clock distribution Balanced-tree clock distribution Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 37
H-Tree Clock istribution clock Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 38
H-Tree Clock istribution Source: Prof. Irwin Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 39
Balanced-Tree Clock istribution clock Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 40
Reduce Clocking Power Techniques used to reduce the high dynamic power dissipation Use a low capacitance clock routing line such as metal3. This layer of metal can be, for example, dedicated to clock distribution only Using low-swing drivers at the top level of the tree or in intermediate levels Vdd p C1 - p C2 CA V out Gnd n C3 - n C4 CB Clock Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 41
Power & Ground istribution Source: Prof. Irwin Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 42