# What is wrong with my counter?

Discussion in 'Homework Help' started by stormturk, May 10, 2009.

1. ### stormturk Thread Starter New Member

May 10, 2009
8
0
SOLVED:
The Solution

Hello everyone,
I am trying to build a counter to count from 0000 to 1111
And I connected it to a 7 Segment LED.
I couldnt see the result though, I wonder what I did wrong.

Here is the Multimedia Logic Design:
Code ( (Unknown Language)):
1. http://www.speedyshare.com/345699215.html
Cheers

Last edited: May 11, 2009
2. ### steinar96 Active Member

Apr 18, 2009
239
4
I assume you are going for a synchronous binary counter. In that case a flip flop is complemented when all the bits in the lower significant positions are equal to 1.

As i remember seeing the circuit setup you are missing an AND gate in the beginning, which is setup just like the others. The count enable is connected to the j and k pins of the first flip flop but it should also be connected to an AND gate who's other input is Q of the first flop.
The output of this gate is connected to the jk pins of the next flip flop (nr 2).
The rest of the circuit is alright by the looks of it.

3. ### stormturk Thread Starter New Member

May 10, 2009
8
0

well, first of all, thanks for the answer
I fixed the circuit as you told, if I didn't misunderstand
and I simulated it, this is the result, nothing changes.
I am not sure, but should there be a serial input or shifting or sth like that?
All I wanna do is to take this output from the led:
0 -> 1 -> 2 -> 3 -> 4............ -> 9 -> A -> B -> ........ -> E -> F
But it looks broken and nothing changes... I google 3-4 bit counters, my circuit looks ok. Something is missing... but still coulnd't solve..

4. ### steinar96 Active Member

Apr 18, 2009
239
4
The output of the first AND gate should also be connected to the input of the second AND gate, just as the later gates. I forgot to mention that earlier

Mar 6, 2009
5,448
782
6. ### stormturk Thread Starter New Member

May 10, 2009
8
0
steinar, I guess you meant like this:

Nothing changes at the result...

Last edited: May 10, 2009
7. ### stormturk Thread Starter New Member

May 10, 2009
8
0
t_n_k, it was my first design but it didn't work...

8. ### steinar96 Active Member

Apr 18, 2009
239
4
I just looked up the design in a book i have, and it shown exactly as your last correction of the circuit besides 1 small proplem which is that the output of the last AND gate is connected to the Q of flip-flop nr 2 in the schematic (see the dot where the output of the last AND gate crosses Q2).

So if all the connections are ok. The circuit should work in reality. If it doesnt work after correcting this then there might be a proplem with the simulation. Make sure all the connections in the simulation are complete, for example if you take a look at the Q output of flip flop 3. You'll see that the wire to the input of the second AND gate is connected to the pin in a manner that might not "complete the circuit". It's positioned so that it touches the Q pin but still is behind the "connection" dot.

I'm not familiar with the simulation so it might not matter, but this circuit should work after you fix the last proplem.

Last edited: May 10, 2009
9. ### stormturk Thread Starter New Member

May 10, 2009
8
0
well, I been searching many resources, it seems my circuit is true, I even tried with 3 flip flops for 3 bit counter, it didn't work. I think something wrong about the program, thank you all for your help..

10. ### JoeJester AAC Fanatic!

Apr 26, 2005
3,373
1,157
There is nothing wrong with your circuit. I replaced the hex display with four LEDs and it works just fine.

What clock frequency did you use?

11. ### stormturk Thread Starter New Member

May 10, 2009
8
0
well I replaced with leds too, it didn't work. I set the frequency to 20, then tried 1, 5, 10 maybe 100. maybe it's about multimedia logic. which simulator are you using?

12. ### stormturk Thread Starter New Member

May 10, 2009
8
0
Solved finally. All I had to do is to add preset and clear lines to flip-flops. There it goes: works like a charm.

13. ### JoeJester AAC Fanatic!

Apr 26, 2005
3,373
1,157
Your original diagram didn't have presets and clears on the J/K ff's. You changed the models which changed the rules.

I'm using TINA. My J/K ff's had presets and clear so I had to deal with those pins.

File size:
8 KB
Views:
19
14. ### stormturk Thread Starter New Member

May 10, 2009
8
0
you are right, ff's needed to be set, but I couldnt understand the sense, that's why I tried to make work the other one. Well, I still don't know but will try to learn, thanks for your help.