# Need help with 12h digital clock multisim

#### abo7ijji

Joined Nov 25, 2016
4
Hi
I have made a 12h digital clock in multisim
includes puse button, seconds rest button, hours set button and minutes set button as the teacher asks in HW (see the attachment)
but how can I make a led 12h on 12h off?
and how can I make puse button to control other buttons?

#### MrAl

Joined Jun 17, 2014
8,505
Hello,

Your hours must go from 01 to 12, and after 12 back to 01. That means the tens digit goes from 0 to 1 then back to 0 when the AM/PM flips. That means you can use a flip flop to record this event and use the output of the flip flop to drive the AM/PM LED.
If this flip flop is reset, the Q output will be off so the LED could be off, then when the count goes from 12 to 01 the flip flop Q will go high and turn the LED on, then next time when the count goes from 12 to 01 the flip flop Q will go low again turning the LED off. Thus the LED will flip on or off every 12 hours.
You should be able to figure out how to hook this up.

Your design is not fully shown so we dont know what you are using for the hours count or the tens of hours count already.

Last edited:

#### abo7ijji

Joined Nov 25, 2016
4
Hello,

Your hours must go from 01 to 12, and after 12 back to 01. That means the tens digit goes from 0 to 1 then back to 0 when the AM/PM flips. That means you can use a flip flop to record this event and use the output of the flip flop to drive the AM/PM LED.
If this flip flop is reset, the Q output will be off so the LED could be off, then when the count goes from 12 to 01 the flip flop Q will go high and turn the LED on, then next time when the count goes from 12 to 01 the flip flop Q will go low again turning the LED off. Thus the LED will flip on or off every 12 hours.
You should be able to figure out how to hook this up.

Your design is not fully shown so we dont know what you are using for the hours count or the tens of hours count already.
I used 0-15 counter (74LS93) and some muxs to correct outputs
0000 to 10010 (0) to (12)
0001 to 00001
...
1011 to 10001
then rest at 1100

used first output for tens hours 7segment display and the other four outputs for hours 7segment display

#### abo7ijji

Joined Nov 25, 2016
4
Hello,

Your hours must go from 01 to 12, and after 12 back to 01. That means the tens digit goes from 0 to 1 then back to 0 when the AM/PM flips. That means you can use a flip flop to record this event and use the output of the flip flop to drive the AM/PM LED.
If this flip flop is reset, the Q output will be off so the LED could be off, then when the count goes from 12 to 01 the flip flop Q will go high and turn the LED on, then next time when the count goes from 12 to 01 the flip flop Q will go low again turning the LED off. Thus the LED will flip on or off every 12 hours.
You should be able to figure out how to hook this up.

Your design is not fully shown so we dont know what you are using for the hours count or the tens of hours count already.

#### MrAl

Joined Jun 17, 2014
8,505
Hi,

Ok so your line that goes to U3 the 'A' input, that must be going high for a '1' in the leftmost digit and to a low to display '0' in the leftmost digit. When that line goes from a 1 to a 0 that means the 12 hour clock as overflowed and you should run that line to a negative edge triggered flip flop. The Q (or Q' as needed) can be used to drive an LED possibly with a small driver transistor depending on power.

Do you know what kind of flip flop to use there? It must change states on the negative edge of that 'A' signal coming from U18. You'll also need to reset or set that flip flop when the time is set by the user.
Can you figure out what to do from here?

#### abo7ijji

Joined Nov 25, 2016
4
Hi,

Ok so your line that goes to U3 the 'A' input, that must be going high for a '1' in the leftmost digit and to a low to display '0' in the leftmost digit. When that line goes from a 1 to a 0 that means the 12 hour clock as overflowed and you should run that line to a negative edge triggered flip flop. The Q (or Q' as needed) can be used to drive an LED possibly with a small driver transistor depending on power.

Do you know what kind of flip flop to use there? It must change states on the negative edge of that 'A' signal coming from U18. You'll also need to reset or set that flip flop when the time is set by the user.
Can you figure out what to do from here?
Hi,

T-flip flop? with VCC on T to give Q complement every new signal? is that true?

#### MrAl

Joined Jun 17, 2014
8,505
Hello again,

The T input is the clock input which would be your 'A' from U3. That will cause the Q output to change state every time the clock goes high, but you really need a T input that triggers on the low going edge so that it changes every time the clock goes low.
So you could look for a flip flop with a T input that changes state on the low edge of the clock, and also has preset and clear if you intend to set the clock with a button for am/pm or something like that. If you intend to set the clock with a higher frequency input or just some clock input to the digits to be set, then you can set the am/pm state by just running the count higher until the state changes to what you want it to change to. I dont know what way you want to do it yet.
See what kind of flip flop you can find and try to figure out how to hook it up.

#### djsfantasi

Joined Apr 11, 2010
7,870
Couldn't you just invert the signal, so that the leading edge becomes a trailing edge?

#### MrAl

Joined Jun 17, 2014
8,505
Couldn't you just invert the signal, so that the leading edge becomes a trailing edge?
Hi,

Sure, but then that 'just' requires a free inverter when a FF with a low edge trigger does not.
If there is one available then yes, but if not then another IC package has to be added to the project.

#### djsfantasi

Joined Apr 11, 2010
7,870
Hi,

Sure, but then that 'just' requires a free inverter when a FF with a low edge trigger does not.
If there is one available then yes, but if not then another IC package has to be added to the project.
Yup! Got it...

#### MrAl

Joined Jun 17, 2014
8,505
Yup! Got it...
Hi,

Well it is still a good idea to keep that in mind just in case he has a positive edge T FF on hand and happens to have a free inverter too. That is something that could happen.

#### wala janajreh

Joined Apr 30, 2017
4
Hi
I have made a 12h digital clock in multisim
includes puse button, seconds rest button, hours set button and minutes set button as the teacher asks in HW (see the attachment)
but how can I make a led 12h on 12h off?
and how can I make puse button to control other buttons?

View attachment 115948
View attachment 115949
View attachment 115950
hii,if you still have the solution ,could you send it to me please i have to submit the hw before sunday !!!

#### wala janajreh

Joined Apr 30, 2017
4
Hi,

Well it is still a good idea to keep that in mind just in case he has a positive edge T FF on hand and happens to have a free inverter too. That is something that could happen.
hello,
i have the same Hw ,could please tell me how to design it step by step
i have to submit very soon

Last edited:

#### MrAl

Joined Jun 17, 2014
8,505
hello,
i have the same Hw ,could please tell me how to design it step by step
i have to submit very soon
Hi,

Well that's a lot to ask for in one question

Maybe if you had a specific question about this, but then again this is the homework section where the forum rules here on this site require that you show some of your own personal work/research before anyone should offer direct suggestions. It is believed that students dont learn very well when they are just handed answers and especially not completed designs. You have to realize that would not help you in the long run either because the idea of study is to learn how to do things yourself. If you cant do that, you'll never land a good job in the field anyway so you'll be very sorry later in life.

#### wala janajreh

Joined Apr 30, 2017
4
Hi,

Well that's a lot to ask for in one question

Maybe if you had a specific question about this, but then again this is the homework section where the forum rules here on this site require that you show some of your own personal work/research before anyone should offer direct suggestions. It is believed that students dont learn very well when they are just handed answers and especially not completed designs. You have to realize that would not help you in the long run either because the idea of study is to learn how to do things yourself. If you cant do that, you'll never land a good job in the field anyway so you'll be very sorry later in life.
hi,
actually ive never done sth like that before i always do it by myself (the previousHWs)
but the final exams are about to start and i dont have enough time ,if you could help me with concept i would be thankful

Last edited:

#### MrAl

Joined Jun 17, 2014
8,505
hi,
actually ive never done sth like that before i always do it by myself (the previousHWs)
but the final exams are about to start and i dont have enough time ,if you could help me with concept i would be thankful
Hello,

Well it's a lot to explain though, do you know how to set up counters like decade counters to count from say 0000 to 9999 in BCD? That would be part of the design process if you plan to use discrete logic rather than a microcontroller.

#### wala janajreh

Joined Apr 30, 2017
4
hi