Combinational vs sequential. A combinational circuit's outputs depend
only on the present values of its inputs — adders, decoders, MUXes have no memory.
A sequential circuit's outputs depend on the inputs and on the present
state of storage elements: the circuit remembers its history. The next state is itself a
function of the external inputs and the present state, so a sequential circuit is
specified by a time sequence of inputs, outputs and internal states. That memory
element is what turns logic into counters, registers and FSMs.
The canonical block diagram: a combinational circuit plus
clocked flip-flops whose outputs feed back. Credit: redrawn (after Mano fig. 1.2 / 5.1).
Worked problem
Define a sequential circuit. How does it differ from a combinational circuit?
A sequential circuit's output depends on the present inputs
and the present state of its storage elements (it has memory); next state =
f(inputs, present state). A combinational circuit's output depends only on the
present inputs (no memory). Structure: combinational logic + flip-flops with a feedback
path from FF outputs back into the logic.
Two timing families. A synchronous circuit's behaviour is defined at
discrete instants — all flip-flops share one clock and update together, so
analysis is orderly (this is what we design all unit). An asynchronous circuit
responds to input changes at any instant and in the order they occur — mostly
used as latches, or as ripple counters where each FF is clocked by the previous one.
Async is faster in principle but suffers unbounded, cumulative delays and races.
Worked problem
Differentiate synchronous and asynchronous sequential circuits.
Synchronous: state updates only at clock edges (all FFs share the clock); behaviour
defined at discrete instants; easy to design, no races. Asynchronous: state can change
any time inputs change; order of input changes matters; faster but vulnerable to races
and hazards — used for latches and ripple counters.
Where this unit is going: storage element (latch) → clocked
storage (flip-flop) → FF types and their tables → registers (store/move data)
→ counters (count clock pulses) → design procedure (state table →
K-maps → circuit). Every exam question in this unit is one of those six verbs.
2SR latch — the basic memory cell
Idea. A latch is a storage element that operates on signal levels
(it is level-sensitive). The simplest one stores one bit using two cross-coupled NOR
gates: the output of each gate feeds an input of the other, so whatever state is present
keeps itself alive — that loop is the memory. It has two inputs: S (set the
output to 1) and R (reset it to 0).
SR latch built from two cross-coupled NOR gates. Credit:
redrawn (after Mano fig. 5.2 / lecture deck "SR latch with NOR gates").
S
R
Q
Q̄
state
0
0
no change (memory)
hold
0
1
0
1
reset
1
0
1
0
set
1
1
0
0
forbidden (Q = Q̄ = 0 breaks the pairing)
Worked problem
Draw and explain the SR latch using NOR gates. Give the truth table and explain why S = R = 1 is forbidden.
Two NOR
gates cross-coupled: gate-1 inputs R and Q̄ produce Q; gate-2 inputs Q and S produce
Q̄. S = 1, R = 0 → Q = 1 (set). R = 1, S = 0 → Q = 0 (reset). S = R = 0
→ feedback keeps the previous value — storage. S = R = 1 forces Q = Q̄ = 0,
which is forbidden: when both inputs return to 0 together the final state depends
on gate delays (race) — hence "not used".
The same latch in NAND form — inputs become active-LOW
(S′, R′). Credit: redrawn (after Mano fig. 5.3 / deck "SR latch with NAND
gates").
Worked problem
Explain the SR latch built with NAND gates (the S′R′ latch). How does it differ from the NOR version?
Two
cross-coupled NANDs. NAND needs a 0 to act, so inputs are complementary:
S′ = 0 sets Q = 1, R′ = 0 resets Q = 0, both at 1 = hold, both at 0 =
forbidden. Compared with the NOR version every input value is complemented — that is
why the datasheet name is S′R′ latch (active-LOW inputs).
Adding an enable: two steering NANDs gate S and R into the
latch. Credit: redrawn (after Mano fig. 5.4, "SR latch with control input").
Worked problem
Explain the SR latch with control (enable) input. What limitation still remains?
Two extra NAND gates
steer S and R into the basic latch. EN = 0: steering outputs stay 1 → the
latch holds regardless of S, R. EN = 1: S and R pass through and the latch
responds as usual. The indeterminate S = R = 1 condition still exists when EN = 1, which
is exactly why clocked flip-flops (next sections) were invented.
3Clocks, level vs edge triggering
The clock. A clock is a periodic square wave that decides when storage
elements are allowed to accept new data — it is an enable signal for the whole circuit.
Using one shared clock converts the wild asynchronous world into an orderly one: every
state change happens on a defined tick, and analysis becomes "look at the circuit just
before and just after each tick".
Rising and falling edges; the three ways a clock input can be
drawn. Credit: original drawing for these notes (after lecture deck "Clock Pulse
Transition").
Trigger style
Symbol on the FF
Responds to
Level (latch)
plain clock input
whole time the clock is HIGH (or LOW)
Positive-edge
triangle > inside, no bubble
0→1 transition only
Negative-edge
triangle + bubble
1→0 transition only
Worked problem
Compare level triggering and edge triggering. Draw the clock-input symbols.
Level-sensitive (latches):
output can follow inputs during the entire level of the enable/clock. Edge-triggered
(flip-flops): the state changes only at the instant of the selected transition — rising
(shown by a triangle) or falling (triangle + bubble). Edge triggering is what kills the
multiple-transition problem: while the clock is still high, input changes are ignored.
Worked problem
Distinguish between a latch and a flip-flop.
A latch is level-sensitive: it
is transparent while enabled (output follows input). A flip-flop is edge-sensitive:
it samples the input only at the clock edge and holds it until the next edge. Flip-flops
are built from latches (e.g. master–slave = two latches clocked on opposite phases)
and are the practical storage elements of synchronous circuits.
Why edges? (multi-transition problem) If a clocked FF responded
during the whole HIGH level and its other inputs changed while the clock was still 1, the
output could change several times in one clock pulse. Restricting response to a single
edge makes the state change exactly once per clock — deterministic and analysable.
4The four flip-flops: SR, D, JK, T
From latch to flip-flop. Put an enable/clock on a latch and you get a clocked
flip-flop. The four classic types differ only in what their inputs command the next
state to be. Learn the truth (characteristic) tables below — everything else in
the unit (excitation tables, characteristic equations, counter design) is built from
them.
The four standard clocked flip-flop symbols. Credit: original
drawing for these notes (after lecture deck figures 7–10).
FF
Truth table (CLK active)
One-line behaviour
SR
00 hold · 01 reset · 10 set · 11 not-used
set / reset / hold — but S = R = 1 forbidden
D
D = 0 → Q = 0; D = 1 → Q = 1
output follows input at the clock edge (delay element)
JK
00 hold · 01 reset · 10 set · 11 toggle
like SR but the forbidden case becomes toggle
T
T = 0 hold; T = 1 toggle
JK with J = K tied together — the counter flip-flop
Worked problem
Write the characteristic equations of the D and T flip-flops.
From the truth tables: Q(t+1) = D — the next state is whatever D holds at the
edge. For the T flip-flop: Q(t+1) = T⊕Q = T′Q + TQ′ — hold when T = 0,
toggle when T = 1. (All four equations are derived by K-map in section 5.)
Reading the tables fast: D-FF = "copy at the edge" (used for data
storage, shift registers); JK = "universal FF" (does everything: hold, set, reset,
toggle); T = JK with J = K = T (used in counters because toggle = add 1 in binary).
5Excitation tables & characteristic equations
Two directions, two tables. The characteristic table reads forward:
given the inputs, what is the next state? The excitation table reads backward:
given the present state and the desired next state, what inputs do I must feed?
The excitation table is the design tool — counter design (section 13) is nothing but
looking up this table row by row.
Present Q
Next Q(t+1)
S
R
J
K
T
D
0
0
0
X
0
X
0
0
0
1
1
0
1
X
1
1
1
0
0
1
X
1
1
0
1
1
X
0
X
0
0
1
X = don't care — any value works, which is
where K-map simplification gets its power. Note D has no don't-cares: D is forced
(Q(t+1) copied). T toggles whenever the state must change (0→1 or 1→0).
Characteristic equations (derive each by K-mapping the truth
table):
SR: Q(t+1) = S + R′Q (with S·R = 0 holding)
D: Q(t+1) = D
JK: Q(t+1) = JQ′ + K′Q
T: Q(t+1) = T⊕Q = TQ′ + T′Q
Memorise the JK and D rows of the excitation table cold — the 3-bit
design in section 13 and every MOD-N problem uses them.
Worked problem
Prepare the truth table, characteristic table and excitation table of the JK flip-flop, and state its characteristic equation.
Derive the characteristic equation of the JK flip-flop.
Write the truth table with Q(t) as a variable: (J,K,Q) → next: 000→0,
001→1 (hold rows); 010→0, 011→0 (reset); 100→1, 101→1
(set); 110→1, 111→0 (toggle). Plot next = f(J, K, Q) on a 3-variable K-map;
the 1s group as JQ′ (the set + toggle-with-Q′ cells) and K′Q (hold +
toggle-with-Q cells) → Q(t+1) = JQ′ + K′Q.
6Setup time, hold time, metastability
Timing windows around the clock edge. Real flip-flops are analogue devices for
a few hundred picoseconds around the triggering edge. The data must be stable before
the edge for a minimum time — the setup time (tsu) — and must
stay stable after the edge for the hold time (th). If the data
is changing inside either window, the internal latch pair may fail to resolve to a clean
logic level.
The two stability windows around the triggering edge. Credit:
original drawing for these notes (after lecture deck "Setup time and Hold time").
Worked problem
Define setup time and hold time of a flip-flop. What is metastability?
Setup time: the minimum duration the input data must be stable before the
triggering clock edge. Hold time: the minimum duration it must remain stable
after the edge. Violating either can leave the FF in metastability — the
output hovers at an intermediate/undefined level for an indeterminate time before
resolving, possibly to the wrong value. Synchronous design guarantees tsu and
th by construction (all FFs clocked together, data launched and captured by
edges of the same clock).
Exam-safe wording: "If data changes within the setup or hold
window, the output may become metastable — the flip-flop cannot decide whether to store
the old or new value; the final stored value is unpredictable and the resolution time is
unbounded."
7Race-around & the master-slave JK
The problem. In a level-triggered JK flip-flop with J = K = 1, the command is
toggle. But "level-triggered" means the FF listens for the whole duration
the clock is HIGH. If the clock pulse is wider than the FF's own propagation delay
(tpd ≈ nanoseconds), the output toggles, feeds back, toggles again — and
keeps toggling for as long as the clock stays high. The final value is unpredictable.
This repeated, uncontrolled toggling during one clock pulse is the race-around
condition.
Worked problem
Define the race-around condition. When does it occur and how is it cured?
In a
level-triggered JK FF, when J = K = 1 and the clock pulse width (tpw)
is greater than the FF propagation delay (tpd), the output toggles
repeatedly during the single clock pulse instead of exactly once — the race-around
condition. Cures: (i) clock pulse width < tpd (impractical), (ii)
edge-triggering, (iii) master–slave construction.
Master–slave JK: two clocked latches, slave clocked by
the inverted clock. Credit: redrawn (after lecture deck fig. 9 "JK flip flop and its race
around condition").
Worked problem
Explain the master–slave JK flip-flop. How does it eliminate the race-around condition?
Cascade two clocked
SR latches: the master receives J, K and the clock; the slave receives the
master's outputs and the inverted clock. When CLK = 1 the master samples J, K
while the slave is frozen; when CLK = 0 the master freezes and the slave copies the
master's output to Q. The output therefore changes exactly once per clock pulse
and can never re-enter the master while the clock is high — race-around is eliminated.
That is why the MS-JK symbol is drawn as level-sensitive with a "pending output"
notation, and why in practice everyone simply uses edge-triggered JK FFs.
8Flip-flop conversion (JK ↔ D ↔ T)
The 4-step recipe (this exact flow is in your lecture deck — "Design of
JK flip-flop from D flip-flop"):
Step 1 — write the truth table of the required FF. Step 2 — write the excitation table of the available FF. Step 3 — merge into the conversion table: for each (Q, required-input)
pair, list both the required FF's inputs and the available FF's inputs. Step 4 — K-map the available FF's inputs vs (Q, required inputs) and wire the
combinational logic between them.
Same recipe converts any FF into any other — only the K-map variables
change.
Worked problem
Implement a JK flip-flop using a D flip-flop. Give the conversion table and the final logic.
Required:
JK. Available: D (excitation: D = Q(t+1)). Conversion table rows (J, K, Q, Q+, D):
(0,0,0)→0, D = 0 · (0,0,1)→1, D = 1 · (0,1,0)→0, D = 0 ·
(0,1,1)→0, D = 0 · (1,0,0)→1, D = 1 · (1,0,1)→1, D = 1 ·
(1,1,0)→1, D = 1 · (1,1,1)→0, D = 0. K-mapping D over (J, K, Q):
D = JQ′ + K′Q. Wire one AND for J·Q′, one for
K′·Q, OR them into the D pin — a D-FF plus that logic is a JK-FF.
Worked problem
Implement a T flip-flop using a D flip-flop.
Required: T.
Available: D. Conversion table: (T = 0): Q+ = Q → D = Q; (T = 1): Q+ = Q′
→ D = Q′. K-map over (T, Q) gives D = T⊕Q (XOR). So a D-FF with
an XOR gate on its input (inputs T and Q̄-feedback) behaves exactly as a T-FF.
Other pairs on the same recipe: D from JK: D = JQ′ +
K′Q with J = D, K = D′; T from JK: tie J = K = T; JK from T: J = K = T·Q
+ ... (rarely asked). If the exam names a pair, run the 4 steps — never guess the
expression.
9Registers & the four shift-register types
Register. A group of flip-flops sharing a clock is a register — it
stores n bits (one FF per bit). A register has two basic functions: data storage
and data movement. Add wiring that passes each FF's output to its neighbour's
input and the register shifts: every clock edge moves every bit one position —
that is a shift register. Direction options: left, right, rotate, bidirectional.
The four input/output combinations of a 4-bit shift register.
Credit: original drawing for these notes (after lecture deck "SHIFT REGISTER" slides
4–8).
Type
In
Out
Clocks to load
Clocks to unload
Use
SISO
serial
serial
N
N
delay line, serial pipe
SIPO
serial
parallel
N
1 (just read)
serial-to-parallel converter (receiver)
PISO
parallel
serial
1
N
parallel-to-serial converter (transmitter)
PIPO
parallel
parallel
1
1
temporary storage / time delay
Worked problem
Explain the four types of shift registers with a data-movement summary.
SISO:
data enters one FF and leaves from the last; N clocks load, N clocks unload (example:
"1010" walks through a 4-bit register in 4 edges). SIPO: serial in, but every FF
output is brought out — after N clocks all bits are read simultaneously (serial→
parallel conversion). PISO: all bits loaded in one clock through load logic, then
shifted out one bit per clock (parallel→serial). PIPO: each FF has its own
input and output — one clock to store, one to read; serves as temporary storage or time
delay.
Worked problem
What is a register? How does it differ from a counter?
A
register is a set of flip-flops used to store and move data (any pattern). A
counter is a register plus next-state logic designed to step through a fixed sequence
of states (usually binary counting). Register: data-path function; counter:
state-sequence (arithmetic/timing) function.
Worked problem
Serial vs parallel data transfer — give two differences.
Clock pulses: moving N bits serially needs N clock pulses (one bit per edge);
parallel moves all N bits in one pulse — so parallel is faster. Wiring:
serial needs a single line (one FF connected to the output terminal); parallel needs N
lines proportional to the bit count — more connections and pins.
10Universal shift register (USR)
One register, every mode. A universal shift register does everything:
serial in/out, parallel in/out, shift left, shift right, and hold. Structure: each FF
has a 4×1 MUX in front of its D input. The MUX select lines S1, S0
choose, per FF, between: the previous FF's output (shift path), the serial input, the
parallel data input, and its own output (hold). Clear and clock go to all FFs.
4-bit USR: one 4×1 MUX per flip-flop, mode lines S1 S0.
Credit: redrawn (after lecture deck "Design of Universal Shift Register" / Mano sec. 6.2
74194 style).
S1
S0
Mode
What happens
0
0
hold / no change
each FF re-captures its own Q — locked even with clocks applied
0
1
shift left
data moves toward the most-significant FF; serial input enters at the last FF
1
0
shift right
data moves toward the least-significant FF; serial input enters at the first FF
1
1
parallel load
inputs I3..I0 stored into F3..F0 in a single clock
Worked problem
Explain the universal shift register with its mode-select table.
Four D-FFs, each fed by a 4×1 MUX selected by S1 S0. S1S0 = 00: MUX
selects the FF's own output → no change. 01: MUX selects the serial-shift-left
path. 10: serial-shift-right path. 11: MUX selects parallel inputs I3..I0 → the
register loads in one clock. Because it handles serial and parallel input/output
in both directions it is called universal (the 74194 is the classic TTL part).
Wiring detail the exam likes: pin-1 of FFk's MUX comes from
Q of FFk−1 (shift-right chain) or FFk+1 (shift-left chain); pin-3 of
every MUX carries the parallel input; the serial input feeds only the first (right-shift)
or last (left-shift) MUX. S1S0 = 00 self-loops the register — that's the "locked state"
your deck mentions.
11Asynchronous (ripple) counters
The cheapest counter. Wire J = K = 1 on every FF (toggle mode) and clock FF0
from the input; clock FFk+1 from Q of FFk. No combinational logic at all.
The count "ripples" because each FF is clocked by the previous FF's output, not
by the input clock — hence asynchronous (or ripple) counter. A 2-bit version
counts 00→01→10→11→00.
2-bit ripple up-counter and its timing (negative-edge FFs).
Credit: original drawing for these notes (after lecture deck "2-bit Up ripple counter" +
timing).
Worked problem
Explain 2-bit ripple up- and down-counters with their sequences and timing.
Up:
CLK → FF0; Q0 → CLK of FF1 (with negative-edge FFs, Q0 falling means "carry
borrowed", FF1 toggles) — sequence 00, 01, 10, 11. Down: same, but take the clock
for FF1 from Q̄0 instead — now FF1 toggles when Q0 goes 0→1, which is
a borrow in downward counting — sequence 11, 10, 01, 00. Only the tap point changes:
Q for up, Q̄ for down (for negative-edge FFs; with positive-edge FFs it's the
mirror rule).
Worked problem
Explain how a counter acts as a frequency divider. What division ratios are available?
Each toggle-FF halves the
frequency of its clock: f(Q0) = fCLK/2, f(Q1) = f/4, generally
f(Qn−1) = f/2n. So a counter is simultaneously a
frequency divider: 3 FFs divide by 8, and a divide-by-64 needs 6 FFs (2⁶ =
64). Waveforms: each output is a square wave at half the frequency of its clock input.
Reading a ripple timing diagram: find the triggering edges (count
transitions happen on CLK falling edges for negative-edge FFs), then check each Q
changes only at its own clock's active edge — that stagger is exactly the
propagation-delay accumulation of section 15.
12Decade (MOD-10) counter & the MOD-N recipe
Truncating a binary counter. Four toggle-FFs naturally count 0–15
(MOD-16). A decade counter keeps only states 0000–1001 (0–9) and must
never rest in 1010–1111. Trick: detect the first unwanted state 1010
(= 10, i.e. QB = QD = 1, reading QD QC
QB QA) with a NAND gate and wire its output to the active-LOW
CLR of every FF. The counter reaches 1010 for a few nanoseconds and is instantly
wiped to 0000 — so it shows ten stable states: MOD-10.
MOD-10 ripple counter: NAND(QB, QD)
drives CLR of all four FFs. Credit: original drawing for these notes (after lecture deck
"Decade Counter / Mod-10 Ripple Counter").
MOD-N recipe (asynchronous) — works for any N:
1. FFs needed: n where 2n ≥ N (smallest n).
2. Wire them as a ripple up-counter (J = K = 1, Q → next CLK).
3. Write N in binary; find the 1-bits of state N (= the first forbidden state).
4. NAND those Q outputs → connect to every FF's active-LOW CLR. Examples: MOD-6 (110 → NAND QC, QB · 3 FFs) · MOD-10
(1010 → NAND QD, QB · 4 FFs) · MOD-12 (1100 → NAND QD, QC).
Worked problem
Design a decade (MOD-10) ripple counter using JK flip-flops.
Four JK FFs
(J = K = 1) chained Q → CLK. Unwanted states begin at 1010. NAND inputs:
QB, QD (the two 1s of 1010); output → CLR of all four FFs.
Count sequence: 0000, 0001, …, 1001, (1010 momentarily) → clear → 0000.
Ten stable states per cycle → divides input frequency by 10 — the standard
digit-counter / divide-by-10 block.
Worked problem
Design a MOD-6 asynchronous counter using JK flip-flops, and generalise the procedure to any MOD-N.
n: 2³ = 8 ≥ 6
→ 3 FFs. Ripple chain as usual. First forbidden state = 6 = 110
(QC QB QA). NAND(QC, QB) →
CLR of all three FFs. Sequence 000…101 → (110 flash) → 000: six states
0–5, MOD-6 confirmed. (MOD-12: 4 FFs, NAND QD QC for 1100.)
The problem. Design a 3-bit counter that counts up
(000→001→…→111) when mode M = 0 and down
(111→110→…→000) when M = 1, using T flip-flops,
all clocked together (synchronous). This is the 7-step design from the lecture deck —
master these steps and every synchronous-counter question becomes bookkeeping.
Worked design
Design a 3-bit synchronous up/down counter using T flip-flops with mode control M (M = 0: count up, M = 1: count down). All flip-flops share one clock.
Step 1 — number and type of FFs. MOD-8 needs 3 bits → 3 flip-flops
(count up to 2³−1 = 7). Type: T, because a T-FF with T = 1 does exactly
what a counter bit does at a carry — toggle.
Step 2 — T-FF excitation. Ti = 1 exactly when bit i must change:
Qi(t+1) ⊕ Qi(t). (Row-wise: 0→0: T = 0; 0→1:
T = 1; 1→0: T = 1; 1→1: T = 0.)
Step 3 — mode control. Input M: M = 0 → up-count, M = 1 →
down-count. M enters the combinational logic of T1, T2.
Step 4 — state transition diagram. One ring of eight states; the direction is
chosen by M.
State diagram: solid green = up (M = 0), dashed amber = down
(M = 1). Credit: original drawing for these notes.
google: 3 bit up down counter state diagram synchronous
Step 5 — circuit excitation table. For each (M, present state) write the next
state, then T = XOR of the two.
M
Q2 Q1 Q0
Next Q2 Q1 Q0
T2 T1 T0
row rule
0 (up)
0 0 0
0 0 1
0 0 1
+1
0 0 1
0 1 0
0 1 1
carry into Q1
0 1 0
0 1 1
0 0 1
+1
0 1 1
1 0 0
1 1 1
double carry
1 0 0
1 0 1
0 0 1
+1
1 0 1
1 1 0
0 1 1
carry
1 1 0
1 1 1
0 0 1
+1
1 1 1
0 0 0
1 1 1
wrap to 000
1 (down)
1 1 1
1 1 0
0 0 1
−1
1 1 0
1 0 1
0 1 1
borrow into Q1
1 0 1
1 0 0
0 0 1
−1
1 0 0
0 1 1
1 1 1
double borrow
0 1 1
0 1 0
0 0 1
−1
0 1 0
0 0 1
0 1 1
borrow
0 0 1
0 0 0
0 0 1
−1
0 0 0
1 1 1
1 1 1
wrap to 111
Step 6 — K-maps. T0 = 1 always (LSB toggles every clock, both
directions). T1 and T2 don't depend on Q2 at all — map them over
(M, Q1, Q0).
T1 — K-map (rows Q1, cols M Q0)
00
01
11
10
Q1 = 0
0
1
0
1
Q1 = 1
0
1
0
1
T1 = M′Q0 + MQ0′ (up: toggle when Q0 = 1; down: toggle when Q0 = 0)
T2 — K-map (rows Q1, cols M Q0)
00
01
11
10
Q1 = 0
0
0
0
1
Q1 = 1
0
0
1
0
T2 = M′Q1Q0 + MQ1′Q0′ (up: both lower bits 1; down: both lower bits 0)
Step 7 — circuit. Three T-FFs on one clock; T0 tied to 1; T1 and T2 from
AND–OR logic sharing the M line (one inverter makes M′).
Final circuit: common clock, T0 = 1, T1 and T2 from the
K-map expressions. Credit: original drawing for these notes.
google: 3 bit synchronous up down counter using T flip flop circuit
diagram mode control
Verification (do this in the exam — 60 seconds): M = 0, state 011
→ T1 = Q0 = 1, T2 = Q1Q0 = 1, T0 = 1 → all toggle → 100 ✓.
M = 1, state 100 → T1 = Q0′ = 1, T2 = Q1′Q0′ = 1 → 011
✓. Wrap-around: M = 0 at 111 → T2T1T0 = 111 → 000 ✓.
Worked problem
Prepare the state table and state diagram of a 3-bit binary counter, and derive its T flip-flop inputs.
Present state Q2Q1Q0 (000…111) → next state = present + 1 (mod 8); the table
is the M = 0 half of the table above. With T-FFs the FF inputs are T = Q(t+1)⊕Q —
for the plain up-counter that gives the famous result T0 = 1, T1 = Q0, T2 =
Q1Q0. State diagram: 000 → 001 → 010 → 011 → 100 → 101
→ 110 → 111 → 000 in a single closed ring.
14Ring & Johnson counters
Counters made of shift registers. A shift register with feedback from its last
output back to its first input becomes a counter — the data pattern simply circulates.
Two classic wirings:
Left: ring counter (Q3 → D0). Right: Johnson counter
(Q3̄ → D0). Credit: original drawing for these notes.
Worked problem
Explain the ring counter: circuit, state sequence, MOD number and its advantage.
n FFs in a chain, output of the last wired
directly to the input of the first, and the register preset with a single 1
(1000 for 4 FFs). Each clock moves the 1 one position: 1000 → 0100 → 0010
→ 0001 → repeat. MOD number = n (n states from n FFs — half the
binary counter's 2n). Big advantage: the one-hot output needs no decoding
logic — each FF output already is a decoded timing signal (used for
sequencing control steps).
Worked problem
Explain the Johnson (twisted-ring) counter. How many states does it produce, and how are they decoded?
Same chain but the feedback
is inverted: Q̄ of the last FF feeds D0. Starting from 0000 the pattern
fills with 1s then empties: 0000 → 1000 → 1100 → 1110 → 1111
→ 0111 → 0011 → 0001 → repeat. MOD number = 2n (8 states
from 4 FFs — twice the ring). State decoding needs only 2-input AND gates
(every valid state is identified by exactly one pair Qi, Q̄j).
Worked problem
Compare ring, Johnson and binary ripple counters.
Property
Ring
Johnson
Binary ripple
States from n FFs
n
2n
2n
Feedback
Q of last → D0
Q̄ of last → D0
Q → next CLK
Initialise
preset single 1
clear (0000)
clear
Decoding
none (one-hot)
2-input ANDs
full n-input AND per digit
Self-correcting?
no (stuck patterns)
no (but → 2n self-correcting variants exist)
yes
Typical use
timing sequences
multi-phase clocks, seq control
frequency division, counting
Worked problem
State the MOD number of a ring counter and of a Johnson counter, each built from n flip-flops.
Ring:
MOD-n (e.g. 4 FFs → 4 states). Johnson: MOD-2n (4 FFs → 8
states). Both are far below the 2n of a binary counter — the trade for cheap
decoding and glitch-free timing outputs.
15Sync vs async counters & the family tree
The one real weakness of ripple counters. Because each FF is clocked by the
previous FF's output, the clock "ripple" accumulates: reaching the final stable state
after a carry takes up to n · tpd. During that settling window
the decoder sees transient false states (glitches). That caps the clock frequency at
fmax ≈ 1 / (n · tpd) and grows worse with every
added bit.
011 → 100: each FF changes one gate-delay after the
previous. Credit: original drawing for these notes.
Worked problem
Why does propagation delay limit the operating speed of a ripple counter? Give the remedy.
Every FF starts switching only after the previous one settles, so the worst-case settle
time is n·tpd (e.g. 4 FFs × 30 ns = 120 ns); the clock period must
exceed it, so fmax ≈ 1/(n·tpd), and decoded outputs
glitch during settling. Remedy: the synchronous counter — all FFs share the input
clock and the "toggle now?" decision is made by combinational logic (T1 = Q0,
T2 = Q1·Q0, …); all bits change within a single tpd regardless of
bit count.
Feature
Asynchronous (ripple)
Synchronous
Clock source
previous FF's output (ripples)
one common clock to all FFs
Speed / fmax
limited: ≈ 1/(n·tpd)
high: one tpd per state change
Hardware
minimal (no gates)
needs AND/comb. logic per bit
Decoding glitches
yes (transient states)
no (all bits settle together)
Design effort
trivial wiring + reset trick
excitation table + K-maps
Typical use
frequency dividers, simple counts
fast counters, system timing
Family tree of this unit: binary ripple (MOD-2n) →
truncated ripple (MOD-N via NAND reset: decade) → synchronous (common clock,
K-mapped T/J inputs: up/down design) → shift-register counters (ring MOD-n,
Johnson MOD-2n). Frequency division f/2n works for every one of them.
16Formula & design-recipe sheet
Characteristic equations
Q(t+1) = S + R′Q (SR, with S·R = 0) · Q(t+1) = D ·
Q(t+1) = JQ′ + K′Q · Q(t+1) = T⊕Q
Derivation = truth table with Q(t) column → K-map.
Excitation table (the design lookup) — Q → Q+:
0→0: SR = 0X · JK = 0X · T = 0 · D = 0
0→1: SR = 10 · JK = 1X · T = 1 · D = 1
1→0: SR = 01 · JK = X1 · T = 1 · D = 0
1→1: SR = X0 · JK = X0 · T = 0 · D = 1
Synchronous counter design (any sequence)
1. n FFs: 2n ≥ states · 2. pick FF type · 3. state
diagram/table · 4. excitation rows (Ti = Qi(t+1)⊕Qi)
· 5. K-map each T/J input · 6. draw circuit · 7. verify two states + wrap.
MOD-N recipes
Async: n FFs with 2n ≥ N, ripple chain, NAND the 1-bits of state N
→ CLR. Examples: MOD-6 = NAND(QC,QB) · MOD-10 = NAND(QD,QB) ·
MOD-12 = NAND(QD,QC).
Ring: MOD-n (one-hot, preset 1000). Johnson: MOD-2n (Q̄ feedback, start
0000). Binary: MOD-2n.
Counting & frequency
MOD number = number of states in the cycle. fout = fCLK / MOD
= f / 2n for a full binary chain. Ripple fmax ≈
1/(n·tpd); synchronous: one tpd per transition.
Timing definitions (quote verbatim)
Setup: data stable before the edge for tsu. Hold: stable after
the edge for th. Violation → metastability (undefined output,
indeterminate resolution). Race-around: level-triggered JK, J = K = 1, tpw
> tpd → multiple toggles; cure = edge triggering or
master–slave.
Serial vs parallel (N bits)
Serial: N clock pulses, 1 wire. Parallel: 1 clock pulse, N wires. Shift register load /
unload: SISO N/N · SIPO N/1 · PISO 1/N · PIPO 1/1.
USR modes (S1S0): 00 hold · 01 shift-left · 10 shift-right · 11 parallel
load.