Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Why code a state machine like this?

Status
Not open for further replies.

steven852

Advanced Member level 4
Joined
Apr 24, 2005
Messages
100
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,298
Activity points
2,040
Hi,

I just saw a way to code a 4-state machine like this:

parameter s0= 8'b00000000,
s1= 8'b00010000,
s2= 8'b00100001,
s3= 8'b00110000,
s4= 8'b01000000,
s5= 8'b01010100,
s6= 8'b01100010,
s7= 8'b01110000,
s8= 8'b10000000,
s9= 8'b10010000,
s10=8'b10100000,
s11=8'b10110000,
s12=8'b11001000,
s13=8'b11010000,
s14= 8'b11100000,
s15= 8'b11110000;

This is neither Gray-code nor hamming code state machine. In fact, only the highest 4-bits in the coding are used. Anyone knows why?
 

Here could be the posible reasons!
1. This statemachine might be to describe 8 bit controller where the states represents
opcodes.
2. The test sequence might be a psudo random no. so that it takes less logic when
synthesize.
3. May be the states are encoded in such a way that both the next state logic and/or output
decoder logic gets optimized.

more thoughts please!
 

It may relate to reducing glitches in the state machine. But I just don't see how it works. In fact, I think it is a waste to increase # of bits in the state coding in this particular implementation.
 

If it is related to some specific application then i cant say anything about it otherwise it is waste to use so many bits to represent the states. It will increase the hardware a lot.
But if it is been made keeping in view some future expansions then we cant say anything
 

This type of representing a state machine is called as one hot encoding.. this will be often used when we fuse the design to fpga. bcoz fpga have lot of FF. So by using this type of coding we can reduce the combinational circuits which takes more hardware when we map the design to FPGA.. So by using this type of encoding combinational circuits are less.
 

gets its state machine and analyze it, you may get an answer. Anyway, s2 may not be the next state of s1, so the coding alone does not make any sense.
 

It does perfect sense !.. state machine output values that can be used as signals to control external circuitry ..
so in this case the external WHATEVER uses 8 signals that change in a sequenced maner!
 

i dont think the above is one hot encode.correct me if i am wrong.

Added after 2 minutes:

if u go for one hot encoding it will increase the no.of redundant states.for an n no.of states u have 2(power n)-n redundant states
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top