7 Registers And Counters

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.

Registers and Counters: notes

Registers

A register is a group of flip-flops, one per bit, that together hold one binary word; an $n$-bit register can store any of the $2^n$ possible bit patterns, and a common clock pulse applied to every flip-flop in the register lets the whole word be loaded in a single, synchronized step. Data can be moved into or out of a register in two ways: in serial operation, the bits of a word are transferred one at a time, one bit per clock pulse, while in parallel operation every bit of the word is transferred simultaneously in a single clock pulse.

Combining these two possibilities for input and output gives four standard register configurations. A serial-in serial-out (SISO) register accepts data one bit at a time and also outputs it one bit at a time. A serial-in parallel-out (SIPO) register accepts data serially but makes the whole stored word available at once. A parallel-in serial-out (PISO) register is loaded with an entire word at once but reads it back out one bit at a time. A parallel-in parallel-out (PIPO) register both loads and reads out the entire word in a single clock pulse.

Shift registers

A shift register is a register capable of shifting its stored bits one position to the right or to the left on each clock pulse. It is built from a chain of flip-flops connected in cascade, the output of each flip-flop feeding the input of the next, with every flip-flop in the chain sharing a common clock so that all stages shift together on the same pulse.

A fully-featured shift register typically provides several control capabilities: a clear control to reset the whole register to 0; a clock input that synchronizes every shift operation; a shift-right control, together with the serial input and output associated with shifting right; a shift-left control, together with its own serial input and output; a parallel-load control, together with the $n$ parallel input lines and $n$ parallel output lines needed for a full parallel transfer; and a hold state, in which the register's contents remain unchanged even while clock pulses continue to be applied.

A shift register able to shift in both directions is called bidirectional, while one that only shifts in a single direction is called unidirectional. A register that combines shifting with a full parallel-load capability is often called a universal shift register, since it can be configured, clock pulse by clock pulse, to hold, shift left, shift right, or parallel-load a new word.

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 answer

Synchronous vs Asynchronous Counter and 3-bit Synchronous Binary Counter Design


Part 1: Difference Between Synchronous and Asynchronous Counter

FeatureSynchronous CounterAsynchronous Counter (Ripple Counter)
ClockAll flip-flops are triggered by the same common clock pulse simultaneouslyEach flip-flop is triggered by the output of the previous flip-flop
SpeedFaster - no propagation delay accumulationSlower - delay accumulates through each stage
Propagation DelayMinimal (all FFs switch at same time)Total delay = sum of individual FF delays
ComplexityMore complex (requires combinational logic)Simpler in design and construction
GlitchesLess prone to glitchesMore prone to glitches due to ripple effect
PowerConsumes more powerConsumes less power
ConstructionUses T or JK FF with additional combinational gatesSimple series connection of complementing FFs
SynchronizationAll outputs change simultaneouslyOutputs 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

CountQ2Q1Q0Q2(next)Q1(next)Q0(next)T2T1T0
0000001001
1001010011
2010011001
3011100111
4100101001
5101110011
6110111001
7111000111

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 \ Q001
0011
0111
1111
1011

All cells = 1, therefore:

$$\boxed{T_0 = 1}$$

For T1:

Q2Q1 \ Q001
0001
0101
1101
1001

T1 = 1 only when Q0 = 1, therefore:

$$\boxed{T_1 = Q_0}$$

For T2:

Q2Q1 \ Q001
0000
0111
1111
1000

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$.

Open this answer on its own page โ†’

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]

  • Counter type to design: synchronous counter - Count sequence: 0 โ†’ 1 โ†’ 4 โ†’ 6 โ†’ 7 โ†’ (back to 0) - Flip-flop type: T flip-flop - Highest state = 7 โ†’ needs 3 flip-flops ($Q2 Q1 Q0$) - Used states: 0, 1, 4, 6, 7 - Unused states (don't care): 2, 3, 5 --- An asynchronous counter (ripple counter) is a ...
Open this answer on its own page โ†’

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]

  • Counter type: Mod-10 (decade / BCD) synchronous counter - Flip-flop type: J-K flip-flop - Count sequence: $0 \to 9$ then back to $0$ - Number of flip-flops: $2^4 = 16 \ge 10 \Rightarrow 4$ flip-flops - States $1010$ to $1111$ (10-15) are unused โ†’ don't-care conditions - Deliverables required: c...
Open this answer on its own page โ†’

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]

  • Counter type required: Mod-7 synchronous counter - Flip-flop type: T flip-flop - Count sequence: 0 to 6 (7 states), then back to 0 - Deliverables: comparison table, truth tables, K-maps, design No numeric data missing. All information is complete. --- Feature Synchronous Counter Asynchronous Co...
Open this answer on its own page โ†’

Shift registers

2081 ยท 5 marks

Mention different types of shift registers. Explain SIPO with timing diagram. [5]

Show solved 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:

TypeFull Form
SISOSerial In Serial Out
SIPOSerial In Parallel Out
PISOParallel In Serial Out
PIPOParallel 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 PulseSI (Input)Q0Q1Q2Q3
Initial-0000
CLK 111000
CLK 200100
CLK 311010
CLK 411101

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)
Open this answer on its own page โ†’

2080 ยท 5 marks

What is shift register? Explain 4-bit SISO and PIPO with timing Diagram. [5]

Any register capable of shifting its binary information either to the right or to the left is called a shift register. It consists of a chain of flip-flops connected in cascade, where the output of one flip-flop is connected to the input of the next flip-flop. All flip-flops receive a common cloc...

Open this answer on its own page โ†’

2079 ยท 5 marks

Provide one example where shift left operator can be used. Explain serial-in-serial-out register. [5]

--- The shift left operation is commonly used for fast multiplication by powers of 2. Example: Let the binary number stored in a register be: After applying one shift left operation: After applying two shift lefts: Observation: Operation Binary Decimal Effect ------------------------------------ ...

Open this answer on its own page โ†’

2078 ยท 5 marks

Provide one example where shift right operation can be used. Explain parallel-in parallel-out register. [5]

--- A very common and practical use of the shift right operation is in fast division by powers of 2. Example: Consider an 8-bit register holding the binary number: Performing a 1-bit shift right operation: Result: The value is divided by 2 (24 / 2 = 12), without using a division circuit. Key Poin...

Open this answer on its own page โ†’

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 answer

Serial vs Parallel Transfer, Conversion Methods, and Required Register Types


1. Difference Between Serial and Parallel Transfer

FeatureSerial TransferParallel Transfer
Data movementOne bit per clock pulse, in sequenceAll bits transferred simultaneously in a single clock pulse
SpeedSlower (n clock pulses for n bits)Faster (only 1 clock pulse needed)
Wires/Lines requiredFewer (single data line)More (one line per bit)
Hardware complexitySimpler connectionsMore 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 PulseSerial InputQ3Q2Q1Q0
Initial-0000
CP 111000
CP 200100
CP 311010
CP 411101

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 PulseOperationSerial Output
CP 1Parallel Load: 1101 loaded-
CP 2Shift right1 (MSB out)
CP 3Shift right1
CP 4Shift right0
CP 5Shift right1 (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

ConversionRegister TypeInput ModeOutput Mode
Serial to ParallelSIPOSerial (1 bit/clock)Parallel (all bits at once)
Parallel to SerialPISOParallel (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.

Open this answer on its own page โ†’

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 answer

Serial vs Parallel Transfer, and Serial-Parallel Conversion

1. Difference Between Serial and Parallel Transfer

FeatureSerial TransferParallel Transfer
Data movementOne bit per clock pulse, in sequenceAll bits transferred simultaneously in a single clock pulse
SpeedSlower (n clock pulses for n bits)Faster (only 1 clock pulse needed)
Wires/Lines requiredFewer (single data line)More (one line per bit)
Hardware complexitySimpler connectionsMore 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 PulseSerial InputQ3Q2Q1Q0
Initial-0000
111000
200100
311010
411101

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 PulseOperationSerial Output
0Parallel Load: 1 0 1 1-
1Shift right1
2Shift right1
3Shift right0
4Shift right1

Serial output sequence: 1, 1, 0, 1 (LSB first in this case).


Summary

ConversionRegister UsedClock Pulses Needed
Serial โ†’ ParallelSIPOn pulses to fill, then read all at once
Parallel โ†’ SerialPISO1 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."

Open this answer on its own page โ†’

Ripple Counters

2081 ยท 5 marks

Design a 2 bit asynchronous binary counter using T Flip Flop. Draw its timing diagram. [5]

A binary ripple (asynchronous) counter consists of a series connection of complementing flip-flops where the output of each flip-flop is connected to the clock input of the next higher-order flip-flop. The flip-flop holding the Least Significant Bit (LSB) receives the incoming count pulses. A T F...

Open this answer on its own page โ†’

2080 ยท 5 marks

Design an asynchronous Mod 11 up counter using T flip flop. [5]

Show solved 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$
00000
10001
20010
30011
40100
50101
60110
70111
81000
91001
101010
11 (transient)1011

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-FlopT InputClock Source
FF01External Clock (CLK)
FF11$Q_0$
FF21$Q_1$
FF31$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

ParameterValue
Modulus11
Flip-flops4 (T type)
TypeAsynchronous / ripple
T inputsall tied to logic 1
Reset term$Q_3 \cdot Q_1 \cdot Q_0$ (state 1011)
Count range0000 โ†’ 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.

Open this answer on its own page โ†’

2079 ยท 5 marks

What are the practical implications of down counter? Explain BCD ripple counter. [5]

--- A down counter is a counter that counts in decreasing order (e.g., from 15 to 0 for a 4-bit counter). Its practical implications include: 1. Timer/Countdown Applications: Used in digital timers, microwave ovens, and bomb-timer circuits where counting down to zero triggers an action. 2. Addres...

Open this answer on its own page โ†’

2078 ยท 5 marks

What are the practical implications of up counter? Explain Binary ripple counter. [5]

--- An up counter is a counter that counts in increasing order (0, 1, 2, 3, ..., 2โฟ - 1) and then resets back to 0. Its practical implications include: 1. Frequency Division: An up counter divides the input clock frequency. Each flip-flop divides the frequency by 2, making it useful in clock divi...

Open this answer on its own page โ†’

2077 ยท 5 marks

Illustrate the use of Binary ripple counter and BCD ripple counter. [5]

--- A binary ripple counter consists of a series connection of complementing flip-flops (T flip-flops or JK flip-flops) where the output of each flip-flop is connected to the clock input of the next higher-order flip-flop. The flip-flop holding the Least Significant Bit (LSB) receives the incomin...

Open this answer on its own page โ†’

2075 ยท 5 marks

Design a 4-bit binary ripple counter with D flip-flops. [5]

A binary ripple counter is a series connection of complementing flip-flops where the output of each flip-flop is connected to the clock input of the next higher-order flip-flop. The LSB flip-flop receives the incoming count pulses. Since we need to use D flip-flops, we must first convert them to ...

Open this answer on its own page โ†’