I cant create a truth table because states are not unique

Thread Starter

hazretipid

Joined Dec 18, 2024
9
I’m trying to design and simulate a seven segment display counter with JK Flip-Flop with given sequence using Proteus .

Sequence : 2-0-0-7-5-7-0-5-1

Each state has to be unique.
Since there are two '7', how can you make the two unique?
Similarly, there are two '5' and three '0'. and also two zeros are listed consecutively.

So according to this information i cant create a truth table and also KMap?

Even given number are 9 digit so i have to use 4 JK -Flip Flop but repating numbers are require only three bits to display. Should i use 3 JK-Flip Flop ?

I have a lots of question. What should i do?
 

Attachments

Last edited:

Thread Starter

hazretipid

Joined Dec 18, 2024
9
Hi haz,
Welcome to AAC.
Is this a college or homework assignment?
Moderation
Hi @ericgibbs

An exercise I try to do to improve myself.

Our professor assigned us a circuit project that counts from 0 to 9 and displays the result, and I completed it. However, after the submission, the professor asked us what we would do in cases of repetitive and non-unique states, although this was not given as an official task. Out of curiosity, I decided to work on it, but I encountered many problems along the way

Thanks a lot.
 

Attachments

BobTPH

Joined Jun 5, 2013
11,463
The states are whatever you say they are, just because two states produce the same output does not mean they are the same state. The two states have different predecessors and successors, that makes them unique.
 

Papabravo

Joined Feb 24, 2006
22,058
This is the essential difference between a combinatorial circuit which you might have been expecting and a sequential circuit which will be required for this task. You can lookup "Moore Machine" and "Mealy Machine" for two different but equivalent sequential machines where the output depends not only on the present inputs but also on the present state.
 

MrChips

Joined Oct 2, 2009
34,626
This is a classic exercise given to students, to display their student number on a single 7-segment display. Assuming that the student ID number is 200757051, this makes for an interesting exercise. The digits were carefully chosen to give you some insight to the problem and its solution.

How many states are required? There are 9 states showing.
What is the minimum number of bits required to have a sequential circuit with 9 states? The minimum number of bits is 4.
How many states can be represented by 4 bits? There are 16 possible states of which only 9 states are required.
How many unused states are remaining? There are 7 unused states.

Now, considering that there are two 7s, which of the 16 states would you choose to distinguish two unique 7s?

I will leave it up to you to consider and solve the other three challenges.
 

panic mode

Joined Oct 10, 2011
4,864
Sequence : 2-0-0-7-5-7-0-5-1

Each state has to be unique.
Since there are two '7', how can you make the two unique?
Similarly, there are two '5' and three '0'. and also two zeros are listed consecutively.
your sequence need unique states... such as
0-1-2-3-4-5-6-7-8-9
iin
then you translate THOSE states (inputs) into states you want (outputs).
and that is easy once you have unique states. basically use OR gates...
so inputs ateas 1 or 2 should produce output state "0"
and input states 3 or 5 should both produce output state "7"
etc.
 

WBahn

Joined Mar 31, 2012
32,702
As others have noted, you are confusing "state" with "output". This is a pretty easy trap to fall into, because up to this point you have only been asked to design circuits in which the desired output of each state was distinct, and so the state variable could very conveniently be the output directly. Now you are in a position to learn what they tried to teach you from the beginning, but that got lost because of this convenience, and that is that "state" and "output" are not the same and that you get to define what the output is for each state in any way that you need to.
 

Papabravo

Joined Feb 24, 2006
22,058
Hueristically, the truth table you want takes the "present state" and the "inputs", and produces the "next state" and the "outputs."
Should be easy to make a truth table on that basis. A superior design would also do something with invalid state combinations.
 

Thread Starter

hazretipid

Joined Dec 18, 2024
9
This is a classic exercise given to students, to display their student number on a single 7-segment display. Assuming that the student ID number is 200757051, this makes for an interesting exercise. The digits were carefully chosen to give you some insight to the problem and its solution.

How many states are required? There are 9 states showing.
What is the minimum number of bits required to have a sequential circuit with 9 states? The minimum number of bits is 4.
How many states can be represented by 4 bits? There are 16 possible states of which only 9 states are required.
How many unused states are remaining? There are 7 unused states.

Now, considering that there are two 7s, which of the 16 states would you choose to distinguish two unique 7s?

I will leave it up to you to consider and solve the other three challenges.
Hi Sir @MrChips

Thanks for answering my questions. I'm really appreciate that

So should I do this by assigning repeating numbers to unused states?

For example

  • First '7': State 0111 (7)
  • Second '7': State 1111 (15)

Thanks a lot
 

Attachments

Thread Starter

hazretipid

Joined Dec 18, 2024
9
Hueristically, the truth table you want takes the "present state" and the "inputs", and produces the "next state" and the "outputs."
Should be easy to make a truth table on that basis. A superior design would also do something with invalid state combinations.
Hi Sir @Papabravo
Thanks for answering my questions. I'm really appreciate that

I create a truth table that you mention about. So if you dont mind would you check if there is a mistake ?
 
Your uploaded image appears to be empty.

I constructed the truth table using a simple but logical approach. Each column is worded differently but is expressing the same information with respect to the other columns. The difference is how the information is used in our minds and as part of a physical circuit. Going through it step-by-step:

a) To display the sequence 2-0-0-7-5-7-0-5-1 using combinational logic, 9 unique states are needed because there are 9 unique numbers that need to be displayed in a specific order. In order words, there is no way for this simple machine to remember that a 0, 5 or 7 has already been displayed and to do it again. The only way around this is to assign each number a unique state and give it it's own piece of circuitry.

b) Now that the numbers (symbols) to be displayed are correlated to a specific number of states, the states can be converted to binary by simply counting in binary. 9 is 1000 in binary so at least 4 bits are needed to store the 9 states (2^4 = 16).

c) Finally, the binary representation can be used to light the required segments on the display.


states.png
 

Thread Starter

hazretipid

Joined Dec 18, 2024
9
@Art Vandelay Hi sir,

Thanks for answering my questions. I'm really appreciate that

So how should i create the truth table ? Using Numbers binary equivalent or State binary equivalent?

I added a truth table again. if you dont mind would you check if there is a mistake ?

Thanks a lot
 

Attachments

WBahn

Joined Mar 31, 2012
32,702
@Art Vandelay Hi sir,

Thanks for answering my questions. I'm really appreciate that

So how should i create the truth table ? Using Numbers binary equivalent or State binary equivalent?

I added a truth table again. if you dont mind would you check if there is a mistake ?

Thanks a lot
A state diagram typically has both the state variable and the output. You state transition table focuses on the state variable and you typically have a separate truth table that decodes the state variable to produce the output.
 
@Art Vandelay Hi sir,

Thanks for answering my questions. I'm really appreciate that

So how should i create the truth table ? Using Numbers binary equivalent or State binary equivalent?

I added a truth table again. if you dont mind would you check if there is a mistake ?

Thanks a lot
A few things:

a) Your truth table is a mess. Sloppy work is hard for everyone to understand and for teachers to grade. Get into the habit of using a ruler or spreadsheet.

b) A truth table must only display the truth! Every row of your table is wrong because Q+ is always the opposite of Q. There are probably more errors but on this basis alone you need to try again.

Using the information you provided, I generated a partial truth table using software. Notice how easy it is to read and work with.

Also notice how I assigned the start of Q4321 to Binary State 0000 and the end to 1000. This follows the logical approach of assigning states while counting in binary. Now all you have to do is find out which JK combination produces that specific set of outputs and fill it in. I did it this way because it's much easier to keep track of things when they follow a logical pattern.

Fill in the rest of the table and I'll check your work. Be sure to include what happens with the unused states. You don't need to fill in all the unused states but at least make a note of it on the document. This shows the reader that you have considered each possibility and left nothing out.

truth table.png
 
Last edited:

MrChips

Joined Oct 2, 2009
34,626
If you need to create a finite state machine with the following sequence, 2 0 0 7 5 7 0 5 1, then you need to draw a truth table showing the current state and the next state. There are many possible solutions of which here I show only one solution.

state ---> next state
0 0 1 0 -> 0 0 0 0
0 0 0 0 -> 1 0 0 0
1 0 0 0 -> 1 1 1 1
1 1 1 1 -> 1 1 0 1
1 1 0 1 -> 0 1 1 1
0 1 1 1 - > ? ? ? ? (many possible solutions, select an unused state)
? ? ? ? -> 0 1 0 1
0 1 0 1 -> 0 0 0 1
 
Here's a circuit that uses 4 positive-edge JK flip flops and an AND gate to output 9 unique sequential states. The AND gate provides the reset logic to reset the flip-flops when the counter reaches 1001 (10 in binary). Next comes the decoder logic to light the relevant segments but you mentioned you know how to do that.

Using this circuit as a reference, can you figure out how to design a truth table and state diagram including the clock, reset and AND gate?

jk.png

Click this link to launch the simulator.

https://tinyurl.com/2ah4s8nz
 
Last edited:

Thread Starter

hazretipid

Joined Dec 18, 2024
9
A few things:

a) Your truth table is a mess. Sloppy work is hard for everyone to understand and for teachers to grade. Get into the habit of using a ruler or spreadsheet.

b) A truth table must only display the truth! Every row of your table is wrong because Q+ is always the opposite of Q. There are probably more errors but on this basis alone you need to try again.

Using the information you provided, I generated a partial truth table using software. Notice how easy it is to read and work with.

Also notice how I assigned the start of Q4321 to Binary State 0000 and the end to 1000. This follows the logical approach of assigning states while counting in binary. Now all you have to do is find out which JK combination produces that specific set of outputs and fill it in. I did it this way because it's much easier to keep track of things when they follow a logical pattern.

Fill in the rest of the table and I'll check your work. Be sure to include what happens with the unused states. You don't need to fill in all the unused states but at least make a note of it on the document. This shows the reader that you have considered each possibility and left nothing out.

View attachment 338601
Hi Sir @Art Vandelay
I'm really appreciate that you are taking time for me. Thanks again.
So i have fill the table and write a python code using pandas library for good visualization
Is there any mistake ?
Thanks
 

Attachments

Top