Skip to RTL questions

Part 1 · Logic and state

Combinational logic, sequential state, and FSMs

Translate RTL into gates and storage, define clock-by-clock state behavior, and make FSM transitions, outputs, priority, and recovery explicit.

Reading path
1 of 3
Chapters
2
Practice links
10

Question indexPractice this reading path.

Open the exact selected question in the practice bank. Premium prompts remain access-gated.

10 practice links shown.

  1. Q594Combinational versus sequential logicCombinational · Easy
  2. Q149Diagnose storage from an incomplete always_comb blockCombinational · Easy
  3. Q283Build a parameterized N-to-1 multiplexerCombinational · Medium
  4. Q141Decode Z wildcards without hiding XCombinational · Easy
  5. Q427Synchronous rising-edge detectorSequential & FSM · Easy
  6. Q079Build a reloadable countdown timerSequential & FSM · Medium
  7. Q581Convert a synchronous level into a one-cycle rising pulseSequential & FSM · Easy
  8. Q204Detect overlapping 1011 sequencesSequential & FSM · Medium
  9. Q844Why an FSM infers a latchSequential & FSM · Easy
  10. Q725Implement a four-requester round-robin arbiterSequential & FSM · Medium

RTL Logic modelsCombinational and sequential intent

Start by locating storage. Then make assignment coverage, clocking, reset, width, and priority explicit.

Concept model

Where the design remembers state

Combinational path

Current inputs determine the result

y = f(x)
Readinputs x
Transformlogic cone
Driveoutput y
Updates
after propagation delay
Storage
none
RTL
always_comb · =
Missing path
latch risk
Sequential path

A clock edge advances state

D = f(q, x) · q⁺ ← D @ ↑clk
Readstate q + inputs
Computenext-state D
SampleDFF → q⁺
Updates
edge + clock-to-Q
Storage
flip-flop q
RTL
always_ff · <=
Missing update
hold / enable

Combinational logic transforms values within a cycle. Sequential logic samples a next value and preserves it across cycles.

RTL State and controlFinite-state machines as timing contracts

Define legal states, sampled transition conditions, outputs, priority, and recovery before choosing an encoding.

Concept model

Join each transition to its sampling edge

Transition contractGuards are evaluated from pre-edge state and inputs
CurrentGuardNextMoore output
IDLEreqWAIT_ACKdone = 0
WAIT_ACK!ackWAIT_ACKdone = 0
WAIT_ACKackDONEdone = 1
DONE1IDLEdone = 0
illegaldefaultIDLEsafe recovery
Five sampled edgesdone = state_q == DONE
After ↑clke0e1e2e3e4
state_qIDLEWAITWAITDONEIDLE
req01000
ack00010
done00010
Sample
pre-edge state + inputsGuards see the old state.
Commit
state_q ← state_dThe register advances after the edge.
Output timing
Moore vs MealyState only, or state plus live inputs.

This example samples request and acknowledge on rising edges. The Moore-style done value follows the registered state entered at that edge.