CodiodeCodiode
Home
Problem Solving
Skill Tracks
My Assignments
Contests
Leaderboard
Community
Settings
Codiode/Problems/Sequential Logic

Start Bit Validation

MediumLogic CircuitBuild

Asynchronous serial receivers must distinguish true data transmissions from transient line noise. A short electromagnetic glitch on the receive line can cause a falling edge, which a naive receiver might misinterpret as a start bit, leading to framing errors and garbage data.

The state machine monitors the rx line for a falling edge (a synchronous transition from 1 to 0) while in the idle state. When a 0 is sampled, it waits for exactly 2 additional clock cycles. On the 3rd clock cycle after the initial 0 was sampled, it checks the rx line again.

If rx is 0 on this 3rd cycle, it is a valid start bit: assert start_detected to 1 for that single clock cycle, then return to the idle state.

If rx is 1 on this 3rd cycle, the initial edge was a noise spike: abort the sequence, keep start_detected at 0, and return immediately to the idle state to wait for the next falling edge.

Constraints

  • Implement as a synchronous finite state machine.
  • Use a synchronous, active-high rst signal to initialize the state machine to the idle state.
  • start_detected must be high for exactly one clock cycle per valid start bit.
  • The machine must return to the idle state immediately after the 3rd cycle check, regardless of the rx value.

Topics

FSMUARTInterfaceGlitch Filter

Solve this problem

Place the gates, wire them up and watch the signals settle. Every submission runs on the same simulation engine that grades it.

This problem is part of Codiode Pro. The statement above is free to read.

Sign in to solveSee what Pro unlocks

The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.

Related problems

  • 3-bit Ripple Counter from Toggle Flip-FlopsEasy
  • D Latch from a 2:1 MUXEasy
  • 2-bit Ring CounterEasy
  • T Flip-Flop from a D Flip-FlopEasy
  • Handshake Deadlock Due to Early ResetHard
  • Reconvergence of Individually Synchronized BitsHard
  • Debug: Asynchronous Clear GlitchHard
  • Clock Gate Enable Crossing DomainsHard

Browse all problems · Learning tracks