Mode 20 binary counter

Thread Starter

Saidur69

Joined Feb 12, 2017
7
Hi every one. new to this site and was in need of some help regarding a project that i have.
my counter consists of 20 states which are (0,1,2,3,4,5,6,7,11,12,13,15,16,19,22,23,24,26,27,31). the first step was to design a state graph and then a state table. once achieved the task was to design the circuit using D flip flops. since i have 32 variables i used a 5x5 karnaugh map. however once i obtained the circuit the timing graph does not work.
any ideas where i could be going wrong
Thank you
Saidur Rahman
 

Thread Starter

Saidur69

Joined Feb 12, 2017
7
How do you upload an image its says error when i try uploading a file

Yes it is more or less my homework. i understand you can not help too much and i just need a little guidance.
i have attached a copy of my state table and Kmaps.
i have 5 Kmaps A+ B+ C+ D+ E+. just not sure as i have never used a 32 variables Kmap before
thank you
Saidur Rahman
 

Papabravo

Joined Feb 24, 2006
22,065
First problem is that five variables are not done with a single 5x5 map. The map is 3-dimensional, but can be represented on paper as a pair of 4x4 maps. To solve the problem you need to wrap your head around the complete 3D structure. If it were me, I wouldn't waste my time with K-maps as a starting point. Since FPGA devices have more than enough resources for a brute force solution I would start with that. Then as a second step apply the K-map.

The three essential design steps:
  1. First make it work
  2. Then optimize it
  3. Then make it elegant
 

Thread Starter

Saidur69

Joined Feb 12, 2017
7
yes that is what i have done. i have 2 pairs of Kmaps for each flip flop A=0 & A=1and under stand how to group between the two
the problem is for the project i must follow the steps which are
state graph
state table
kmap
design with flip flop
test the wave form

just wanting to know if i am following the right steps in order to desing the binary counter
 

dl324

Joined Mar 30, 2015
18,268
First problem is that five variables are not done with a single 5x5 map.
5 variables is generally considered the upper limit for a single kmap. You just need to remember mirroring.
upload_2017-2-12_9-49-26.png
In this kmap, for Z'D, 000, 010, 110, and 100 can be combined (Z'DA')
 
Last edited:

WBahn

Joined Mar 31, 2012
32,756
You haven't given any indication of what condition each row and each column represents, which forces us to guess. Engineering is NOT about guessing.

If the colors represent the groups you have made, then how did you manage to group the green 1 with the green x and nothing else? Why isn't the 1 in the lower left grouped with anything? How can a group have a 0 in it (the bold black group)?
 

WBahn

Joined Mar 31, 2012
32,756
5 variables is generally considered the upper limit for a single kmap. You just need to remember mirroring.
View attachment 120405
In this kmap, for Z'D, 000, 010, 110, and 100 can be combined (Z'DA')
I've never seen this approach. If you are comfortable with this, the I would guess that doing six variables wouldn't be too much more difficult. Since I've never done it this way I have no idea how it stacks up against the "typical" approach of drawing two (for 5 variables) or four (for 6 variables) 4-variable tables and working with a 3-D cube. Naturally, that's the method I'm more comfortable with, and so this way seems awkward. But I can see the potential merit it has. Next time I do 5- or 6- variable tables I'll give it a go.
 

dl324

Joined Mar 30, 2015
18,268
I've never done it this way I have no idea how it stacks up against the "typical" approach of drawing two (for 5 variables)
If you split the map so you have 4x4's with C=0 and C=1 and mirror one side, you'll have 2 stacked 4x4's.

I don't recall ever attempting 6 variables. I'll turn the OP's problem into a 5 bit up/down counter and give it a shot.
 

dl324

Joined Mar 30, 2015
18,268
Next time I do 5- or 6- variable tables I'll give it a go.
Worked with 6 variables. But definitely need to keep track of groupings when there are a bunch of overlapping groups. I don't usually color them unless I expect to show them to someone else. With 6 variables, that isn't optional.
upload_2017-2-13_15-31-50.png
 

WBahn

Joined Mar 31, 2012
32,756
Your K-map does not impose a Gray code encoding from cell to cell. As you go from the center-left to the center-right your CDE values change from 010 to 100, meaning that both C and D change.
 

dl324

Joined Mar 30, 2015
18,268
I have now got this following your design of the 5x5 k map. However still no luck Any idea what I'm doing wrong
It would be better if you solved the Kmaps using a method you're familiar with.

As pointed out, the 5 variable map I used uses a gray code for both axes. You have used the format called overlay. Instead of mirroring about the center, the two halves stack.

What letter is LSB? The convention I use is to give MSB first and LSB last. Most 4 bit counters use A as LSB and D as MSB in datasheets.
 

dl324

Joined Mar 30, 2015
18,268
Can you post your truth table? I don't think it's correct.

EDIT: I take that back. It seems that A is MSB and E is LSB. You're not making optimal groupings, but now I can check the rest of your work...

This is what I get for DA:
upload_2017-2-15_15-30-3.png
I got 5 implicants from my truth table, (mistakenly called them minterms earlier).

EDIT: I should have grouped differently. Correct expression should be AB'+AC'+A'BCD
 
Last edited:

Thread Starter

Saidur69

Joined Feb 12, 2017
7
Can you post your truth table? I don't think it's correct.

EDIT: I take that back. It seems that A is MSB and E is LSB. You're not making optimal groupings, but now I can check the rest of your work...

This is what I get for DA:
View attachment 120629
I got 5 implicants from my truth table, (mistakenly called them minterms earlier).

EDIT: I should have grouped differently. Correct expression should be AB'+AC'+A'BCD
For the grouping of 4 shouldn't it be just A.B
 

Thread Starter

Saidur69

Joined Feb 12, 2017
7
No, it would be ABC', but by increasing the grouping to 8, it becomes AC'.
Yeah I understand now. I have obtained some
New statements now. Just simulated it and have got some movement on the waveform
Will keep you posted on my process
Thank you
Saidur Rahman
 
Top