Sub topic 12
Latches and Flip-Flops: Characteristic and Excitation Tables
Assume you know binary logic, Boolean operators, and the difference between combinational and sequential circuits. A sequential circuit has memory: its output depends on both current inputs and its previous state.
Latches and flip-flops
A latch is a storage element controlled by an enable level. While enabled, its output can respond to input changes. A flip-flop is usually controlled by a clock edge, so it changes state only at a rising or falling edge.
Let \(Q\) be the current state and \(Q^+\) be the next state after the active control event. A characteristic table gives \(Q^+\) for each input and current state. An excitation table gives the input needed to move from \(Q\) to a desired \(Q^+\).
The main storage elements are:
| Element | Inputs | Main behavior |
|---|---|---|
| SR | S, R | Set, reset, or hold |
| D | D | Store the input value |
| JK | J, K | Set, reset, hold, or toggle |
| T | T | Hold or toggle |
SR latch
For an active-high SR latch:
| S | R | \(Q^+\) | Operation |
|---|---|---|---|
| 0 | 0 | Q | Hold |
| 0 | 1 | 0 | Reset |
| 1 | 0 | 1 | Set |
| 1 | 1 | Invalid | Forbidden condition |
The invalid condition attempts to set and reset the latch simultaneously. In a NOR-based SR latch, both outputs can temporarily become zero, violating the requirement that they be complements. When the inputs return to 0, the final state may be unpredictable.
The excitation table is:
| Q | \(Q^+\) | S | R |
|---|---|---|---|
| 0 | 0 | 0 | 0 or 1 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 0 or 1 | 0 |
D flip-flop
A D flip-flop removes the invalid SR combination. At the active clock edge:
\[ Q^+ = D \]
| D | \(Q^+\) | Operation |
|---|---|---|
| 0 | 0 | Store 0 |
| 1 | 1 | Store 1 |
Its excitation table is identical:
| Q | \(Q^+\) | D |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
module d_ff(input clk, input d, output reg q);
always @(posedge clk)
q <= d;
endmoduleJK and T flip-flops
The JK flip-flop improves the SR design by defining the \(J=K=1\) case.
| J | K | \(Q^+\) | Operation |
|---|---|---|---|
| 0 | 0 | Q | Hold |
| 0 | 1 | 0 | Reset |
| 1 | 0 | 1 | Set |
| 1 | 1 | \(\overline Q\) | Toggle |
Its excitation table is:
| Q | \(Q^+\) | J | K |
|---|---|---|---|
| 0 | 0 | 0 | 0 or 1 |
| 0 | 1 | 1 | 0 or 1 |
| 1 | 0 | 0 or 1 | 1 |
| 1 | 1 | 0 or 1 | 0 |
A T flip-flop has one input. It holds when \(T=0\) and toggles when \(T=1\).
| T | \(Q^+\) |
|---|---|
| 0 | Q |
| 1 | \(\overline Q\) |
Its characteristic equation is:
\[ Q^+ = T \oplus Q \]
The excitation equation is:
\[ T = Q \oplus Q^+ \]
Clocked state changes
A positive-edge-triggered flip-flop samples its input at a rising clock edge. Between active edges, its stored output remains unchanged.
Exercise
A T flip-flop has Q = 1 and T = 1 at the active clock edge. What is Q+? What value of T is required for the transition 0 to 1?
Show answer
Q+ = 0 because the flip-flop toggles. For the transition 0 to 1, T = 1.