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

INPUT AND OUTPUT SIGNALS

Letýs look at implementing this machine. For this you need to know how the display and input signals are implemented. Letýs assume that the inputs come from two input signals, left and right. If left is high, the left button is activated; if right is high, the right button is activated. The display, however, is more complicated. There is an alphanumeric display that takes an ASCII input. On this, you want to display "R" for right and "L" for left. If neither is selected, you want the display to be blank, which is a space character. The display is driven with a 7-bit bus signal called disp[6:0]. There is also an LED, which has a "ready" signal attached.

I have changed the ASM to indicate the encoding for all signals used in Figure 2. While changing the ASM to include decoding the input signals and encoding the output signals, I noticed that there could be a condition in which both the left and right buttons were on. I decided to handle this by displaying a "?" character in the display.

Figure 2ýIn this ASM, I have assigned specific encodings for the inputs and outputs. The inputs are two signals (right and left), and there are several outputs signals. Ready is a single output, and display is a 7-bit signal that carries ASCII representation of "R", "L", and "?".

 

This discrepancy only came up because I used the particular signal encoding. If I had used discrete LED lights for left and right, rather than a ASCII display, it might have been all right to turn both lights on under those conditions. However, with the ASCII display, I would have ended up with a jumbled display because it would have been the logic OR of ASCII "R" and "L."

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