ChipCenter Questlink
SEARCH CHIPCENTER
Search Type:
Search for:




Knowledge Centers
Product Reviews
Data Sheets
Guides & Experts
News
International
Ask Us
Circuit Cellar Online
App Notes
NetSeminars
Careers
Resources
FAQ
EE Times Network
Electronics Group Sites

STATE MACHINES


Circuit Cellar Online
THE MAGAZINE FOR COMPUTER APPLICATIONS
Circuit Cellar Online offers articles illustrating creative solutions
and unique applications through complete projects, practical
tutorials, and useful design techniques.

STATE MACHINES

Lessons from the Trenches by Ingo Cyliax

Start ı An ASM Example ı Input and Output Signals ı Implementation ı One-Hot Encoding ı Synthesize ı Initializing ı Until Next Time ı Sources and PDF

ONE-HOT ENCODING

Taken to the extreme, you can devise an encoding scheme that has one bit per state. This type of encoding is called one-hot because only one state variable bit is set, or "hot," for each state. The benefit is that the next state generation function is simple. Also, because only two bits change per transition, power consumption is small. The drawback is that it takes a lot of register bits, one per state. However, all of these are a real advantage in FPGAs, because FPGAs are register rich.

Typically, there is a register after each LUT. For many state machines, the next state generator for a state bit will fit in a single LUT. Also, because next state functions tend to be local in scope, the routing between state variables is minimal when expressed as one-hot. For most state machines, one-hot is the way to go in FPGAs.

Also, one-hots are easy to implement in schematics. You can almost see the state machine representation jump out at you because each state has its own flip-flop. So, letıs check out how to implement the machine in a one-hot encoding.

Figure 4 shows the finished ASM. It is much like the ASM in Figure 3, but I have added the state encoding in its proper place, above and to the right of the state box. There are two state variables, but only one can be on at a time. However, a binary encoded state machine could get away with a single register because itıs enough to hold two states.

Figure 4ıIn this ASM, I have assigned the actual state encoding as the top right of each state box. Iım using one-hot encodeing so there are two state variables, and only one of them can be on at any given time.

 

PREVIOUSNEXT


Circuit Cellar provides up-to-date information for engineers. Visit www.circuitcellar.com for more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com or subscribe online. ıCircuit Cellar, the Magazine for Computer Applications. Posted with permission.
Click here to get your listing up.

Copyright © 2003 ChipCenter-QuestLink
About ChipCenter-Questlink  Contact Us  Privacy Statement   Advertising Information  FAQ