Activity 3.2.2 β Counter Applications & Now Serving Display¶
Learning Objectives¶
By the end of this lesson, students will be able to:
- Explain real-world applications of counters in digital systems
- Design a 2-digit counter (00-99) using cascaded counters
- Connect counters to 7-segment displays using decoder ICs
- Implement frequency division for timing applications
- Design modulus-12 counter for 12-hour clock applications
Vocabulary¶
Vocabulary (click to expand)
| Term | Definition |
|---|---|
| Cascading | Connecting counters in series to extend their range |
| Frequency Division | Dividing an input frequency by an integer |
| Now Serving Display | A digital display showing the next number in a queue |
| Seven-Segment Decoder | An IC that converts binary/BCD to 7-segment display signals |
| Multiplexing | Time-sharing a resource between multiple users |
Part 1: Real-World Counter Applications¶
Counters are everywhere in everyday digital devices. Here are some common applications:
Digital Clocks¶
Digital clocks use counters to keep time: - 60 Hz (or 50 Hz) power line frequency β divided to get seconds - Seconds counter: divide by 60 β minutes - Minutes counter: divide by 60 β hours - Hours counter: divide by 12 (or 24)
Event Counters¶
Used to count items on assembly lines, visitors entering a building, or pulses from sensors.
Frequency Dividers¶
Each toggle flip-flop divides the input frequency by 2: - Input: 1 MHz β Γ·2 β 500 kHz β Γ·2 β 250 kHz β Γ·2 β 125 kHz - Useful for generating different clock speeds in computers
Timers and Stopwatches¶
Counters increment at regular intervals to measure elapsed time.
Queue Management Systems¶
"Now Serving" displays at delis, banks, and doctor offices use counters to show the next number in line.
Key insight: The "Now Serving" display is a perfect project for learning counter design because it combines counting, display decoding, and reset logic in one practical system.
Part 2: Frequency Division Explained¶
When flip-flops toggle, they divide the input frequency by 2.
Frequency Division Chain¶
Input: 1 Hz (1 pulse per second)
After Γ·2: 0.5 Hz (1 pulse every 2 seconds)
After Γ·4: 0.25 Hz (1 pulse every 4 seconds)
After Γ·8: 0.125 Hz (1 pulse every 8 seconds)
After Γ·16: 0.0625 Hz (1 pulse every 16 seconds)
Practical Example: 1 Hz Clock from 32.768 kHz¶
Real-time clocks use a 32.768 kHz crystal because it divides evenly by 2^15:
32,768 Hz Γ· 2 = 16,384 Hz
Γ· 2 = 8,192 Hz
Γ· 2 = 4,096 Hz
Γ· 2 = 2,048 Hz
Γ· 2 = 1,024 Hz
Γ· 2 = 512 Hz
Γ· 2 = 256 Hz
Γ· 2 = 128 Hz
Γ· 2 = 64 Hz
Γ· 2 = 32 Hz
Γ· 2 = 16 Hz
Γ· 2 = 8 Hz
Γ· 2 = 4 Hz
Γ· 2 = 2 Hz
Γ· 2 = 1 Hz β
Frequency Division Table¶
| Number of Flip-Flops | Division Factor | Output Frequency |
|---|---|---|
| 1 | 2 | f/2 |
| 2 | 4 | f/4 |
| 3 | 8 | f/8 |
| 4 | 16 | f/16 |
| n | 2^n | f/2^n |
Part 3: Cascading Counters for Multi-Digit Display¶
To display two digits (00-99), we need to cascade two counters.
Concept¶
βββββββββββββββββββββββ
β Units Counter β (counts 0-9)
Clock βββ€ (Mod-10, 74LS90) ββ Q0-Q3 βββΆ 7447 βββΆ 7-seg
βββββββββββββββββββββββ
β Q3 (carry)
β (triggers at 9β0)
βΌ
βββββββββββββββββββββββ
β Tens Counter β (counts 0-9)
β (Mod-10, 74LS90) β
βββββββββββββββββββββββ
Q0-Q3 βββΆ 7447 βββΆ 7-seg
How Cascading Works¶
- Units counter increments on each clock pulse
- When units counter reaches 9 (1001) and receives next clock:
- It resets to 0
- Q3 goes HIGH (carry signal)
- Tens counter increments on this carry signal
- After 99, both counters reset on the next clock
Timing Diagram (Tens and Units)¶
Clock: βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ
β β β β β β β β β β β β β β β β β β β β β
ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ βββ
Units: 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
Tens: 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
Part 4: Connecting Counters to 7-Segment Displays¶
The 7447 BCD-to-7-Segment Decoder¶
The 7447 takes BCD input and produces outputs to drive a 7-segment display.
Pin Connections¶
βββββββββββββββββββββββ
A ββ€ 7 14 ββ VCC
B ββ€ 8 7447 13 ββ LT' (lamp test)
C ββ€ 9 12 ββ RBI' (ripple blanking)
D ββ€ 10 11 ββ BI'/RBO'
βββββββββββββββββββββββ
Input/Output Mapping¶
| Input D | Input C | Input B | Input A | Display |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 0 | 2 |
| 0 | 0 | 1 | 1 | 3 |
| 0 | 1 | 0 | 0 | 4 |
| 0 | 1 | 0 | 1 | 5 |
| 0 | 1 | 1 | 0 | 6 |
| 0 | 1 | 1 | 1 | 7 |
| 1 | 0 | 0 | 0 | 8 |
| 1 | 0 | 0 | 1 | 9 |
Complete Display Circuit¶
Counter βββΆ 7447 βββΆ Resistor βββΆ 7-Segment Display
(BCD) Decoder (330Ξ©) (Common Anode)
ββββββββββββ
Counter ββ€ A aββ 330Ξ© βββΆ a segment
BCD β€ B bββ 330Ξ© βββΆ b segment
Output β€ C cββ 330Ξ© βββΆ c segment
β€ D dββ 330Ξ© βββΆ d segment
β€ eββ 330Ξ© βββΆ e segment
β fββ 330Ξ© βββΆ f segment
β gββ 330Ξ© βββΆ g segment
ββββββββββββ
Key insight: The 7447 is designed for common anode displays. Its outputs are active LOW (sink current to light segments).
Part 5: Designing the Now Serving Display¶
A "Now Serving" display shows the next number in a queue. This is essentially a counter with display output.
Design Requirements¶
- Counter that increments when a ticket button is pressed
- Display showing current number (00-99)
- Reset button to return to 00
Block Diagram¶
βββββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββββββββ
β Ticket β β 74LS90 β β 74LS90 β β 7447 x2 β
β Button ββββββ€ββββΆβ Units βββββΆβ Tens βββββΆβ Decoders β
β β β Counter β β Counter β β β
β Reset β ββββββββββββ ββββββββββββ βββββββββ¬βββββββββ
β Button ββββββ€βββββββββββ (async clear) β
βββββββββββββββ β
βΌ
7-Segment x2
Implementation Steps¶
- Wire two 74LS90 counters cascaded together
- Connect two 7447 decoders to counter outputs
- Wire two 7-segment displays (common anode)
- Add current limiting resistors (330Ξ©) on each segment
- Add ticket button to clock input (with debounce circuit)
- Add reset button to clear inputs
Debounce Circuit¶
Mechanical buttons "bounce" when pressed, causing multiple counts. Use a debounce circuit:
Part 6: Mod-12 Counter (12-Hour Clock)¶
Digital clocks that display 12-hour format need a mod-12 counter for hours.
Design Requirements¶
- Count from 1 to 12
- Reset to 1 after 12
Binary States for Hours¶
| Hour | Q3 | Q2 | Q1 | Q0 | Decimal |
|---|---|---|---|---|---|
| 1 | 0 | 0 | 0 | 1 | 1 |
| 2 | 0 | 0 | 1 | 0 | 2 |
| 3 | 0 | 0 | 1 | 1 | 3 |
| 4 | 0 | 1 | 0 | 0 | 4 |
| 5 | 0 | 1 | 0 | 1 | 5 |
| 6 | 0 | 1 | 1 | 0 | 6 |
| 7 | 0 | 1 | 1 | 1 | 7 |
| 8 | 1 | 0 | 0 | 0 | 8 |
| 9 | 1 | 0 | 0 | 1 | 9 |
| 10 | 1 | 0 | 1 | 0 | 10 (1010) |
| 11 | 1 | 0 | 1 | 1 | 11 (1011) |
| 12 | 1 | 1 | 0 | 0 | 12 (1100) |
| 13 | β | β | β | β | Reset to 1 |
Reset Logic¶
We need to reset when count = 13 (1101). But we want to display 12 (1100), not 13.
Actually, the better approach is: - Count 1-12 - Detect count 13 β reset to 1
Count 13 = 1101 (Q3=1, Q2=1, Q0=1, Q1=0)
Reset logic: Q3 AND Q2 AND Q1' AND Q0
Q3 βββββ
ββ NAND βββΆ CLR
Q2 βββββ€ (inverted Q1)
β
Q1' ββββββββββ€
β
Q0 ββββββ
But this is complex. Simpler: Reset on 13 (or beyond).
Alternative: Use Mod-13 Counter, Add Logic to Show 12¶
- Counter goes 0-12
- At count 12: show "12"
- At next clock: reset to 0 and display "1"
This is simpler!
Key insight: 12-hour clock counters are tricky because they don't start at 0. Consider using a Mod-13 counter and adding offset logic to display 1-12.
Practice Problem β Design a Mod-12 Counter¶
Design a counter that counts 1, 2, 3, ... 11, 12, then resets to 1.
- How many flip-flops are needed?
- What is the reset condition?
- Draw the reset logic.
Show Solution
1. Need 4 flip-flops (to represent 12 = 1100)
2. Counter sequence:
0001 = 1
0010 = 2
0011 = 3
0100 = 4
0101 = 5
0110 = 6
0111 = 7
1000 = 8
1001 = 9
1010 = 10
1011 = 11
1100 = 12
Next β 0001 (reset to 1)
3. Reset condition:
- At 12 (1100), we want to go to 1 (0001)
- Actually, simpler: Count 0-12, reset to 1
Use Mod-13 counter:
- Reset when 1101 (13) is detected
Or: Reset at 13 (1301 in 4+ bits doesn't exist)
Reset = Q3 AND Q2 AND Q1' AND Q0
= Q3 β’ Q2 β’ Q1' β’ Q0
Truth table for reset (13 = 1101):
- Q3 = 1 (at 8-15)
- Q2 = 1 (at 12-15)
- Q1 = 0 (at 8-11... but wait, 12=1100 has Q1=0!)
- Q0 = 1 (odd numbers)
Hmm, 13 (1101): Q3=1, Q2=1, Q1=0, Q0=1
Reset condition: Q3 AND Q2 AND NOT Q1 AND Q0
Part 7: Advanced Now Serving Features¶
Optional Enhancements¶
- Multiple Digits β Add more counters for 3-digit (000-999)
- Auto-Increment β Timer that automatically advances number
- Multiple Displays β Show "Now Serving" and "Next"
- Sound β Beep when number changes
Auto-Increment Circuit¶
Use a 555 timer or crystal oscillator for clock source.
Part 8: Complete Circuit Example¶
Parts List¶
| Part | Quantity | Purpose |
|---|---|---|
| 74LS90 | 2 | Counters (units and tens) |
| 7447 | 2 | BCD to 7-segment decoders |
| 7-segment display | 2 | LED displays (common anode) |
| 330Ξ© resistor | 14 | Current limiting |
| Push button (N.O.) | 1 | Ticket increment |
| Push button (N.C.) | 1 | Reset |
Circuit Diagram (Simplified)¶
Ticket Button
β
ββββΆ Clock (74LS90 #1)
Reset Button
β
ββββΆ R0(1), R0(2) on both counters
74LS90 #1: Q0,Q1,Q2,Q3 βββΆ 7447 #1 βββΆ 7-seg (units)
(Units) β Q3'
β
ββββΆ Clock (74LS90 #2)
74LS90 #2: Q0,Q1,Q2,Q3 βββΆ 7447 #2 βββΆ 7-seg (tens)
(Tens)
Summary¶
Key takeaways from this lesson:
- Counters have many real-world uses: clocks, event counting, frequency division
- Cascading counters extends their range (two mod-10 = 00-99)
- 7447 decoder converts BCD to 7-segment signals
- Mod-12 counter is needed for 12-hour clock hours display
- Now Serving displays combine counters, decoders, and displays
Key Reminders¶
- Use current-limiting resistors (330Ξ©) for each segment
- Counters cascade via the MSB (most significant bit) output
- 7447 outputs are active LOW for common anode displays
- Mechanical buttons need debouncing to prevent false counts
- Consider starting conditions when designing counters for clocks
π Design Challenge β Now Serving Display Project¶
Build a complete Now Serving Display:
| Component | Description |
|---|---|
| Display | Two 7-segment digits (00-99) |
| Input | Push button to increment |
| Reset | Push button to clear to 00 |
| Documentation | Truth table, circuit diagram |
Custom activity β adapted from PLTW Digital Electronics