Build an improved, simpler finite state machine

Feb. 23, 1998
The two improvements suggested here pertain to the “Build a Simple Finite State Machine” Idea for Design submitted by Giovanni Romeo (ELECTRONIC DESIGN, July 7, 1997, p. 149). First of all, the schematic doesn’t show a register latch on...

The two improvements suggested here pertain to the “Build a Simple Finite State Machine” Idea for Design submitted by Giovanni Romeo (ELECTRONIC DESIGN, July 7, 1997, p. 149). First of all, the schematic doesn’t show a register latch on the EPROM inputs. The outputs of a 27C256 EPROM will exhibit glitches during transitions of the inputs. With the free-running clock shown in the schematic, the output register will occasionally catch these glitches. This causes state-machine failures if the inputs aren’t synchronized to the clock.

Secondly, there doesn’t seem to be much reason for this application to invent a state machine language as described in the text. The following C code implements the function described in the article (see the listing). The code is simpler to understand, and took less than an hour to write and debug. It was compiled under Borland C 3.1.

Sponsored Recommendations

Understanding Thermal Challenges in EV Charging Applications

March 28, 2024
As EVs emerge as the dominant mode of transportation, factors such as battery range and quicker charging rates will play pivotal roles in the global economy.

Board-Mount DC/DC Converters in Medical Applications

March 27, 2024
AC/DC or board-mount DC/DC converters provide power for medical devices. This article explains why isolation might be needed and which safety standards apply.

Use Rugged Multiband Antennas to Solve the Mobile Connectivity Challenge

March 27, 2024
Selecting and using antennas for mobile applications requires attention to electrical, mechanical, and environmental characteristics: TE modules can help.

Out-of-the-box Cellular and Wi-Fi connectivity with AWS IoT ExpressLink

March 27, 2024
This demo shows how to enroll LTE-M and Wi-Fi evaluation boards with AWS IoT Core, set up a Connected Health Solution as well as AWS AT commands and AWS IoT ExpressLink security...

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!