Sequential Circuits
Combinational Circuits
Outputs depend on the current inputs
Sequential Circuits
Outputs depend on current and previous inputs Requires separating previous, current and future Called states or tokens
Example: Finite State Machines (FSMs), Pipelines
CL clk in out clk clk clk CL CL Pipeline Finite State Machine
Sequential Circuits
If tokens moved through pipeline at constant speed, no sequencing elements will be needed Ex: Fibre-optic cable, called wave pipelining in circuits
However, dispersion is high in most circuits
We need to delay fast tokens, so that they don't catch up with slow tokens
Use flip-flops to delay fast tokens so that they move through exactly one stage per cycle Inevitably adds some delay to slow tokens
Makes circuit slower than just the logic delay Called sequencing overhead
Sometimes called clocking overhead
But it applies to asynchronous circuits too Inevitable side effect of maintaining sequence
Sequential Elements Latch Level sensitive Transparent latch D latch Flip-Flop Edge triggered Master-slave flip-flop D flip-flop, D register D Flo p La tc h Q c lk c lk D Q clk D Q (latch)
Sequential Elements: Latch
Pass Transistor Latch
Pros:
Tiny
Low clock loads Cons:
Vt drop
nonrestoring backdriving
output noise sensitivity dynamic
D
Q
Sequential Elements: Latch
Transmission Gate Latch
No Vt drop
Requires inverted clock
Inverting Buffer
Pros:
Restoring
No backdriving Fixes either:
output noise sensitivity Or diffusion input Cons: Inverted output D Q φ φ D φ φ X Q D Q φ φ
Sequential Elements: Latch
Tristate feedback
Static
Backdriving risk
Static latches are now essential
Buffered Input
Fixes diffusion input Noninverting φ φ φ φ Q D X φ φ Q D X φ φ
Sequential Elements: Latch
Buffered Output
Non backdriving
Widely used in standard cells
Very robust (important feature) Rather large
Rather slow (1.5 - 2 FO4 delays) High clock loading
Datapath Latch Smaller, faster Unbuffered input φ φ Q D X φ φ φ φ φ φ Q D X
Sequential Elements: Flip-Flop
Flip-Flop
Built as a pair of back-to-back latches
D Q φ φ φ φ X D φ φ φ φ X Q Q φ φ φ φ
Sequential Elements
Enable
Ignore clock when enable is inactive Mux: increase latch D-Q delay
Clock-gating: increase enable setup time, skew
D Q Lat c h D Q en φ φ Lat c h D Q φ 0 1 en Lat c h D Q φ en D Q φ 0 1 en D Q φ en Flop Flo p Flop
Sequential Elements
Reset
Force output low when reset is asserted Synchronous vs. asynchronous D φ φ φ φ Q Q φ φ φ φ reset D φ φ φ φ φ Q φ φ D reset φ Q φ φ D reset reset φ φ reset S y nc h ro nou s Re s e t A s y nc h ron ou s Re s e t S y m bol Flop D Q La tc h D Q reset reset φ φ φ Q reset
Sequential Elements
Set / Reset
Set forces output high when asserted Flip-Flop with asynchronous set and reset
D
φ
φ
φ
φ
φ
φ
Q
φ
φ
reset
set
reset
set
Timing Diagrams Flop A Y tpd Combinational Logic A Y D Q clk clk D Q Lat c h D Q clk clk D Q tcd tsetup thold tccq tpcq tccq tsetup thold tpcq tpdq tcdq
Latch/Flop Setup Time
tsetup
Latch D-Q Cont. Delay
tpcq
Latch D-Q Prop Delay
tpdq
Latch/Flop Clk-Q Cont. Delay
tccq
Latch/Flop Clk-Q Prop Delay
tpcq
Logic Cont. Delay
tcd
Logic Prop. Delay
tpd
Latch/Flop Setup Time
tsetup
Latch D-Q Cont. Delay
tpcq
Latch D-Q Prop Delay
tpdq
Latch/Flop Clk-Q Cont. Delay
tccq
Latch/Flop Clk-Q Prop Delay
tpcq
Logic Cont. Delay
tcd
Logic Prop. Delay
tpd
Contamination propogation delaysand
Sequencing Methods Flip-Flops 2-Phase latches Pulsed latches F lip-F lo ps Flop La tc h Flop clk φ1 φ2 φp clk clk La tc h La tc h φp φp φ1 φ2 φ1 2 -P h as e T ran s p are n t La tc h e s P ul s e d L a tc h e s Combinational Logic Combinational Logic Combinational Logic Combinational Logic La tc h La tc h Tc Tc/2 tnonoverlap tnonoverlap tpw Half-Cycle 1 Half-Cycle 1
Max-Delay: Flip-Flops F1 F2 clk clk clk Combinational Logic Tc Q1 D2 Q1 D2 tpd tsetup tpcq TC tpcq tpd tsetup= + + tpd TC tsetup tpcq≤ − ( + ) sequencing delay
Max-Delay: 2-Phase Latches Tc Q1 L1 φ1 φ2 L2 L3 φ1 φ2 φ1 Combinational Logic 1 Combinational Logic 2 Q2 Q3 D1 D2 D3 Q1 D2 Q2 D3 D1 tpd1 tpdq1 tpd2 tpdq2 tpd tpd1 tpd2= + ≤ Tc 2tpdq− ( ) Tc tpdq1 tpd1 tpdq2 tpd2≥ + + + sequencing delay
Max-Delay: Pulsed Latches Tc Q1 Q2 D1 D2 Q1 D2 D1 φp φp φp Combinational Logic L1 L2 tpw (a) tpw > tsetup Q1 D2 (b) tpw < tsetup Tc tpd tpdq tpcq tpd tsetup TC max tpdq tpd tpcq tpd tsetup tpw≥ ( + , + + − ) tpd TC max tpdq tpcq tsetup tpw≤ − ( , + − ) sequencing delay
Min-Delay: Flip-Flops CL clk Q1 D2 F1 clk Q1 F2 clk D2 tcd thold tccq tcd thold tccq≥ −
Min-Delay: 2 Phase Latches CL Q1 D2 D2 Q1 φ1 L1 φ2 L2 φ1 φ2 tnonoverlap tcd t tccq tcd1 tcd2, ≥ thold tccq tnonoverlap− −
Hold time reduced by nonoverlap
Paradox: Hold applies twice each cycle vs. only once for flops
Min-Delay: Pulsed Latches CL Q1 D2 Q1 D2 φp tpw φp L1 φp L2 tcd thold tccq tcd thold tccq tpw≥ − +
Time Borrowing
In a flip-flop based system
Data launches on one rising/falling edge Must setup before next rising/falling edge If it arrives late, system fails
If it arrives early, time is wasted Flops have hard edges
In a latch-based system
Data can pass through latch when transperent
Long cycle of logic can borrow time into the next cycle As long as each loop completes in one cycle
Time Borrowing Lat c h Lat c h Lat c h
Combinational Logic Combinational
Logic
Borrowing time across half-cycle boundary
Borrowing time across pipeline stage boundary (a) (b) Lat c h Lat c h
Combinational Logic CombinationalLogic
Loops may borrow time internally but must complete within the cycle φ1 φ2 φ1 φ1 φ1 φ2 φ2
Time Borrowing Q1 L1 φ1 φ2 L2 φ1 φ2 Combinational Logic 1 Q2 D1 D2 D2 Tc Tc/2
Nominal Half-Cycle 1 Delay
tborrow
tnonoverlap
tsetup
How much borrowing? 2 phased latches: pulsed latches:
tborrow ≤ TC---2 − (tsetup tnonoverlap+ )
Clock Skew F1 F2 clk clk clk Combinational Logic Tc Q1 D2 Q1 D2 tskew CL Q1 F1 clk Q1 F2 clk D2 clk tskew tsetup tpcq tpdq thold tccq
We have assumed zero clock skew
Clock really have uncertainty in arrival time decrease max-delay
increases min-delay
decreases time borrowing
Clock Skew: Flip-flops
tpd TC tpcq tsetup tskew≤ − ( − − )
Clock Skew: Latches Q 1 L1 φ1 φ2 L2 L3 φ1 φ2 φ1 C om binational Logic 1 C om binational Logic 2 Q 2 Q 3 D 1 D 2 D 3 2 phased latches
tcd1 tcd2, ≥ thold tccq tnonoverlap tskew− − +
tpd Tc 2tpdq≤ − ( )
tborrow ≤ TC---2 − (tsetup tnonoverlap tskew+ + )
pulsed latches
tpd TC max tpdq tpcq tsetup tpw≤ − ( , + − + tskew)
tcd thold tccq tpw tskew≥ − + +