21 RTL Design Interview Questions: FSM, CDC, FIFO and Timing
Digital and RTL design questions from real fresher interviews: FSMs, resets, clock domain crossing, FIFOs, timing and low power.
Updated 05 November 2026 · Written by Semicon Weekly in our own words · 21 questions
Practise these 21 questions free : type, speak or pick from 4 options and get an instant AI score.
Start practising →
Questions on this page What causes an inferred latch? Why is it bad and how do you avoid it? Difference between synchronous and asynchronous reset. Write a D flip-flop with each. What are recovery and removal checks? Design a Moore FSM to detect sequence 1011 (overlapping). How many states? Mealy vs Moore FSM: differences and when to use each? Compare binary, gray and one-hot state encoding. What are the 1, 2 and 3 always-block styles of writing an FSM? Which is preferred? What is metastability and how does a 2-flop synchronizer help? How do you pass a multi-bit bus across clock domains? What is a FIFO? Explain full, empty, overflow and underflow. Write clock 100 MHz, read clock 50 MHz, burst of 120 words written back to back, read side reads every cycle. Minimum FIFO depth? Write a 4-bit synchronous up-counter with active-low async reset and enable. Difference between ring counter and Johnson counter? Write binary to gray and gray to binary converters. Write a parameterised N:1 mux and a 5:1 mux. Design an edge detector that gives a one-cycle pulse on rising edge of signal din. What is an LFSR and where is it used? What RTL coding techniques reduce power? What is setup time and hold time? What happens on violation? How can you write RTL that helps static timing? Why are combinational feedback loops and internally generated clocks bad for testability?
easy Latches theory
1. What causes an inferred latch? Why is it bad and how do you avoid it?Show answer Combinational always block where some output is not assigned in every path (missing else / missing case default) bad: unintended storage, timing analysis problems, glitches, DFT issues avoid: default assignments at top of block, full if-else, case default, lint checks, always_comb Common mistake: Saying latches are only caused by missing else
Interviewer may ask next: Is there any situation where a latch is intentionally used?
Answer this in the AI interview bot → easy Reset code
2. Difference between synchronous and asynchronous reset. Write a D flip-flop with each.Show answer Sync: reset checked only on clock edge, always @(posedge clk) if (rst) q <= 0; Async: always @(posedge clk or posedge rst); async acts immediately without clock; sync is glitch-tolerant and timing-friendly but needs clock; async needs reset synchronizer for de-assertion (recovery/removal timing)
Common mistake: Putting rst in sensitivity list for sync reset
Interviewer may ask next: What is reset synchronization (async assert, sync de-assert)?
Answer this in the AI interview bot → hard Reset theory
3. What are recovery and removal checks?Show answer They are setup/hold-like timing checks for an asynchronous reset de-assertion relative to the clock edge recovery: reset must be released some time BEFORE the clock edge removal: reset must stay asserted some time AFTER the clock edge Violation can cause metastability Common mistake: Confusing them with normal setup/hold on D
Answer this in the AI interview bot → medium FSM code
4. Design a Moore FSM to detect sequence 1011 (overlapping). How many states?Show answer States: IDLE, S1, S10, S101, S1011 (detect) = 5 states for Moore; on detection with overlap go to S1 or S10 based on next input (after 1011, last '1' can start a new match: from S1011 input 0 goes to S10, input 1 goes to S1); separate state register, next-state logic and output logic
Common mistake: Resetting to IDLE after detection (non-overlapping by mistake)
Interviewer may ask next: How many states does the Mealy version need and why one less?
Answer this in the AI interview bot → medium FSM theory
5. Mealy vs Moore FSM: differences and when to use each?Show answer Moore output depends only on state, so it is glitch-free and registered-friendly but reacts one cycle later Mealy output depends on state and inputs, fewer states and faster response but output can glitch with input Registered Mealy outputs are common Common mistake: Saying Moore always needs more flip-flops
Answer this in the AI interview bot → medium FSM theory
6. Compare binary, gray and one-hot state encoding.Show answer Binary: fewest flops (log2 N), more decode logic One-hot: N flops, very simple next-state logic, fast, good on FPGAs gray: only one bit changes between adjacent states, lower power and safer for sequential state machines Choice is area vs speed vs power Interviewer may ask next: How would you make an FSM safe against illegal states?
Answer this in the AI interview bot → medium FSM theory
7. What are the 1, 2 and 3 always-block styles of writing an FSM? Which is preferred?Show answer 1-block: everything in one clocked block, outputs become registered 2-block: clocked state register + combinational next-state/output 3-block: separate state register, next-state logic, output logic 2 or 3 block is preferred for readability and synthesis control Answer this in the AI interview bot → hard CDC theory
8. What is metastability and how does a 2-flop synchronizer help?Show answer When a flop samples data changing inside its setup/hold window its output can stay at an in-between level for an unknown time 2-flop synchronizer gives the first flop a full clock period to resolve before the second flop samples it, cutting failure probability (MTBF goes up a lot) Only for single-bit signals Common mistake: Saying the synchronizer removes metastability completely
Interviewer may ask next: Why can you not use a 2-flop synchronizer on an 8-bit bus?
Answer this in the AI interview bot → hard CDC theory
9. How do you pass a multi-bit bus across clock domains?Show answer Options: asynchronous FIFO with gray-coded pointers Handshake (req/ack) where data is held stable and only the control bit is synchronized MUX recirculation with a synchronized enable Gray coding for counters since only one bit changes at a time Common mistake: Synchronizing each bit separately with 2-flops
Interviewer may ask next: Why are async FIFO pointers gray coded?
Answer this in the AI interview bot → medium FIFO theory
10. What is a FIFO? Explain full, empty, overflow and underflow.Show answer First-in first-out buffer between producer and consumer full: no space, writing now causes overflow (data lost) empty: no data, reading causes underflow (garbage read) Detection with a count, or with an extra MSB on read/write pointers (same pointer bits but MSB differs = full All equal = empty) Common mistake: Not knowing the extra-MSB pointer method
Interviewer may ask next: How would you calculate FIFO depth for a burst of 100 writes at 100 MHz with reads at 80 MHz?
Answer this in the AI interview bot → Reading is not enough. Say your answer out loud or type it, and get a score out of 10 with what you missed.
Practise free → hard FIFO numerical
11. Write clock 100 MHz, read clock 50 MHz, burst of 120 words written back to back, read side reads every cycle. Minimum FIFO depth?Show answer Burst time = 120 / 100 MHz = 1.2 us Words read in that time = 1.2 us x 50 MHz = 60 Depth needed = 120 - 60 = 60 Common mistake: Using frequencies ratio without considering burst length
Interviewer may ask next: What if the read side reads only once every 2 read clocks?
Answer this in the AI interview bot → easy Counters code
12. Write a 4-bit synchronous up-counter with active-low async reset and enable.Show answer always @(posedge clk or negedge rst_n) if (!rst_n) cnt <= 0; else if (en) cnt <= cnt + 1; uses non-blocking; wraps from 15 to 0 naturally
Common mistake: Using blocking assignment
Interviewer may ask next: Convert it into a mod-10 counter.
Answer this in the AI interview bot → medium Counters theory
13. Difference between ring counter and Johnson counter?Show answer Ring: one-hot pattern rotates, N flops give N states, must be preset to a 1 Johnson (twisted ring): inverted last output fed back, N flops give 2N states, decoding needs only 2-input gates Both have unused illegal states to handle Interviewer may ask next: Write a 4-bit Johnson counter.
Answer this in the AI interview bot → easy Code conversion code
14. Write binary to gray and gray to binary converters.Show answer Binary to gray: g = b ^ (b >> 1); Gray to binary: b[MSB] = g[MSB], b[i] = b[i+1] ^ g[i] (loop from MSB down), or b[i] = ^(g >> i)
Common mistake: Using gray-to-binary formula for both
Interviewer may ask next: Where are gray codes used in real chips?
Answer this in the AI interview bot → easy Combinational code
15. Write a parameterised N:1 mux and a 5:1 mux.Show answer Use an array input and assign y = in[sel]; for 5:1 use case with a default (sel values 5-7 must be handled to avoid latch/x); sel width = $clog2(N)
Common mistake: No default for unused sel values
Answer this in the AI interview bot → medium Combinational code
16. Design an edge detector that gives a one-cycle pulse on rising edge of signal din.Show answer Register din into din_d on the clock; rise = din & ~din_d; fall = ~din & din_d; any = din ^ din_d; if din is async, synchronize it first
Common mistake: Using posedge din directly as a clock
Interviewer may ask next: Make it detect both edges.
Answer this in the AI interview bot → medium LFSR theory
17. What is an LFSR and where is it used?Show answer Shift register whose input is XOR of selected taps With a primitive polynomial it cycles through 2^N - 1 states (all-zero is a lock-up state for XOR) Used for pseudo-random generation, BIST, CRC, scramblers Common mistake: Saying it gives 2^N states
Answer this in the AI interview bot → medium Low power theory
18. What RTL coding techniques reduce power?Show answer Clock gating (enable-based, tool inserted ICG cells) Operand isolation (stop toggling of unused datapath) Avoid unnecessary toggles, gray coding for counters Memory power-down Multi-voltage and power gating at architecture level Dynamic power = a C V^2 f Common mistake: Mentioning only clock gating
Interviewer may ask next: Why should you not write clock gating with a plain AND gate in RTL?
Answer this in the AI interview bot → medium Timing theory
19. What is setup time and hold time? What happens on violation?Show answer Setup: data must be stable some time before the clock edge hold: data must stay stable some time after the edge Violation risks metastability or wrong capture Setup fixed by reducing logic delay or slowing the clock Hold does NOT depend on clock period and is fixed by adding delay Common mistake: Saying hold violations are fixed by lowering frequency
Interviewer may ask next: Write the setup slack equation.
Answer this in the AI interview bot → hard Timing theory
20. How can you write RTL that helps static timing?Show answer Pipeline long paths Put late-arriving signals near the end of logic cones Avoid deep if-else priority chains Register module outputs Balance adder/mux trees Avoid combinational loops and gated clocks Resource sharing trades area for timing Answer this in the AI interview bot → Reading is not enough. Say your answer out loud or type it, and get a score out of 10 with what you missed.
Practise free → medium DFT theory
21. Why are combinational feedback loops and internally generated clocks bad for testability?Show answer Scan insertion needs every flop controllable and observable from the test clock Loops create unknown states and cannot be scanned Generated/gated clocks must be bypassed with test-mode muxes Async resets also need control in test mode Answer this in the AI interview bot →