CSC 382 · Computer Architecture 1
Our notes
2 min readSequential circuits
The output depends on the inputs and the stored state: they have memory. A clock signal makes changes happen at set moments.
SR latch
Two cross-coupled NOR (or NAND) gates. S (set) makes Q = 1; R (reset) makes Q = 0; both 0 keeps the old value; S = R = 1 is forbidden (both outputs go to 0 with NOR, and the next state is unpredictable).
Flip-flops
Edge-triggered: they change only on a clock edge.
| Type | Inputs | Behaviour |
|---|---|---|
| D | D | Q takes the value of D at the clock edge |
| JK | J, K | 00 hold, 10 set, 01 reset, 11 toggle |
| T | T | 0 hold, 1 toggle |
The D flip-flop is the basic storage cell of registers; JK removes the forbidden state of SR.
Registers
A group of flip-flops storing a word: an 8-bit register is 8 D flip-flops on one clock. The CPU's registers (accumulator, program counter) are built like this.
Shift registers
Each clock moves the bits one place: serial-in serial-out, serial-in parallel-out (used to receive serial data), parallel-in serial-out (to send it). Shifting left multiplies an unsigned number by 2; shifting right divides by 2.
Example: 0001 0110 (22) shifted left once: 0010 1100 (44).
Counters
- Asynchronous (ripple) counter: each flip-flop's output clocks the next. Simple, but the delays add up.
- Synchronous counter: all flip-flops share the clock; faster and glitch-free.
A 4-bit binary counter counts 0 to 15 and wraps. A mod-n counter resets at n: a mod-10 (decade) counter goes 0 to 9.
Example: a counter clocked by a 32,768 Hz watch crystal needs 15 stages of halving to give 1 Hz, since 2¹⁵ = 32,768.
Timing
- Setup time: D must be steady a little before the clock edge.
- Hold time: and a little after.
- Propagation delay: the time from the clock edge to the new Q.
The clock period must exceed the longest path delay between flip-flops, which sets the maximum clock frequency.
Exams usually ask
- Explain the SR latch and its forbidden state.
- Give truth tables for D, JK and T flip-flops.
- Describe shift registers and design a simple counter.
Common mistake
Calling a latch a flip-flop. A latch follows its inputs while enabled; a flip-flop changes only at the clock edge.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
No reading links here yet
Our team adds free books, videos and practice for each topic, and opens every link before it goes up.