Electronic Design
  • Resources
  • Directory
  • Webinars
  • CAD Models
  • Video
  • Blogs
  • More Publications
  • Advertise
    • Search
  • Top Stories
  • Tech Topics
  • Analog
  • Power
  • Embedded
  • Test
  • AI / ML
  • Automotive
  • Data Sheets
  • Topics
    - TechXchange Topics --- Markets --AutomotiveAutomation-- Technologies --AnalogPowerTest & MeasurementEmbedded
    Resources
    Electronic Design ResourcesTop Stories of the WeekNew ProductsKit Close-UpElectronic Design LibrarySearch Data SheetsCompany DirectoryBlogsContribute
    Members
    ContentBenefitsSubscribeDigital editions
    Advertise
    https://www.facebook.com/ElectronicDesign
    https://www.linkedin.com/groups/4210549/
    https://twitter.com/ElectronicDesgn
    https://www.youtube.com/channel/UCXKEiQ9dob20rIqTA7ONfJg
    1. Technologies
    2. Components
    3. Electromechanical

    Build a simple finite state machine

    July 7, 1997
    Probably everyone has seen in some textbook the block diagram of a “finite state machine” (FSM), and most likely nobody used it in practice (Fig. 1). For the few who aren’t familiar with it, an FSM is a...
    Contributing Author

    Probably everyone has seen in some textbook the block diagram of a “finite state machine” (FSM), and most likely nobody used it in practice (Fig. 1). For the few who aren’t familiar with it, an FSM is a device that can assume a finite number of states. Each of them contains a complete description of a particular condition of the FSM. The FSM can only jump from state to state, depending on the state where the machine is, as well as the input.

    A simple FSM is made using an EPROM, in which data is fed back to its addresses. The data indicates the state of the machine. The next state is the content of the EPROM cell, which is addressed by the present state (lowest part of the address) and the input lines (highest part of the address). An FSM that uses an 8-bit memory chip has 256 states and can perform simple operations. The difficulty in designing such a device involves generating binary code for the EPROM. To accomplish this task, a simple language was defined that, in its simplest form, has instructions like the following:

    \[(state wanted output)\] if then \[(next state wanted output>)\] \[else\]

    where indicates the actual state of the machine and may be followed by the binary string if it’s required that the state have a defined bit configuration; and where , after the reserved word “if” gives the condition to bring the system to , which may be followed (like ) by . The optional reserved word “else” will allow the system to jump to an . The compiler (written in Borland Turbo Pascal 5.5) reads the test file, and produces a binary file used to program the EPROM. To illustrate how to design a simple device using the “finite state language,” a simple four-phase stepper-motor control was implemented (Listing 1). The compiler associates a progressive number with each label and each EPROM output, taking care of the (binary numbers in parentheses) (Listing 2). Then the compiler computes the EPROM content (Listing 3). The compiler assumes that the default state is the first state of the source code. Thus, any unspecified condition jumps to that state (state stop).

    Figure 2 depicts the schematic that implements the hardware for this FSM.

    Continue Reading

    What’s So Special About Quantum Computing?

    Compiler Qualification is Critical for Smart-Device Code

    Sponsored Recommendations

    Designing automotive-grade camera-based mirror systems

    Dec. 2, 2023

    Design security cameras and other low-power smart cameras with AI vision processors

    Dec. 2, 2023

    Automotive 1 TOPS vision SoC with RGB-IR ISP for 1-2 cameras, driver monitoring, dashcams

    Dec. 2, 2023

    AM62A starter kit for edge AI, vision, analytics and general purpose processors

    Dec. 2, 2023

    Comments

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

    I already have an account

    New

    Super-Slim Wireless, Self-Powered “Sticker” Measures Contact Force

    Commercial-Ready Route in Texas for Driverless Trucks Planned for Late 2024

    Running Background Checks on Today’s Celebrity Scientists

    Most Read

    Design Resources Boost Embedded Development Projects

    TrustInSoft Helps Root Out Bugs to Deliver Reliable Code

    MEMS Mirrors: The Next Big Wave in MEMS Technology


    Sponsored

    TIDA-050063

    Low-power option for smart meter wireless module using primary cells reference design

    R&S®TS-PSM1 Power switching module

    Electronic Design
    https://www.facebook.com/ElectronicDesign
    https://www.linkedin.com/groups/4210549/
    https://twitter.com/ElectronicDesgn
    https://www.youtube.com/channel/UCXKEiQ9dob20rIqTA7ONfJg
    • About Us
    • Contact Us
    • Advertise
    • Do Not Sell or Share
    • Privacy & Cookie Policy
    • Terms of Service
    © 2023 Endeavor Business Media, LLC. All rights reserved.
    Endeavor Business Media Logo