Digital Logic ยท Unit 7 ยท 6 hrs
Registers and Counters
Exam-focused notes for Registers and Counters (Digital Logic, CSC116): what the TU syllabus asks and how it has actually been tested, with 16 solved past questions from this unit.
Registers and Counters in short
This chapter applies flip-flops to two of the most common building blocks in a digital system, registers and counters, and closes with the basic organization of a memory unit that stores the words a system works on.
What this unit covers
- Registers
- Shift registers
- Ripple Counters
- Synchronous Counters
- Timing Sequences
- The memory
Synchronous Counters
2081 ยท 10 marks
Differentiate between synchronous and asynchronous counter. Design a 3-bit synchronous binary counter using T Flip Flop. Draw its timing diagram.[10]
Show solved answerHide answer
Synchronous vs Asynchronous Counter and 3-bit Synchronous Binary Counter Design
Part 1: Difference Between Synchronous and Asynchronous Counter
| Feature | Synchronous Counter | Asynchronous Counter (Ripple Counter) |
|---|---|---|
| Clock | All flip-flops are triggered by the same common clock pulse simultaneously | Each flip-flop is triggered by the output of the previous flip-flop |
| Speed | Faster - no propagation delay accumulation | Slower - delay accumulates through each stage |
| Propagation Delay | Minimal (all FFs switch at same time) | Total delay = sum of individual FF delays |
| Complexity | More complex (requires combinational logic) | Simpler in design and construction |
| Glitches | Less prone to glitches | More prone to glitches due to ripple effect |
| Power | Consumes more power | Consumes less power |
| Construction | Uses T or JK FF with additional combinational gates | Simple series connection of complementing FFs |
| Synchronization | All outputs change simultaneously | Outputs change one after another (ripple effect) |
Part 2: Design of 3-bit Synchronous Binary Counter Using T Flip-Flop
Step 1: State Sequence
A 3-bit binary counter counts from 000 to 111 (0 to 7) and resets back to 000.
Let the three flip-flops be Q2 (MSB), Q1, Q0 (LSB).
Step 2: State Transition Table
| Count | Q2 | Q1 | Q0 | Q2(next) | Q1(next) | Q0(next) | T2 | T1 | T0 |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 |
| 2 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 |
| 3 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 1 |
| 4 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 |
| 5 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 1 |
| 6 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 1 |
| 7 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 1 |
Note for T Flip-Flop: T = 0 means no change (Q(next) = Q), T = 1 means toggle (Q(next) = Q') Therefore: T = Q(next) XOR Q(present)
Step 3: Derive Boolean Expressions Using K-Map
For T0:
| Q2Q1 \ Q0 | 0 | 1 |
|---|---|---|
| 00 | 1 | 1 |
| 01 | 1 | 1 |
| 11 | 1 | 1 |
| 10 | 1 | 1 |
All cells = 1, therefore:
$$\boxed{T_0 = 1}$$
For T1:
| Q2Q1 \ Q0 | 0 | 1 |
|---|---|---|
| 00 | 0 | 1 |
| 01 | 0 | 1 |
| 11 | 0 | 1 |
| 10 | 0 | 1 |
T1 = 1 only when Q0 = 1, therefore:
$$\boxed{T_1 = Q_0}$$
For T2:
| Q2Q1 \ Q0 | 0 | 1 |
|---|---|---|
| 00 | 0 | 0 |
| 01 | 1 | 1 |
| 11 | 1 | 1 |
| 10 | 0 | 0 |
T2 = 1 when Q1 = 1 and Q0 = 1, therefore:
$$\boxed{T_2 = Q_1 \cdot Q_0}$$
Step 4: Summary of Excitation Equations
$$T_0 = 1$$ $$T_1 = Q_0$$ $$T_2 = Q_1 \cdot Q_0$$
Step 5: Logic Circuit Diagram
CLK ----+----------+----------+
| | |
[T FF] [T FF] [T FF]
T0=1 | T1=Q0| T2=Q1.Q0
| | |
Q0 Q1 Q2
| | |
+----------+ |
| AND --+----------+
+----------+
Detailed Circuit:
+-------+ +-------+ +-------+
CLK --------------->| T FF |-------->| T FF |-------->| T FF |
| | | | | |
T0 = 1 ----------->| T Q0 | +--->| T Q1 | +--->| T Q2 |
+-------+ | +-------+ | +-------+
| |
Q0 ----+ Q1 & Q0 (AND) --+
(T1 = Q0) (T2 = Q1.Q0)
Each T flip-flop shares the same clock line, so all three stages switch simultaneously (a true synchronous counter, unlike a ripple counter where each stage is clocked by the previous stage's output). Flip-flop Q0 toggles on every clock pulse since $T_0 = 1$, flip-flop Q1 toggles whenever Q0 is 1, and flip-flop Q2 toggles only when both Q1 and Q0 are 1, exactly reproducing the 3-bit binary counting sequence $000 \to 001 \to \cdots \to 111 \to 000$.
2080 ยท 10 marks
What is asynchronous counter? Design synchronous counter that counts the sequences of 0-1-4-6-7 using T flip-flop.[10]
2079 ยท 10 marks
Differentiate between combinational circuit and sequential circuit. Design mod-10 synchronous counter using J-K flip-flop. Show necessary truth tables and K-maps.[10]
2078 ยท 10 marks
Differentiate between synchronous and asynchronous counter. Design mod-7 synchronous counter using T-flip flop. Show necessary truth tables and k-maps.[10]
Shift registers
2081 ยท 5 marks
Mention different types of shift registers. Explain SIPO with timing diagram. [5]
Show solved answerHide answer
Types of Shift Registers and SIPO with Timing Diagram
Types of Shift Registers
As stated in the notes, a shift register is any register capable of shifting its binary information either to the right or to the left. It consists of a chain of flip-flops connected in cascade, with the output of one flip-flop connected to the input of the next, and all flip-flops sharing a common clock pulse.
The four different types of shift registers are:
| Type | Full Form |
|---|---|
| SISO | Serial In Serial Out |
| SIPO | Serial In Parallel Out |
| PISO | Parallel In Serial Out |
| PIPO | Parallel In Parallel Out |
Serial In Parallel Out (SIPO) Shift Register
Definition
In a SIPO shift register, data is entered one bit at a time serially (one bit per clock pulse) through a single input line, and all stored bits are available simultaneously at the output (parallel output) after all bits have been shifted in.
Circuit Diagram (4-bit SIPO using D Flip-Flops)
Serial Parallel Outputs
Input
+------+ +------+ +------+ +------+
SI ---->| D Q |---->| D Q |---->| D Q |---->| D Q |
| FF0 | | FF1 | | FF2 | | FF3 |
CLK --->| CLK | --->| CLK | --->| CLK | --->| CLK |
+------+ +------+ +------+ +------+
| | | |
Q0 Q1 Q2 Q3
(Parallel Output Available at Q0, Q1, Q2, Q3)
- Data enters at SI (Serial Input) of FF0.
- At each clock pulse, data shifts from FF0 -> FF1 -> FF2 -> FF3.
- After 4 clock pulses, all 4 bits are available simultaneously at Q0, Q1, Q2, Q3.
Operation (Loading the 4-bit data: 1 0 1 1, MSB first)
| Clock Pulse | SI (Input) | Q0 | Q1 | Q2 | Q3 |
|---|---|---|---|---|---|
| Initial | - | 0 | 0 | 0 | 0 |
| CLK 1 | 1 | 1 | 0 | 0 | 0 |
| CLK 2 | 0 | 0 | 1 | 0 | 0 |
| CLK 3 | 1 | 1 | 0 | 1 | 0 |
| CLK 4 | 1 | 1 | 1 | 0 | 1 |
After 4 clock pulses, Q0=1, Q1=1, Q2=0, Q3=1 are available in parallel.
Timing Diagram
CLK : __|--|__|--|__|--|__|--|__
SI : __|1111|0000|1111|1111|__
(bit1)(bit2)(bit3)(bit4)
Q0 : __|1111|0000|1111|1111|__
Q1 : ______|1111|0000|1111|__
Q2 : __________|1111|0000|1111
Q3 : _______________|1111|0000
- Each bit shifts one stage to the right on every rising edge of the clock.
- After 4 clock pulses, all outputs Q0 through Q3 hold the complete 4-bit word simultaneously.
Key Characteristics of SIPO
- Input: Single serial line (1 bit per clock)
- Output: All bits available simultaneously (parallel)
- Clock pulses needed: Equal to the number of bits (n pulses for n-bit register)
- Application: Used in serial-to-parallel data conversion, communication interfaces (e.g., UART receivers)
2080 ยท 5 marks
What is shift register? Explain 4-bit SISO and PIPO with timing Diagram. [5]
2079 ยท 5 marks
Provide one example where shift left operator can be used. Explain serial-in-serial-out register. [5]
2078 ยท 5 marks
Provide one example where shift right operation can be used. Explain parallel-in parallel-out register. [5]
2077 ยท 5 marks
What is the difference between a serial and parallel transfer? Explain how to convert serial data to parallel and parallel data to serial. What type of register is needed? [5]
Show solved answerHide answer
Serial vs Parallel Transfer, Conversion Methods, and Required Register Types
1. Difference Between Serial and Parallel Transfer
| Feature | Serial Transfer | Parallel Transfer |
|---|---|---|
| Data movement | One bit per clock pulse, in sequence | All bits transferred simultaneously in a single clock pulse |
| Speed | Slower (n clock pulses for n bits) | Faster (only 1 clock pulse needed) |
| Wires/Lines required | Fewer (single data line) | More (one line per bit) |
| Hardware complexity | Simpler connections | More complex wiring |
From notes (ctx6): "In case of serial operation, digits are put in sequence, one digit for each clock pulse, whereas in case of parallel operation all digits get shifted simultaneously during a single clock pulse."
2. Types of Registers Needed
The Shift Register is the fundamental register used for both conversions. It supports the following modes (from ctx3):
- SISO - Serial In, Serial Out
- SIPO - Serial In, Parallel Out
- PISO - Parallel In, Serial Out
- PIPO - Parallel In, Parallel Out
3. Converting Serial Data to Parallel (Serial-In Parallel-Out: SIPO)
Register Needed: SIPO Shift Register
Working Principle:
- Data bits are fed into the register one bit at a time through the serial input line, synchronized with each clock pulse.
- After n clock pulses (for an n-bit register), all bits are stored in the flip-flops.
- All stored bits are then read out simultaneously from the parallel output lines.
Example (4-bit SIPO):
Suppose serial input data = 1011 (MSB first)
| Clock Pulse | Serial Input | Q3 | Q2 | Q1 | Q0 |
|---|---|---|---|---|---|
| Initial | - | 0 | 0 | 0 | 0 |
| CP 1 | 1 | 1 | 0 | 0 | 0 |
| CP 2 | 0 | 0 | 1 | 0 | 0 |
| CP 3 | 1 | 1 | 0 | 1 | 0 |
| CP 4 | 1 | 1 | 1 | 0 | 1 |
After 4 clock pulses, parallel outputs Q3 Q2 Q1 Q0 = 1011 are available simultaneously.
From notes (ctx1): "In SIPO the data is stored serially but output is transferred in parallel."
4. Converting Parallel Data to Serial (Parallel-In Serial-Out: PISO)
Register Needed: PISO Shift Register
Working Principle:
- All n data bits are loaded simultaneously into the register through parallel input lines using a parallel load control signal (one clock pulse).
- The bits are then shifted out one at a time through the serial output line, one bit per clock pulse.
- After n clock pulses, all bits have been transmitted serially.
Example (4-bit PISO):
Suppose parallel input data = 1101
| Clock Pulse | Operation | Serial Output |
|---|---|---|
| CP 1 | Parallel Load: 1101 loaded | - |
| CP 2 | Shift right | 1 (MSB out) |
| CP 3 | Shift right | 1 |
| CP 4 | Shift right | 0 |
| CP 5 | Shift right | 1 (LSB out) |
Serial output sequence = 1 1 0 1
From notes (ctx1): "In PISO the data inputs are provided in parallel form and the output is transferred in serial sequence."
5. Summary
| Conversion | Register Type | Input Mode | Output Mode |
|---|---|---|---|
| Serial to Parallel | SIPO | Serial (1 bit/clock) | Parallel (all bits at once) |
| Parallel to Serial | PISO | Parallel (all bits at once) | Serial (1 bit/clock) |
The shift register with appropriate control signals (parallel load, shift right/left, clock pulse) as described in ctx2 is the essential hardware component for both conversions.
2075 ยท 5 marks
What is the difference between a serial and parallel transfer? Explain how to convert serial data to parallel and parallel data to serial. What type of register is needed? [5]
Show solved answerHide answer
Serial vs Parallel Transfer, and Serial-Parallel Conversion
1. Difference Between Serial and Parallel Transfer
| Feature | Serial Transfer | Parallel Transfer |
|---|---|---|
| Data movement | One bit per clock pulse, in sequence | All bits transferred simultaneously in a single clock pulse |
| Speed | Slower (n clock pulses for n bits) | Faster (only 1 clock pulse needed) |
| Wires/Lines required | Fewer (single data line) | More (one line per bit) |
| Hardware complexity | Simpler connections | More complex wiring |
From notes (ctx6): "In case of serial operation, digits are put in sequence, one digit for each clock pulse, whereas in case of parallel operation all digits get shifted simultaneously during a single clock pulse."
2. Type of Register Needed
A Shift Register is required for both conversions. Specifically:
- Serial to Parallel: A Serial In Parallel Out (SIPO) shift register is used.
- Parallel to Serial: A Parallel In Serial Out (PISO) shift register is used.
3. Serial to Parallel Conversion (Using SIPO Register)
A SIPO (Serial In, Parallel Out) register accepts data one bit at a time through a single serial input line and makes all bits available simultaneously at the output.
Working:
- Data bits are shifted in one bit per clock pulse through the serial input (D-input of the first flip-flop).
- Each flip-flop passes its stored bit to the next on each clock pulse.
- After n clock pulses (for an n-bit register), all n bits are stored and available simultaneously at the parallel outputs Q1, Q2, ... Qn.
Example (4-bit SIPO):
Suppose serial input is: 1 0 1 1 (MSB first)
| Clock Pulse | Serial Input | Q3 | Q2 | Q1 | Q0 |
|---|---|---|---|---|---|
| Initial | - | 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 0 | 0 | 0 |
| 2 | 0 | 0 | 1 | 0 | 0 |
| 3 | 1 | 1 | 0 | 1 | 0 |
| 4 | 1 | 1 | 1 | 0 | 1 |
After 4 clock pulses, parallel output = 1 0 1 1 (available all at once).
4. Parallel to Serial Conversion (Using PISO Register)
A PISO (Parallel In, Serial Out) register accepts all data bits simultaneously through parallel input lines and outputs them one bit at a time through a single serial output line.
Working:
- A parallel load control signal is applied, loading all n bits into the register simultaneously in one clock pulse.
- Then, on each subsequent clock pulse, bits are shifted out one by one through the serial output (from the last flip-flop).
- After n clock pulses, all bits have been transmitted serially.
Example (4-bit PISO):
Suppose parallel input loaded = 1 0 1 1
| Clock Pulse | Operation | Serial Output |
|---|---|---|
| 0 | Parallel Load: 1 0 1 1 | - |
| 1 | Shift right | 1 |
| 2 | Shift right | 1 |
| 3 | Shift right | 0 |
| 4 | Shift right | 1 |
Serial output sequence: 1, 1, 0, 1 (LSB first in this case).
Summary
| Conversion | Register Used | Clock Pulses Needed |
|---|---|---|
| Serial โ Parallel | SIPO | n pulses to fill, then read all at once |
| Parallel โ Serial | PISO | 1 pulse to load, n pulses to shift out |
From notes (ctx1): "In SIPO the data is stored serially but output is transferred in parallel. In PISO the data inputs are provided in parallel form and the output is transferred in serial sequence."
Ripple Counters
2081 ยท 5 marks
Design a 2 bit asynchronous binary counter using T Flip Flop. Draw its timing diagram. [5]
2080 ยท 5 marks
Design an asynchronous Mod 11 up counter using T flip flop. [5]
Show solved answerHide answer
Asynchronous Mod-11 Up Counter Using T Flip-Flop
Given
- Counter type: Asynchronous (ripple)
- Modulus: 11 (counts 0 to 10, i.e. 11 distinct states)
- Flip-flop type: T flip-flop
- Direction: Up counter
No numeric values are missing. The design is fully specified.
Solution
Step 1: Number of Flip-Flops
We need enough flip-flops to represent 11 states:
$$2^n \geq 11 \implies 2^4 = 16 \geq 11$$
So $n = 4$ flip-flops are needed: FF0, FF1, FF2, FF3 with outputs $Q_0, Q_1, Q_2, Q_3$.
Step 2: Count Sequence (0 to 10)
| Count | $Q_3$ | $Q_2$ | $Q_1$ | $Q_0$ |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 |
| 2 | 0 | 0 | 1 | 0 |
| 3 | 0 | 0 | 1 | 1 |
| 4 | 0 | 1 | 0 | 0 |
| 5 | 0 | 1 | 0 | 1 |
| 6 | 0 | 1 | 1 | 0 |
| 7 | 0 | 1 | 1 | 1 |
| 8 | 1 | 0 | 0 | 0 |
| 9 | 1 | 0 | 0 | 1 |
| 10 | 1 | 0 | 1 | 0 |
| 11 (transient) | 1 | 0 | 1 | 1 |
The counter counts 0000 through 1010, then on the next clock it momentarily enters 1011 (decimal 11), which is detected and used to force an immediate asynchronous reset to 0000.
Step 3: Reset (Detection) Logic
The unwanted state to detect is 1011:
$$Q_3 = 1,\ Q_2 = 0,\ Q_1 = 1,\ Q_0 = 1$$
The minimal detection term (using only the bits that are 1 and unique to state 11 among reachable states) is:
$$\text{CLR} = Q_3 \cdot Q_1 \cdot Q_0$$
Verification: Among the valid stable states (0-10), is $Q_3 Q_1 Q_0 = 1$ true anywhere else?
- State 10 (1010): $Q_3=1, Q_1=1, Q_0=0 \Rightarrow$ product $=0$. Safe.
- No other reachable state has $Q_3=1$ and $Q_1=1$ simultaneously with $Q_0=1$.
Hence $\text{CLR}=Q_3 Q_1 Q_0$ uniquely fires at state 1011. Confirmed correct.
Step 4: T Flip-Flop Connections (Ripple Configuration)
For a ripple up counter with negative-edge (falling-edge) triggered flip-flops, each Q drives the clock of the next stage, and all T inputs are held at logic 1 to toggle:
| Flip-Flop | T Input | Clock Source |
|---|---|---|
| FF0 | 1 | External Clock (CLK) |
| FF1 | 1 | $Q_0$ |
| FF2 | 1 | $Q_1$ |
| FF3 | 1 | $Q_2$ |
(With $T=1$, each flip-flop toggles on every triggering edge, giving frequency division by 2 down the chain, the standard ripple count-up behaviour.)
Step 5: Circuit Diagram
+---------+ +---------+ +---------+ +---------+
CLK --->|CLK FF0 | |CLK FF1 | |CLK FF2 | |CLK FF3 |
|T=1 Q0 |--+->|T=1 Q1 |--+->|T=1 Q2 |--+->|T=1 Q3 |--+
| CLR | | | CLR | | | CLR | | | CLR | |
+----^----+ | +----^----+ | +----^----+ | +----^----+ |
| | | | | | | |
+-------+-------+-------+-------+-------+-------+ |
| | |
CLR<----+-----[ 3-input AND: Q3.Q1.Q0 ]<--------------+
Q0 Q1 Q3
Reset logic:
Q3 ---+
Q1 ---+---> [ 3-input AND ] ---> CLR ---> (active-HIGH asynchronous CLEAR of all FFs)
Q0 ---+
Step 6: Summary
| Parameter | Value |
|---|---|
| Modulus | 11 |
| Flip-flops | 4 (T type) |
| Type | Asynchronous / ripple |
| T inputs | all tied to logic 1 |
| Reset term | $Q_3 \cdot Q_1 \cdot Q_0$ (state 1011) |
| Count range | 0000 โ 1010 (0 to 10) |
Conclusion: A Mod-11 asynchronous up counter uses 4 T flip-flops in ripple cascade with all $T=1$. A 3-input AND gate decoding $Q_3 Q_1 Q_0$ detects the transient state 1011 and asynchronously clears all flip-flops back to 0000, giving a repeating cycle of 11 states.
2079 ยท 5 marks
What are the practical implications of down counter? Explain BCD ripple counter. [5]
2078 ยท 5 marks
What are the practical implications of up counter? Explain Binary ripple counter. [5]
2077 ยท 5 marks
Illustrate the use of Binary ripple counter and BCD ripple counter. [5]
2075 ยท 5 marks
Design a 4-bit binary ripple counter with D flip-flops. [5]
Make Unit 7 stick
Practice CSC116 with flashcards & quizzes