12 Hour Digital Clock AM/PM LED Indicator

Thread Starter

nephelem

Joined Jan 24, 2016
20
I have built this schematic 12 hour digital clock .jpg and now it's working. How can I add 2 LEDs to indicate AM/PM since this is a 12-hour digital clock? Please help me :(

water.png
 

DickCappels

Joined Aug 21, 2008
6,079
This is only an idea but you could makeba circuit that puts out a pulse when the two digits in the hours part of the circuit changes to "12" and use that toggle a flip-flop that drives the AM/PM LED.
 

Thread Starter

nephelem

Joined Jan 24, 2016
20
This is only an idea but you could makeba circuit that puts out a pulse when the two digits in the hours part of the circuit changes to "12" and use that toggle a flip-flop that drives the AM/PM LED.
Yep, that's exactly what's on my mind but I don't know how to build a circuit for that. Tried to search on google but there's no exact or simply closer idea for that circuit.
 

Thread Starter

nephelem

Joined Jan 24, 2016
20
Unless it's an alarm clock, why do you want an AM/PM indication?
Our professor told us to build a 12 hour clock with 2 LEDs for AM/PM indication. We will actually connect some pins on circuit to the corresponding GPIO pins on Altera DE1 Board (Quartus - Cyclone II Device) and program the logic gates used to make it run as how it should be.
 

DickCappels

Joined Aug 21, 2008
6,079
Yep, that's exactly what's on my mind but I don't know how to build a circuit for that. Tried to search on google but there's no exact or simply closer idea for that circuit.
It should not be difficult logic to come up with. Do you know what the BCD patterns corresponding to 1 and 2? It should be an easy circuit, the "2" is only displayed in the hours digit two times. A binary-to-decimal decoder and some AND gates driving a flip-flop could do it.
 
Last edited:

AnalogKid

Joined Aug 1, 2013
8,251
You already have gating to detect certain numbers and reset some counters when they occur. Add more gating to detect the hour 11. That signal goes negative when the clock changes from 11:59 to 12:00, and that edge can clock a toggle flipflop, and the Q and -Q oututs can drive the two LEDs.

ak
 

GopherT

Joined Nov 23, 2012
8,012
It should not be difficult logic to come up with. Do you know what the BCD patterns corresponding to 1 and 2? It should be an easy circuit, the "2" is only displayed in the hours digit two times. A binary-to-decimal decoder and some AND gates driving a flip-flop could do it.
He is using the CD4026 chip (counter to 7-seg driver). There is no accessible BCD. He will need to grab the evidence of a 1 and 2 on the hour display from the 7-segment inputs into glue logic and output that to his flip/flop toggle.
 

Art

Joined Sep 10, 2007
806
If the hour MSD can only be 0 or 1 or have lead zero blanking,
It looks like you only have to look at one segment of the hour MSD with the flip flop input.
 

GopherT

Joined Nov 23, 2012
8,012
If the hour MSD can only be 0 or 1 or have lead zero blanking,
It looks like you only have to look at one segment of the hour MSD with the flip flop input.
Wouldn't that change the am/PM toggle as the clock clicks from 12:59 to 01:00? Am/PM toggles from 11:59 to 12:00.

Or am I misunderstanding?
 

marcf

Joined Dec 29, 2014
257
If our ancestors had not harbored a pathological fear of the number zero, this programming challenge would not be an issue.
 

GopherT

Joined Nov 23, 2012
8,012
There is a great book you should read. ZERO "The biography of a dangerous idea" by Charles Seife.
You might want to read beyond the title as well. It is not about leading zeros or the numeral "0" or the second digit of the number 10. It is about the concept of nothingness or beginning and similar mathematical starting points necessary to use math to solve problems and the representation thereof.
 

marcf

Joined Dec 29, 2014
257
I agree, but it is not to logical to count up to 12 and then go to 1. It makes much more sense to start at 0 and count to 23.
 
Top