Registers and Counters Quick Reference Guide

Ring Counter
A ring counter is a shift register whose last output is connected back to its first input.
Only one HIGH bit normally moves through the register.
3-Bit Architecture
For a 3-bit ring counter:
D0 = Q2D1 = Q0D2 = Q1- All flip-flops use a common clock.
Fig. 1: 3-bit Ring Counter

Working
Assume the initial state is 001.
At every active clock edge, the HIGH bit moves to the next position.
Table 1: Ring-Counter Sequence
| Clock | Q2Q1Q0 |
|---|---|
| 0 | 001 |
| 1 | 010 |
| 2 | 100 |
| 3 | 001 |
A valid initial value must contain one HIGH bit. The state 000 cannot start the ring sequence by itself.
Johnson Counter
A Johnson counter is a shift register in which the inverted last output is connected back to the first input.
It is also called a:
- Twisted-ring counter
- Switch-tail ring counter
3-Bit Architecture
For a 3-bit Johnson counter:
D0 = ~Q2D1 = Q0D2 = Q1- All flip-flops use a common clock.
Fig. 2: 3-bit Johnsons Counter

Working
A 3-bit Johnson counter produces six different states.
Table 2: Johnson-Counter Sequence
| Clock | Q2Q1Q0 |
|---|---|
| 0 | 000 |
| 1 | 001 |
| 2 | 011 |
| 3 | 111 |
| 4 | 110 |
| 5 | 100 |
| 6 | 000 |
For an n-bit Johnson counter:
Number of states = 2n
Ring-Counter Data Loading
A ring counter needs an initial data pattern before shifting can begin.
Data can be loaded using:
- Synchronous loading
- Asynchronous loading
Synchronous Loading
In synchronous loading, data is loaded only at the active clock edge.
A 2-to-1 multiplexer is connected before every D input.
The control input LD selects between:
LD = 1: Load parallel dataLD = 0: Shift the stored data
Fig. 3: Ring Counter with Synchronous Data Loading

Connections
For parallel data P2P1P0:
D0 = LD · P0 + ~LD · Q2
D1 = LD · P1 + ~LD · Q0
D2 = LD · P2 + ~LD · Q1Table 3: Synchronous Loading Operation
| LD | Operation |
|---|---|
| 0 | Ring shifting |
| 1 | Load P2P1P0 |
Working
- Apply the required data to
P2P1P0. - Set
LD = 1. - Give one active clock edge to load the data.
- Set
LD = 0. - Further clock edges shift the loaded data in a ring.
Asynchronous Loading
Asynchronous loading uses active-LOW PRESET and CLEAR inputs.
The data is loaded without waiting for a clock edge.
Table 4: Asynchronous Bit Loading
| Required Bit | ~PRE | ~CLR | Result |
|---|---|---|---|
| Shift mode | 1 | 1 | Normal operation |
| Load 0 | 1 | 0 | Output becomes 0 |
| Load 1 | 0 | 1 | Output becomes 1 |
| Invalid | 0 | 0 | Not allowed |
Fig. 4: Ring Counter with Asynchronous Data Loading

Working
To load 101:
- For
Q2 = 1:~PRE2 = 0,~CLR2 = 1 - For
Q1 = 0:~PRE1 = 1,~CLR1 = 0 - For
Q0 = 1:~PRE0 = 0,~CLR0 = 1
After loading:
- Set all
~PRE = 1 - Set all
~CLR = 1 - Apply the clock to begin shifting
Controlled Ring-Johnson Counter
A controlled counter can work as either a ring counter or a Johnson counter.
A control input C selects the feedback signal.
3-Bit Connections
P0 = Q2 ⊕ C
P1 = Q0
P2 = Q1Fig. 5: Ring/Johnsons Counter with Control Input C

Table 5: Counter Selection
| C | Feedback to D0 | Operation |
|---|---|---|
| 0 | Q2 | Ring counter |
| 1 | ~Q2 | Johnson counter |
Data Loading
A 3-bit parallel data input can be used to set the initial state.
- Ring mode requires a one-HIGH pattern such as
001. - Johnson mode can begin from
000.
Working
When C = 0
The XOR output follows Q2.
D0 = Q2
The stored bit pattern circulates through the three stages.
When C = 1
The XOR output becomes ~Q2.
D0 = ~Q2
The circuit follows the Johnson-counter sequence.
Applications of Registers and Counters
Registers and counters can be combined to store data, count clock cycles and control circuit operation.
Clock-Gating Circuit
The clock-gating circuit produces a fixed number of output clock edges.
Inputs and Output
Inputs:
SEND3-bit CYCLESClock
Output:
CLK_OUT
Fig. 6: Programmable Clock Gating Circuit

Main Blocks
The circuit contains:
- Active-HIGH output falling-edge detector
- Negative-edge-triggered JK flip-flop
- 3-bit load/count down counter
- Zero-detection circuit
- AND clock gate
Edge Detection
When SEND changes from 1 → 0, the edge detector produces one pulse:
SEND_EDGE = 1
This pulse is connected to the J input of the JK flip-flop.
Counter Control
The counter uses:
LD = 1: LoadCYCLESLD = 0: Count down
The connection is:
LD = ~ENABLE
Therefore:
ENABLE = 0: Load modeENABLE = 1: Count mode
Stop Detection
The counter reaches zero when:
Q2Q1Q0 = 000
The STOP equation is:
STOP = ~(Q0 + Q1 + Q2)STOP is connected to the K input of the JK flip-flop.
Clock Output
CLK_OUT = ENABLE · ClockWorking
- During idle mode,
ENABLE = 0. - The counter loads the value available at
CYCLES. - When
SENDchanges from HIGH to LOW,SEND_EDGE = 1. - The JK flip-flop sets and makes
ENABLE = 1. LDbecomes0, so the counter starts counting down.- The input clock passes through the AND gate.
- When the counter reaches
000,STOP = 1. - The JK flip-flop resets and makes
ENABLE = 0. - The clock gate closes.
Table 6: Clock-Gating Operation
| Condition | ENABLE | Counter Mode | CLK_OUT |
|---|---|---|---|
| Idle | 0 | Load | 0 |
| Transmission active | 1 | Count down | Clock |
| Counter reaches 000 | 0 | Load | 0 |
The number of output clock edges is controlled by the value stored in CYCLES.
Digital Dice
The digital dice combines:
- A high-speed MOD-6 counter
- A 3-bit PIPO register
- A rising-edge detector
- A 7-segment BCD display
Fig. 7: Digital Dice

Counter Operation
The MOD-6 counter repeatedly counts:
1 → 2 → 3 → 4 → 5 → 6 → 1The counter runs continuously using a high-speed clock.
Roll Input
The push button R produces HIGH when pressed.
An active-HIGH output rising-edge detector generates one pulse when:
R: 0 → 1
The edge-detector output is connected to the clock of the PIPO register.
Working
- The MOD-6 counter changes rapidly from 1 to 6.
- The user presses
R. - The rising-edge detector generates one pulse.
- The PIPO register stores the current counter value.
- The stored value appears on the
7_Seg_BCD_display. - The display keeps the value until the next button press.
The captured value appears random because the counter changes faster than the user can observe.
Target Landing Game
The target landing game uses an 11-bit ring counter connected to 11 active-HIGH LEDs.
LED Sequence
White → White → Blue → Blue → Red → Yellow → Red → Blue → Blue → White → WhiteThe illuminated LED shows the landing position and score category.
Inputs:
P– Point buttonR– Reset/Run buttonPOWER– Forces reset mode
Fig. 8: Target Landing Game Circuit

Reset and Run Control
Button R uses an active-HIGH output rising-edge detector.
Its output R_EDGE clocks a T flip-flop.
Connections:
T = 1PRE = 1- Output
Q = RST_N
Each press of R toggles RST_N.
Table 7: Reset and Run Modes
| RST_N | Mode | LED Operation |
|---|---|---|
| 0 | Reset mode | All LEDs OFF |
| 1 | Normal mode | Ring counter runs |
POWER keeps the circuit in reset mode regardless of the button inputs.
Starting the Ring
Another active-HIGH output rising-edge detector monitors RST_N.
When RST_N changes from 0 → 1:
RST_EDGE = 1
The first ring-register input is:
D0 = RST_EDGE + Q10
Therefore:
RST_EDGEinserts the first HIGH bit.Q10provides normal ring feedback.
The HIGH bit then moves rapidly through the LEDs.
Stopping the LED
Button P uses another active-HIGH output rising-edge detector.
Its output P_EDGE clocks a D flip-flop.
Connections:
D = 1Clock = P_EDGEQ = OF- ~Q controls the ring-counter clock gate
The gated ring clock can be represented as:
CLK_RING = Clock · RST_N · ~OFWorking
- In reset mode, all
LEDsremain OFF. - Press
Rto changeRST_Nfrom 0 to 1. RST_EDGEinserts oneHIGHbit into the ring counter.- The
HIGHbit moves rapidly through theLEDs. - Press P to generate
P_EDGE. - The D flip-flop stores
OF = 1. ~OFbecomes0and blocks the ring clock.- The currently selected
LEDremains ON. - Pressing
Pagain does not restart the circuit. - Press
Rto return to reset mode. - Press
Ragain to start a new round.
Custom UART Frame
The custom UART circuit sends a 4-bit data word with one start bit and one stop bit.
The complete frame contains six bits:
Start Bit + 4 Data Bits + Stop Bit
The transmitter uses a PISO register, and the receiver uses a SIPO register.
Fig. 9: Custom UART Model

Main Inputs and Outputs
Inputs:
- 6-bit parallel data (
Input_Data) SENDClock~RESET
Outputs:
- Received 6-bit frame (
D_Out) TX
Start Detection
An active-HIGH output falling-edge detector monitors SEND.
When:
SEND: 1 → 0
It produces:
SEND_P = 1
SEND_P is connected to the J input of a positive-edge-triggered JK flip-flop.
Transmission Control
The JK flip-flop output is:
ENABLE = Q
The transmission flag is:
TX = ENABLE
The gated shift clock is:
SHIFT_CLK = ENABLE · Clock
Bit Counter
A 3-bit synchronous up counter counts the transmitted bits.
The counter counts from 0 to 5.
The STOP output becomes HIGH at decimal 5:
STOP = Q2 · ~Q1 · Q0
STOP is connected to the K input of the JK flip-flop.
The counter reset control uses:
~CLR = ENABLE
Therefore:
ENABLE = 0: Counter remains reset.ENABLE = 1: Counter operates normally.
Working
~RESET = 0resets the complete circuit.- The 4-bit data, start bit and stop bit are loaded into the PISO register.
SENDchanges from HIGH to LOW.- The falling-edge detector generates
SEND_P. - The JK flip-flop sets
ENABLE = 1. TXbecomes HIGH.- The gated clock shifts one bit from the PISO register during each clock cycle.
- The SIPO register receives the bits from the serial line.
- The synchronous counter counts the six transmitted bits.
- When the count reaches
5,STOP = 1. - The JK flip-flop resets and makes
ENABLE = 0. - The shift clock stops.
TXreturns LOW.- The received 6-bit frame remains stored in the SIPO register.
Table 8: UART Transmission Stages
| Stage | Operation |
|---|---|
| Idle | ENABLE = 0, TX = 0 |
SEND falling edge | SEND_P = 1 |
| Transmission | ENABLE = 1, PISO and SIPO shift |
Count reaches 5 | STOP = 1 |
| Complete | Clock stops and received frame remains stored |
The circuit transmits exactly one 6-bit frame for each valid SEND falling edge.
Concept understood? Let's apply and learn for real