Up/Down D Flipflop decade counter

Thread Starter

lullabelle80

Joined Mar 3, 2025
9
I posted this previously I think in the wrong category so reposting here as its actually homework. Hi, I am trying to make the circuit for this, I have done the state table, k maps and the MSP equations, I also have a rough idea of how to go about building it and have make a working up/down counter circuit but I am struggling to make it stop at 9. I thought the MSPs might help me but I am now stuck. Here is everything I have so far if anyone can help me figure out where I am going wrong. . . . Also there could be mistakes in the K-maps or MSP's because I'm new to this. Any help would be greatly appreciated :)Screenshot 2025-03-04 143417.pngScreenshot 2025-03-04 143425.pngScreenshot 2025-03-04 143448.pngScreenshot 2025-03-04 143538.png
 

Thread Starter

lullabelle80

Joined Mar 3, 2025
9
Welcome to AAC!
It appears that your original post was deleted.
Didn't check your truth table, but you have non-optimal groupings.
View attachment 343733
There's also a labeling error for Q0.
Thanks! ... I did think about making bigger groups there but then will I now just be disregarding the who cares anyway when it comes to doing the equations?
 

MrChips

Joined Oct 2, 2009
34,628
There are 5 input variables for this Karnaugh mapping problem, D3, D2, D1, D0, and UP.
In order to draw a 5-variable map, you can draw two 4-variable maps side by side.
 

Thread Starter

lullabelle80

Joined Mar 3, 2025
9
Is there anywhere you can recommend I can look up examples of this type of K-Map? We have only practiced with up to 4 variable input and I have no idea what MSB means.
Actuslly I’ve just been thinking about this, does that mean most significant bit? So like my Q3 then at the top will be Q2 Q1 Q 0?
 

dl324

Joined Mar 30, 2015
18,220
Is there anywhere you can recommend I can look up examples of this type of K-Map?
I don't think any schools teach that method anymore.

You can try using this page on this site.

Unfortunately, it uses the "A is always MSB" instead of "A is always LSB" approach. This is backwards from the way the experts from the 1960's/70's did it.
We have only practiced with up to 4 variable input
You can use 2 4 variable maps
I have no idea what MSB means
Most Significant Bit.
 

Thread Starter

lullabelle80

Joined Mar 3, 2025
9
I don't think any schools teach that method anymore.

You can try using this page on this site.

Unfortunately, it uses the "A is always MSB" instead of "A is always LSB" approach. This is backwards from the way the experts from the 1960's/70's did it.
You can use 2 4 variable maps
Most Significant Bit.
Great thanks
 

MrChips

Joined Oct 2, 2009
34,628
There are different styles for drawing Karnaugh maps. They all produce the same results.
I prefer to use the letters DCBA to represent a 4-bit binary sequence, where D represents D3 (MSB) and A is D0 (LSB).
It will make the boolean equations easier to follow.

As an example, I like to draw Karnaugh maps with the following notation:

1741119607458.png

For a 5-variable problem, draw two 4-variable maps beside each other, one for UP = 0 and another for UP = 1.

See this thread:
https://forum.allaboutcircuits.com/threads/up-down-decade-counter-using-d-flipflop.58572/
 

Thread Starter

lullabelle80

Joined Mar 3, 2025
9
IMG_0743.jpeg
Ok so just before I go filling all of these in, I’ve filled in the 4 next state outputs from my table which are 1’s - am I doing this correctly? Do they seem in the right places? Thanks again
 

WBahn

Joined Mar 31, 2012
32,703
I posted this previously I think in the wrong category so reposting here as its actually homework. Hi, I am trying to make the circuit for this, I have done the state table, k maps and the MSP equations, I also have a rough idea of how to go about building it and have make a working up/down counter circuit but I am struggling to make it stop at 9. I thought the MSPs might help me but I am now stuck. Here is everything I have so far if anyone can help me figure out where I am going wrong. . . . Also there could be mistakes in the K-maps or MSP's because I'm new to this. Any help would be greatly appreciated :)View attachment 343727View attachment 343728View attachment 343729View attachment 343730
You have an error, or at the very least an inconsistency, in your state table. In the UP direction, when the counter is in state 1001, you have the next state being 0000. This indicates that the counter should rollover, which is what would normally be expected.

But in the DOWN direction, when the counter gets to 0000 (at the bottom), you have it go to 0001, which means that you want it to bounce and start counting up. Also, you have 0000 in your table twice, but in the first row the next state is 1001, and in the last row it is 0001, so just knowing the count value and the status of Up/Dn is insufficient to determine the next state.

The bigger lesson is that you should avoid redundant rows in these types of tables, as it risks these kinds of inconsistencies. This is known as being "overdetermined" -- it's like having three equations and only two unknowns.

A much bigger problem in your design is that you are implementing this as an asynchronous counter, but your entire design approach is only safe for a synchronous design. You are completely ignoring things like static timing hazards that will result in glitches in your clock signals, which will lead to very unreliable and erratic behavior in a real circuit (you may or may not see them in a simulator, particularly a digital/logic simulator).
 

WBahn

Joined Mar 31, 2012
32,703
I don't think any schools teach that method anymore.
I'm not sure what the current curriculum looks like at a typical school, but where I was at still taught up to six-variable K-maps at least as of about a decade ago.

More troubling is how many of the younger faculty members have no awareness of the fundamental differences between synchronous and asynchronous circuits and the impacts of glitches on clock lines. Mention the phrase "consensus term" in the context of a K-map and you just get a puzzled expression. So it's not surprising that the next generation of engineers are even less prepared.
 
Top