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.

Can a State Machine have a duplicated state?

Status
Not open for further replies.

fouadalnoor

Member
Hello guys,

I am currently trying to create a sequence recogniser and my sequence has some repeating numbers (HEX) such as:

E13A2 AA42 D1EA...

When creating the ASM chart for this particular sequence, I will have duplicate states since the numbers repeat themselves...

I simply want my ASM to start with a number (say E) and then for every clock cycle it goes on to the next number (1). What happens when It reaches E again? How will I differentiate the second E with the first one?

I am essentially trying to create a normal 16bit counter, but where it counts in a more random way, where it can go from 0001 to 1101 and back to 0001 and the continue to 1010 etc

Hope you see what I'm trying to do and any help given is highly appreciated!
 
fouadalnoor,

Your numbers can duplicate, but your states cannot. That means that your state numbers are not the same as the numbers you want to represent anymore. That complicates things because now you have to generate or look up the numbers that each state represents.

Ratch
 
fouadalnoor,

Your numbers can duplicate, but your states cannot. That means that your state numbers are not the same as the numbers you want to represent anymore. That complicates things because now you have to generate or look up the numbers that each state represents.

Ratch

Thanks for the quick reply!

This means I will have to have a separate state for each term in the sequence even if they replicate and then assign that state a distinct binary number. I will then have to use combinational logic to convert the particular binary number into whatever number I want..

Say I use the sequence mentioned above."E" would be represented by 0000, "1" would be 0001, "3" would be 0010 etc

I will then have to create a decoder for each distinct state and then get the number I want?

So in this way the output is: 0000 -> Decoder -> 1110 ?
 
fouadalnoor,

Yes, something like that, Or, if you were using a microprocessor, you could reference a look up table (LUT) for each state.

Ratch
 
fouadalnoor,

Yes, something like that, Or, if you were using a microprocessor, you could reference a look up table (LUT) for each state.

Ratch

wow...this assignment is going to be looong... The problem is that my sequence is actually 48 characters long...

Okay, looking at this this way I will need something as shown in the attached picture...

The Input Signal (equal?) is there to increment the counter and the ASM to go to the next state.
I also need to decode the 6 bit input signals into a 4 bit output signal to compare it with the signal I am getting in...


It seems impractical to do this by hand..also I dont think I can use a "48 Channel DMUX" so I probably need to use 12 of 4 channel ones..
 

Attachments

  • Design.jpg
    Design.jpg
    290.2 KB · Views: 284
Last edited:
fouadalnoor,

How about submitting the 48 numbers in the sequence they are needed. Do you have to start on a particular number?

Ratch
 
Last edited:
You should have only three states, waiting for start, comparing and found. The comparing state would have a pointer to the next character to be received.

The biggest problem is getting false starts which would make you miss the data but that depends on what the data is.

Mike.
 
fouadalnoor,

How about submitting the 48 numbers in the sequence they are needed. Do you have to start on a particular number?

Ratch


Well the problem is that the data sent in will be 1 bit at a time.. So '1','0','0' etc also random data might be send before, after the actual sequence that I want..so I need to make sure I ignore everything other than the exact sequence that I want.

Oh and I do have to start on a particular number since that's how the sequence is sent in..
 
fouadalnoor,

It appears that I missed the fact that you needed to do the problem by ASM techniques, so ignore what I said before. Do you have a complete written statement of the problem, or was it given verbally with a long explanation? If the problem can be sent as an attachment to a post, then that would reduce some this back and forth discourse in regards to missing information.

Ratch
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top