4 bit sync counter

Thread Starter

hawk360

Joined Jun 9, 2013
28
See I'hv considered this:
1st of all let the let the flip flops be named from left to right in this order:
Fa->Fb->Fc->Fd

so what i hv considered is the o/p from
1st flip flop will be A and A(bar)...
frm 2nd B n B(bar),
3rd C n C(bar) ,
4th D and D(bar).

and J3, K3 are i/p to my 1st flip flop i.e Fa,
J2, K2 are i/p to my 2nd ff Fb
J1, K1 are i/p to my 3rd ff Fc
J0,K0 are i/p to my 4th ff Fd

srry once again...i shud hv mentioned my conventions in the beginnings...
 

tshuck

Joined Oct 18, 2012
3,534
See I'hv considered this:
1st of all let the let the flip flops be named from left to right in this order:
Fa->Fb->Fc->Fd

so what i hv considered is the o/p from
1st flip flop will be A and A(bar)...
frm 2nd B n B(bar),
3rd C n C(bar) ,
4th D and D(bar).

and J3, K3 are i/p to my 1st flip flop i.e Fa,
J2, K2 are i/p to my 2nd ff Fb
J1, K1 are i/p to my 3rd ff Fc
J0,K0 are i/p to my 4th ff Fd

srry once again...i shud hv mentioned my conventions in the beginnings...
Then you will need to redo your K-maps. As they are, you have A & B on the top of the K-map which, provided you are doing it the typical way, means A & b are your LSBs. I'd suggest redoing your K-maps with each table entry defined along the edges.

Like this:
AB\CD|00 | 01| 11|10
00| | | |
01| | | |
11| | | |
10| | | |
 

tshuck

Joined Oct 18, 2012
3,534
I don't see how you got the following:
K_B = D
K_C = D
I solved the K-maps using the notation I gave in the previous post, where A is the MSB in ABCD.

I use Q_n notation, so I may have switched it around, but a quick run-through again and a working circuit suggests it should be right...
 

LDC3

Joined Apr 27, 2013
924
I solved the K-maps using the notation I gave in the previous post, where A is the MSB in ABCD.

I use Q_n notation, so I may have switched it around, but a quick run-through again and a working circuit suggests it should be right...
The reason I asked is that I was looking at his circuit. It has a connection from D to K_A (also from B). For B, he has connections to K_A, K_B, and K_C.
If your analysis of the connections are only what is needed, his circuit needs a major change.
 

Thread Starter

hawk360

Joined Jun 9, 2013
28
Then you will need to redo your K-maps. As they are, you have A & B on the top of the K-map which, provided you are doing it the typical way, means A & b are your LSBs. I'd suggest redoing your K-maps with each table entry defined along the edges.

Like this:
AB\CD|00 | 01| 11|10
00| | | |
01| | | |
11| | | |
10| | | |
It doesn't make any difference either u numbered K map in vertical fashion or as in my case in horizontal way!
U get same expression either way!
and according to my convention A,B forms MSBs...where as C,D are LSBs.
 

tshuck

Joined Oct 18, 2012
3,534
It doesn't make any difference either u numbered K map in vertical fashion or as in my case in horizontal way!
U get same expression either way!
and according to my convention A,B forms MSBs...where as C,D are LSBs.
Well, your method may make sense to you, but it isn't standard and you've neglected to label any of your K-maps.... how do you expect anyone to follow what you are doing?
 

Thread Starter

hawk360

Joined Jun 9, 2013
28
Well, your method may make sense to you, but it isn't standard and you've neglected to label any of your K-maps.... how do you expect anyone to follow what you are doing?
I'hv neglected the label bcoz initially i just intended to solve this for me...i had no intention of putting it on web...but since i wasn't able to implement it...i posted it here...thats the reason for my sloppy notation!

but this is not the reason why this ckt is not working as required!

I'hv attached a sample of my k-map.....take a look!
 

Attachments

Last edited:

Thread Starter

hawk360

Joined Jun 9, 2013
28
hmm....nyway what could be the prob wid this ckt?? i tried googling this too, but to mah surprise i didn't got any relevant ckt! seemed quite strange to me, given its a simple prob...i too personally had solved many ques like this theory but stuck badly when it comes to implementing this on MS...could it be a possibility that in some way or other its because of some fault in MS itself??
 

WBahn

Joined Mar 31, 2012
30,075
hmm....nyway what could be the prob wid this ckt??
Short answer, that your sloppiness is leading you to make a mistake that you are having a hard time seeing because of that same sloppiness.

i tried googling this too, but to mah surprise i didn't got any relevant ckt! seemed quite strange to me, given its a simple prob
Certainly doesn't seem strange to me that you couldn't find a circuit that cycles through a specific set of five non-sequential 4-bit values. Despite what it seems at time, you can't literally find "anything" on the internet!

...i too personally had solved many ques like this theory but stuck badly when it comes to implementing this on MS...
I suspect that the root of the problem is that you are not being clear, clean, and systematic in your approach. Communicate with yourself the same way you would want someone to communicate the same things to you.

could it be a possibility that in some way or other its because of some fault in MS itself??
Yes, it is "possible" that the fault is in MS itself. I would be willing to bet a month's income that it is not. I'd actually like to bet a year's income, but I tend to make such claims only to the degree that I would really be willing to do something and I really would be willing to place a month's income at risk on this one, while it would be irresponsible of me to actually place a year's income at risk, no matter how confident I might be that the fault is NOT in MS.

This is a natural reaction that most people have at different times -- MY work seems right to ME, so it must be the tool that is wrong. With experience (and more than a few humbling experiences) you will develop the opposite attitude -- MY work MUST have an error, because the tool CAN'T be wrong. Far, far more often than not this latter attitude is correct -- and on the very rare occasion when it isn't you get REALLY annoyed.
 

WBahn

Joined Mar 31, 2012
30,075
Hopefully you are getting the notion that it pays to be clear with your work, especially when communicating anything about it to anyone else. I would also claim that it pays to be just as clear when communicating with yourself. So how might you have presented this a bit more clearly so that pages of responses wouldn't have been needed to get to where you are now?

How about something along the lines of the following, in which I will pick a different set of states so as not to simply work your problem for you.

I am trying to implement a synchronous counter using JK flip flops in MultiSim that cycles through the following set of five states:

0110->1100->0101->1011->0000->0110.....

Let's call the bits in the above sequence ABCD.

My state transition table is as follows:

ABCD:
AB\CD|00|01|11|10
00|0110|x|x|x
01|x|1011|x|1100
11|0101|x|x|x
10|x|x|0000|x

So I've got four JK flip flops (and, yes, it could be done using just three, but we have to use four for some reason that wasn't explained to us).

The transition logic for a JK flip flop is as follows:

J|K|Qn+1
0|0|Qn
0|1|0
1|0|1
1|1|Qn'

This means that, given Qn and Qn+1, my JK inputs need to be:

Qn|Qn+1|JK
0|0|0x
0|1|1x
1|0|x1
1|1|x0

In the following table, I show Qn followed by Qn+1 as a function of the state ABCD.

QnQn+1 for FF A:
AB\CD|00|01|11|10
00|00|x|x|x
01|x|01|x|01
11|10|x|x|x
10|x|x|10|x

These can be mapped directly to JK input values:

JK for FF A:
AB\CD|00|01|11|10
00|0x|x|x|x
01|x|1x|x|1x
11|x1|x|x|x
10|x|x|x1|x

To make optimization easier, these are split out into a K-map for JA and one for KA.

JA:
AB\CD|00|01|11|10
00|0|x|x|x
01|x|1|x|1
11|x|x|x|x
10|x|x|x|x

So JA = B

KA:
AB\CD|00|01|11|10
00|x|x|x|x
01|x|x|x|x
11|1|x|x|x
10|x|x|1|x

So KA = A

And then continue on for the other three FFs.

Notice that I didn't require the reader to go look up how a JKFF behaves (which is not something most people have memorized if they haven't worked with a JKFF for any length of time). This not only makes it easier for the person reading your work to understand it (and note that this falls under the general category of the proper care and feeding of homework graders), but it is always possible that the problem is that YOU didn't remember the transition rules correctly. If that is the case, then it can be spotted very easily instead of remaining this hidden miscommunication for quite some time before it is finally teased out.
 

Thread Starter

hawk360

Joined Jun 9, 2013
28
Yes, it is "possible" that the fault is in MS itself. I would be willing to bet a month's income that it is not. I'd actually like to bet a year's income, but I tend to make such claims only to the degree that I would really be willing to do something and I really would be willing to place a month's income at risk on this one, while it would be irresponsible of me to actually place a year's income at risk, no matter how confident I might be that the fault is NOT in MS.

This is a natural reaction that most people have at different times -- MY work seems right to ME, so it must be the tool that is wrong. With experience (and more than a few humbling experiences) you will develop the opposite attitude -- MY work MUST have an error, because the tool CAN'T be wrong. Far, far more often than not this latter attitude is correct -- and on the very rare occasion when it isn't you get REALLY annoyed.
I completely agree wid u on points other than this...:p....what u said abt notations is damn true...i know i was sloppy in mah wrk bt a reason for it was which i had already mentioned earlier that thi swrk was not originally intended to be posted on web!
but coming to mah point...there are faults in ms...there are some corner cases where bst of d tools fails...but ms on other hand seems to fail even for normal i/ps...as an example i'm attaching a ckt.

I'hv designed a mos inverter in ms...fairly simple ckt!...but ms seems to fail to implement this.

the prob is instead of giving an o/p of zero (when i/p is 1)...it seems to give a o/p of ~4.7-4.8 v. if u connect an oscilloscope u'll come to know this...i had used virtual mos for it so that i could vary the L/W ratios...here is the circuit for u!
 

Attachments

tshuck

Joined Oct 18, 2012
3,534
well i think i got mah mistake...u're right tshuck ....let me do this thing frm d very beginning....
Without seeing your current solution, it is impossible to see what your current mistake might be. While redoing the problem may fix an error, you could also make another elsewhere. There have been times I have spent a long while looking at a problem, doing it over and over, only to realize I had swapped two values in the beginning of the problem, making all my subsequent work frivolous, save for the experience of understanding how to solve the problem. I used to cut corners in my representation, much like you are now, only to never find my mistake, even after redoing the problem for the correct answer. Even if this is for yourself, write out your steps and label things accordingly, because what makes sense today may not tomorrow.

I might suggest that you come to the realization that just because you've done something over doesn't man you've done it right ever. If your circuit it's not working, as WBahn suggested, it is most likely your fault. I do not believe a program with such a huge user base would have such a simple logic error.

I have successfully implemented this using a free, open-source software called LogiSim, a simple simulator for digital circuits. If you feel that your current simulator may have a problem, try this one...
EDIT: Here's a link:
http://ozark.hendrix.edu/~burch/logisim/
 
Last edited:
Top