EEE235 Digital Logic Design Chapter 6. Latches/Flip-Flops and Registers/Counters 서강대학교 전자공학과
. Delay and Latches ) Signal Storage a. as voltage level static memory b. as charges dynamic memory 2) Delays a. due to gates and interconnection lines b. Uncertain delays : I. typical (nominal), min/max delays II. Statistical delay c. Rising/falling delay: % 9%, 9% % of voltage swing d. Transport delay : port- to-port (pin-to-pin) delay e. Inertial delay I. Tends to block narrow pulses (inertia, resistance tplh to tphl change) II. Energy to charge/discharge internal capacitances III. Unbalance between rising & falling delays
Flip-flop Register. : noise(perfact signal.)
3) Latches a. Closed signal path : feedback loop b. Stability and Meta-stability I. Unstable Leads to oscillation II. Meta-stable Temporarily stuck between and Responsible for rare and hard-to-find failure III. Bistable Two stable states A B
c. SR Latches i. Structure ii. Behavior R S S R n *X n S R n n *X Forbidden inputs in RS latch with NANDs/NORs Unpredictable behavior : depends on propagation delay of NORs/NANDs forbidden input conditions It is sensitive to noise To alleviate the noise problems, a control signal is used - Gated SR latch iii. Level-sensitive & Asynchronous hard to control
Improvement of SR-latch (Gated SR-latch) I. Controlled by a control signal II. Still level-sensitive (w.r.t. control signal) III. Short duty cycle to prevent errors d. Gated SR latch - It can be usable SR latch S Control R Still, problem with SR latch Noise-sensitivity and forbidden input conditions
4) Latch Applications a. as a temporary storage element needed for data processing and I/O circuits without complex feedback b. to reduce glitches c. RS latch has forbidden input condition - D latch
2. Clocks and Flip-flops ) Basic Concepts a. More reliable storage elements in more general sequential circuits b. F/F: a bistable memory with precise timing control (by clock) 2) Clocking Methods a. Level-sensitive : latches b. Positive (negative) edge-triggered * F/Fs use the clock edge for the output change
A negative edge-triggered SR flip-flop (a simple circuit) S R Clock
A negative edge-triggered SR flip-flop (a simple circuit) S R Clock
3) A positive-edge-triggered D flip-flop P3. P = P2 = and P3 = D, p4 = D when Clock = 2. P = D P2 = D when Clock goes to high 3. Further changes in D do not affect when Clock = if D = at then P2 = -> P4 = regardless of D if D = at then P = -> P2 = P3 = regardless of D P3, P4 must be stable when Clock goes to high : Setup time is delay from D through gate 4 to gates and 3 2 P 5 Clock 3 P2 6 (n+) = D(n) D D(n) (n+) D 4 P4 Clock (a) Circuit (b) Graphical Symbol (c) Transition Table
Master-slave D flip-flop Both clocking edges Preset D Clock Clear (a) Circuit Reset(Clear) and Preset: Asynchronous inputs
4) JK Flip-flop a. Structure b. Transition Table - Next page J(n) K(n) (n+) (n) (n) c. Transition-map for (n+) d. Excitation table for deriving transition function J(n) K(n) (n) (n) (n+) J(n)K(n) S(n)R(n) D(n) x x x x x x
JK flip-flop J K Clock D (a) Circuit (n+) = J(n)(n) + K(n)(n) : JK F/F (n+) = S(n)R(n) + R(n)(n) : SR F/F (n+) = D(n) : D F/F J K (b) Transition functions (c) Graphical symbol
T flip-flop T Clock D T Clock D
3. Flip-flop Behavior ) States a. Internal state and total state (the set of stored data ) b. State transition table and diagram I. Defines a memory s(state Register) next state function II. Allows repetitive behavior to be easily visualized 2) State Behavior a. Flip-flop behavior described by means of state table/diagram b. Each transition is triggered by clock signal c. Described by characteristic equation JK flip-flop ( n ) J( n) ( n) K( n) ( n) (, ) (, ) (, ) (, ) (, ) Set (, ) Reset (, ) (, )
3) Registers a. A set of flip-flops with common control logic b. Parallel-load type, shift-type, shift with parallel-load c. A simple shift register In D 2 3 4 D D D Out Clock (a) Circuit t t t 2 t 3 t 4 t 5 t 6 t 7 In 2 3 4 = Out (b) A sample sequence
d. Parallel-load shift register Parallel output 3 2 D D D D Serial input Shift/Load Parallel input Clock
4) Counters a. Asynchronous (Ripple) Counter I. A cascade of flip-flops, each of which toggling its successor II. Slow, lack of generality in design process b. Synchronous Counter I. Popular II. Uses a common clock for all f/f s c. Ring Counter I. Rotates a single thru all its flip-flops II. State diagram III. Decoder is embedded d. Johnson Counter I. Similar to ring counter II. State diagram III. Only one bit change between adjacent states no glitches
Synchronous Counter Clock T T T 2 T 3 (a) Circuit Clock 2 3 Count 2 3 4 5 6 7 8 9 2 3 4 5 (b) Timing diagram
Ring Counter n D PR D D R R R Reset Clock
Johnson Counter n D D D R R R Reset Clock
F/F Timing t SU t SU t h Clk t ff t CC D Inputs to f/f stabilized f/f outputs stabilized t P, clk > t SU + t ff + t CC + margin f clk < /(t SU + t ff + t CC + margin)
4. Memory An SRAM cell Sel Data Data An DRAM cell Data Sel
A 2 m x n SRAM block Data inputs d n d n 2 d Write Sel Sel Address a a a m m -to-2 m decoder Sel 2 Sel 2 m Read Data outputs q n q n 2 q