24-Hour Digital Clock in Logisim-evolution: Mod-60, Mod-24, and Display Guide
Direct Answer: Building a 24-Hour Digital Clock in Logisim-evolution
A 24-hour Digital Clock in Logisim-evolution cascades six synchronous BCD counter digits driven by a shared 1 Hz master clock: a Mod-60 Seconds stage (Mod-10 units 0–9 enabling Mod-6 tens 0–5), a Mod-60 Minutes stage enabled strictly when seconds reach 59, and a Mod-24 Hours stage (00–23) enabled when MM:SS == 59:59 and synchronously cleared back to 00 at 23:59:59. Each 4-bit BCD digit connects to a Hex Digit Display (or 7-segment decoder) for an accurate HH:MM:SS readout.
Recommended Hardware Kits for Physical Digital Clock Assembly
Once your 24-hour clock verifies cleanly in Logisim-evolution, you can assemble it on a breadboard using 74LS90/74LS160 decade counters or synthesize it onto an FPGA using a 100 MHz-to-1 Hz frequency divider:
Elegoo Electronics Component Starter Kit
Includes 4-digit 7-segment displays, 555 clock timers, tactile set-time pushbuttons, 220Ω resistors, and 830-point breadboards.
Digilent Basys 3 Artix-7 FPGA
Divide the onboard 100 MHz crystal oscillator by 100,000,000 to generate a rock-solid 1 Hz pulse and multiplex HH:MM or MM:SS across the four onboard 7-segment digits.
Six Digit BCD Counter Modulus and Carry-Enable Architecture
Every digit in a digital clock shares the identical 1 Hz clock signal; higher digits advance only when all lower digits simultaneously reach their terminal count:
| Digit Stage | Modulus / Range | Count Enable Equation | Synchronous Rollover / Clear |
|---|---|---|---|
Seconds Units (S_U) |
Mod-10 (0–9) |
Constant 1 (ticks every 1 Hz) |
Wraps 9 → 0 (Max Value = 0x9) |
Seconds Tens (S_T) |
Mod-6 (0–5) |
S_U == 9 |
Wraps 5 → 0 (Max Value = 0x5) |
Minutes Units (M_U) |
Mod-10 (0–9) |
(S_T == 5) & (S_U == 9) |
Wraps 9 → 0 |
Minutes Tens (M_T) |
Mod-6 (0–5) |
(M_U == 9) & Sec_Carry |
Wraps 5 → 0 |
Hours Units (H_U) |
Mod-10 (or 0–3 at 2x) |
(M_T == 5) & (M_U == 9) & Sec_Carry |
Resets to 0 on 9 OR when H_T == 2 & H_U == 3 & Min_Carry |
Hours Tens (H_T) |
Mod-3 (0–2) |
((H_U == 9) | (H_T == 2 & H_U == 3)) & Min_Carry |
Resets to 0 when H_T == 2 & H_U == 3 & Min_Carry |
Four Stage Digital Clock Assembly in Logisim
Phase 1: Build a Reusable Mod-60 Subcircuit
Create a subcircuit named Mod60_Counter with inputs CLK, EN, CLR and outputs Tens[3:0], Units[3:0], Carry_Out. Inside, place two 4-bit Counters: set Units Maximum Value to 0x9 and Tens Maximum Value to 0x5. Connect Units.carry & EN to Tens’ count pin, and wire Units.carry & Tens.carry & EN to Carry_Out.
Phase 2: Cascade Seconds and Minutes
In main, instantiate two copies of Mod60_Counter (Seconds and Minutes). Tie Seconds EN = 1, and wire Seconds.Carry_Out directly to Minutes.EN while sharing the identical 1 Hz Clock.
Phase 3: Implement the 23:59:59 Rollover for Mod-24 Hours
For Hours, place two 4-bit Counters (H_T max 0x2, H_U max 0x9). Detect Is_23 = (H_T == 2) & (H_U == 3) via Comparators. When Is_23 & Minutes.Carry_Out is true, assert synchronous load = 1, count = 0 with D = 0x0 on both Hour counters so 23:59:59 rolls cleanly to 00:00:00.
Phase 4: Add Six 7-Segment Displays and Manual Set Controls
Attach six Hex Digit Displays (or BCD-to-7-Segment decoders) arranged as HH : MM : SS, using blinking LEDs driven by the 1 Hz clock as colon separators. Add Set_Min and Set_Hr pushbuttons ORed into the Minutes and Hours enable lines for rapid testing.
Frequent Traps in Logisim Digital Clock Design
Trap 1: Asynchronous Reset at 24 Skips 23 or Flashes 24
Problem: Using asynchronous clr on 24:00:00 creates a brief glitch state; clearing at 23 skips hour 23 entirely.
The Fix: Use synchronous parallel-load zeroing triggered by (H == 23) & Min_Carry.
Trap 2: Minutes Incrementing Every Second During 59
Problem: Wiring only S_T == 5 to Minutes enable causes Minutes to increment 10 times (at 50, 51, 52…59).
The Fix: Enable Minutes strictly on (S_T == 5) & (S_U == 9).
Trap 3: Built-In Counter Counting Downward
Problem: Wiring your enable signal to count while leaving load tied to 0 makes the clock count backward (9, 8, 7…).
The Fix: In Logisim’s Counter, tie load = 1 (or leave it unconnected) during normal upward counting.
Trap 4: Waiting 24 Real Hours to Verify Midnight Rollover
Problem: Testing at 1 Hz takes 86,400 seconds to verify midnight.
The Fix: Temporarily set Simulate → Tick Frequency to 4096 Hz (or use Set_Hr/Set_Min) to verify 23:59:59 → 00:00:00 in seconds.
Curriculum Progression from Digital Clocks to Hardware Systems
Frequently Asked Questions About Logisim Digital Clocks
How do I set Logisim’s Clock to exactly 1 Hz?
Go to Simulate → Tick Frequency, select 1 Hz, and toggle Simulate → Ticks Enabled (Ctrl+K).
How do I convert this 24-hour clock into a 12-hour AM/PM clock?
Instead of resetting Hours to 00 at 23:59:59, reset Hours to 01 when Hours == 12 and toggle a single T Flip-Flop (AM/PM LED) every time 11:59:59 → 12:00:00 occurs.
How can I add an Alarm Clock buzzer?
Store target Alarm Hours and Minutes in four 4-bit Registers and wire four Comparators checking Current_Time == Alarm_Time to light an Alarm LED or drive a Buzzer component.
How do I build a 1 Hz divider from a 100 MHz FPGA clock?
Use a 27-bit synchronous Counter set to Maximum Value = 99,999,999 (0x5F5E0FF); its terminal carry output pulses high for 10ns exactly once per second.
