Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

4 Bit counter

Status
Not open for further replies.

jidan

Member
I want to design 4 bit counter using D flip flop that will count 0 to 7 number

truth table
N A B C
--- -------------------
0 0 0 0
1 0 0 1
2 0 1 0
3 0 1 1
4 1 0 0
5 1 0 1
6 1 1 0
7 1 1 1

1)How many D flip flop are need to Implement 4 bit counter
2)how to know what is present state and next state
 
Last edited:
Am I missing something here?

In your truth table there are only three bits, that is all you need to count to 7. Why do you need four bits?
So you will need three D type flip flops to implement a 3 bit counter.

If you use four D types and build a four bit counter, you can count up to 7 by just ignoring the fourth bit.

I guess the present state can be determined by looking at the states of the Q outputs of the flip flops, that is what most people do I think..
As for the next state, I guess that it will be the current state +1, except when the current state is 7, then it will be 0.

Your truth table may be better written as:

truth table
N C B A
--- -------------------
0 0 0 0
1 0 0 1
2 0 1 0
3 0 1 1
4 1 0 0
5 1 0 1
6 1 1 0
7 1 1 1

The least significant bit is usually denoted by A.

JimB
 
Am I missing something here?

In your truth table there are only three bits, that is all you need to count to 7. Why do you need four bits?
So you will need three D type flip flops to implement a 3 bit counter.

If you use four D types and build a four bit counter, you can count up to 7 by just ignoring the fourth bit.

I guess the present state can be determined by looking at the states of the Q outputs of the flip flops, that is what most people do I think..
As for the next state, I guess that it will be the current state +1, except when the current state is 7, then it will be 0.

Your truth table may be better written as:

truth table
N C B A
--- -------------------
0 0 0 0
1 0 0 1
2 0 1 0
3 0 1 1
4 1 0 0
5 1 0 1
6 1 1 0
7 1 1 1

The least significant bit is usually denoted by A.

JimB
how to find out present state and next state
 
how to find out present state and next state

I said in my previous post:
I guess the present state can be determined by looking at the states of the Q outputs of the flip flops, that is what most people do I think..
As for the next state, I guess that it will be the current state +1, except when the current state is 7, then it will be 0.

Is there something in your question which I do not understand?
If so, please re-phrase the question.

JimB
 
jidan,

Look at the the first table in the link. The headings are labeled "Present State" and "Transition State". Now look at the column for the flip-flop (FF) "E". Going from top to bottom, you see that starting in the present state, the "E" FF has to transistion as 0->1->1->0->0->1 ..etc. So in the first state, the FF starts out as 0 and will transition to 1 in the next state. Now look at the table below it and see that a transistion from 0->1 is designated with "@". So the transition table shows a @ in the first state of the "E" column. The second state shows the "present state" transitioning from 1->1, so you mark the transition table with a "1" in the second state of the "E" column. Understand it now?

Ratch
 
Last edited:
jidan,

Look at the the first table in the link. The headings are labeled "Present State" and "Transition State". Now look at the column for the flip-flop (FF) "E". Going from top to bottom, you see that starting in the present state, the "E" FF has to transistion as 0->1->1->0->0->1 ..etc. So in the first state, the FF starts out as 0 and will transition to 1 in the next state. Now look at the table below it and see that a transistion from 0->1 is designated with "@". So the transition table shows a @ in the first state of the "E" column. The second state shows the "present state" transitioning from 1->1, so you mark the transition table with a "1" in the second state of the "E" column. Understand it now?

Ratch
what is E I don't know but I think its clock input for d flip flop its store value when clok is rise from low to high (positive edge)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top