Up/down Decade counter using D Flipflop

Thread Starter

fordelon1

Joined Aug 16, 2011
13
Hi..
I do have a question how to do this, it must be a 4bit decade counter.. that counts from 0-99, up and down... and can be reset to 0. All of this using D flip flops
no luck searching the web, all i can see are JKFF and TFF...

please, I need your help designing this...
 

SgtWookie

Joined Jul 17, 2007
22,230
You'll need to build two 4-bit decade counters then; as a 4-bit decade counter can only store a number from 0 to 9.

Here is a Wikipedia entry on flip-flops; the D-type F/F is mentioned:
http://en.wikipedia.org/wiki/Flip-flop_(electronics)

An educational site on D-type f/f's:
http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/dflipflop.html

A 4000-series CMOS D-type flip flop:
http://www.nxp.com/documents/data_sheet/HEF4013B.pdf

A 74-series TTL D-type flip flop:
http://www.learn-c.com/74ls74.pdf
 

Thread Starter

fordelon1

Joined Aug 16, 2011
13
thank you for your fast response..
yes, i know the basic of D flip flop..

can you give me some of the idea how to start in K-Mapping or building the schematic diagram..

I appreciate any answer from you sir.
 

Thread Starter

fordelon1

Joined Aug 16, 2011
13
Thank you for your response,
but we was instructed to build this circuit strictly using D Flip flop only
of course with the help of basic logic gates, the clock timer, and the 7447..

any idea?
 

MrChips

Joined Oct 2, 2009
30,706
I will get you started on how to make a decade counter, but you will have to do some of the work yourself.

Firstly, you will need four flip-flops of any kind since you will need four bits for 0-9.
Next you create a table showing all the possible states you can have with four bits.
On the next column you write down the next state of the 4-bit counter. For example, 3->4
When a state is not applicable, write down X to mean "don't care"

Here is the partial table:

DCBA DCBA(next state)
0000 0001
0001 0010
0010
0011
0100
0101
0110
0111
1000
1001 0000
1010 xxxx
1011 xxxx
1100
1101
1110
1111

I will leave it up to you to fill in the missing lines.

Next, you need to draw four separate Karnaugh maps, one for each flip-flop
Take for example, the A-flip-flop. Enter into each of the 16 squares of the map the next state of the A-flip-flop: 0, 1 or X. For example, in state 0000, the next state of A will be a 1. For state 0001, the next state is 0. For state 1010, the next state is X.

Next step, reduce the Karnaugh map to a boolean equation, and then into a circuit diagram.

If you have gotten this far, you are doing well.

To be continued.
 

Thread Starter

fordelon1

Joined Aug 16, 2011
13
I will get you started on how to make a decade counter, but you will have to do some of the work yourself.

Firstly, you will need four flip-flops of any kind since you will need four bits for 0-9.
Next you create a table showing all the possible states you can have with four bits.
On the next column you write down the next state of the 4-bit counter. For example, 3->4
When a state is not applicable, write down X to mean "don't care"

Here is the partial table:

DCBA DCBA(next state)
0000 0001
0001 0010
0010
0011
0100
0101
0110
0111
1000
1001 0000
1010 xxxx
1011 xxxx
1100
1101
1110
1111

I will leave it up to you to fill in the missing lines.

Next, you need to draw four separate Karnaugh maps, one for each flip-flop
Take for example, the A-flip-flop. Enter into each of the 16 squares of the map the next state of the A-flip-flop: 0, 1 or X. For example, in state 0000, the next state of A will be a 1. For state 0001, the next state is 0. For state 1010, the next state is X.

Next step, reduce the Karnaugh map to a boolean equation, and then into a circuit diagram.

If you have gotten this far, you are doing well.

To be continued.
if x=0; it is an up counter if x=1; it is a down counter.
Z would be the trigger for the TENS
PS NS Z

DCBA x=0 x=1 x=0 x=1
0000 0001 1001 0 1
0001 0010 0000 0 0
0010 0011 0001 0 0
0011 0100 0010 0 0
0100 0101 0011 0 0
0101 0110 0100 0 0
0110 0111 0101 0 0
0111 1000 0110 0 0
1000 1001 0111 0 0
1001 0000 1000 1 0
1010 xxxx xxxx x x
1011 xxxx xxxx x x
1100 xxxx xxxx x x
1101 xxxx xxxx x x
1110 xxxx xxxx x x
1111 xxxx xxxx x x

Is my truth table correct?...

if this is correct, would you please help in simplifying it thru KMApping please..
more power to you sir..
 

MrChips

Joined Oct 2, 2009
30,706
Firstly, let's not use x to mean UP/DOWN. Use a different symbol such as DIR.

I have purposely not included UP/DOWN because I wanted to make sure you understood how to do a simple 0-9 counter first. Also for the same reason let us not worry about the 2-digit counter at this point.

However, yes, your truth tables for both UP and DOWN are correct.
Read up first on Karnaugh mapping and then I will show you how to do one.
 

Thread Starter

fordelon1

Joined Aug 16, 2011
13
KMAP for A...


B'A'x' B'A'x B'Ax B'Ax' BAx' BAx BA'x BA'x'

D'C' 0 1 0 0 0 0 0 0
D'C 0 0 0 0 1 0 0 0
DC x x x x x x x x
DC' 1 0 1 0 x x x x
(I'm having a difficulty in spacing, but i think you can get this one)
I'm having a hard time simplifying a Kmap even though I know it's basic concept, can you help me with their KMAP..

Thank you for your good response sir...
 

Thread Starter

fordelon1

Joined Aug 16, 2011
13
Sir, If you can allow me,
can you please post their Individual [4]simplified boolean..

so i can check and compare my work with yours.
only if you can allow me sir?

thank you..
 

MrChips

Joined Oct 2, 2009
30,706
Here is the Karnaugh map for flip-flop "A".

There are many ways to draw a K-map. If drawn correctly they will all reveal the same solution.

The important thing to note is - when moving from one square to an adjacent square, only a single bit in the square number changes state - i.e. Gray Code is used.

Another thing to note is that the map can be visualized as a complex cylinder that can be wrapped around in both the horizontal and vertical axes. For example, square #0 wraps around with square #2 and with square #8.



Now, you show the Karnaugh maps for bits B, C and D. I am not going to do them for you.

Later I will show you how to reduce the map to the simplest boolean equation and circuit, if you do not already know how to do so.
 
Last edited:

Thread Starter

fordelon1

Joined Aug 16, 2011
13
Thank you for your response MrChips, yes I've done plotting the 4 KMaps, A B C and D...
my problem is in simplifying the boolean algebra for all of them, it seems that i have a difficulty in grouping variables and simplify them...
 

Thread Starter

fordelon1

Joined Aug 16, 2011
13
but my design has an input which is DIR[specifies up/down counter]... so my variables are
A, B, C, D and DIR.. i need a 5 variable, a total of 32 blocks in K-map..
 

MrChips

Joined Oct 2, 2009
30,706
Like I said, make sure you can do the simple UP counter first before moving on. Remember, proper learning requires taking one step at a time.
 
Top