BitFlow

One-Hot FSM: "1011" Detector (Equations by Hand)

advanced · state_machine · 230 XP

Sign in to write your solution, run it in the simulator and submit it for grading.

Sign in or create a free account →

Problem

One-Hot FSM: "1011" Detector with Hand-Derived Equations Re-implement the sequence detector from **11.01** (Moore FSM, non-overlapping), but using **one-hot state encoding** and **deriving the next-state equations algebraically**. **One-hot encoding:** Each state is represented by a single 1 bit in an N-bit vector. For 5 states: ``` IDLE = 5'b00001 S1 = 5'b00010 S10 = 5'b00100 S101 = 5'b01000 DETECT = 5'b10000 ``` **Next-State Equations (Moore 1011 detector):** Derive equations by analyzing state transitions from the diagram: ``` IDLE_next = DETECT | (IDLE & ~x) S1_next = (IDLE & x) | (S1 & x) S10_next = (S1 & ~x) S101_next = (S10 & x) DETECT_next = (S101 & x) ``` **Your task:** Implement the FSM using these **explicit algebraic equations** (not a case statement). Show your derivation in comments. Demonstrate that: 1. Equations are minimal (often fewer gates than binary-encoded FSMs) 2. Synthesis on FPGAs prefers one-hot (abundant flip-flops, fewer LUTs) 3. Synthesis on ASICs prefers binary (smaller area, but more complex routing) **Interface:** Identical to 11.01 (`clk, rst, x, y`)

Constraints

  • Use one-hot encoding: 5 bits, one per state.
  • Implement next_state logic using direct assignments from algebraic equations, NOT a case statement.
  • Output y = DETECT (just the DETECT bit).
  • Include comments showing the state transition diagram and the reasoning for each equation.
  • Behavioural identity with 11.01: same test vectors must produce identical output.

Examples

Input: 1, 1, 0, 1, 1 (sequence 1011)

Output: y pulses on 5th input (same as 11.01)

Functional equivalence verified

Common questions

What does the One-Hot FSM: "1011" Detector (Equations by Hand) problem ask you to build?
One-Hot FSM: "1011" Detector with Hand-Derived Equations Re-implement the sequence detector from **11.01** (Moore FSM, non-overlapping), but using **one-hot state encoding** and **deriving the next-state equations algebraically**.
What constraints does One-Hot FSM: "1011" Detector (Equations by Hand) have?
Use one-hot encoding: 5 bits, one per state.; Implement next_state logic using direct assignments from algebraic equations, NOT a case statement.; Output y = DETECT (just the DETECT bit).; Include comments showing the state transition diagram and the reasoning for each equation.; Behavioural identity with 11.01: same test vectors must produce identical output.
What is an example input and output for One-Hot FSM: "1011" Detector (Equations by Hand)?
Input 1, 1, 0, 1, 1 (sequence 1011) gives output y pulses on 5th input (same as 11.01). Functional equivalence verified
Which Verilog concepts does One-Hot FSM: "1011" Detector (Equations by Hand) practise?
state_machine, one-hot, FSM, interview, synthesis.