# 12 Hour Digital Clock AM/PM LED Indicator

Discussion in 'Homework Help' started by nephelem, Mar 27, 2016.

1. ### nephelem Thread Starter New Member

Jan 24, 2016
22
0
I have built this schematic 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

2. ### DickCappels Moderator

Aug 21, 2008
2,777
674
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.

3. ### crutschow Expert

Mar 14, 2008
13,505
3,379
Unless it's an alarm clock, why do you want an AM/PM indication?

4. ### nephelem Thread Starter New Member

Jan 24, 2016
22
0
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.

5. ### nephelem Thread Starter New Member

Jan 24, 2016
22
0
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.

6. ### DickCappels Moderator

Aug 21, 2008
2,777
674
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.

7. ### AnalogKid Distinguished Member

Aug 1, 2013
4,702
1,300
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

8. ### GopherT AAC Fanatic!

Nov 23, 2012
6,321
4,046
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.

DickCappels likes this.
9. ### Art Distinguished Member

Sep 10, 2007
797
61
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.

10. ### GopherT AAC Fanatic!

Nov 23, 2012
6,321
4,046
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?

11. ### marcf Member

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

Mar 14, 2008
13,505
3,379
What??

13. ### marcf Member

Dec 29, 2014
149
20
There is a great book you should read. ZERO "The biography of a dangerous idea" by Charles Seife.

14. ### GopherT AAC Fanatic!

Nov 23, 2012
6,321
4,046
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.

15. ### marcf Member

Dec 29, 2014
149
20
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.