TDEB Top Bar

Trending
Semiconductor Industry News — The Digital Electronics Blog
Follow Us

TDEB Masthead

The Semiconductor Hub

Semiconductors.  Chips and Systems.  Innovation.

Indexed by leading Search Engines, AI and referenced by Engineers worldwide 500+ Articles 10M+ Pageviews 30+ Reports 50+ Citations

Digital Design Interview Questions

The Editor's Desk
by
0
Share Facebook X LinkedIn WhatsApp Email

Search in this blog for all the available articles and resources! To get you started, this page collects the digital design questions that come up most often in interviews for ASIC, FPGA and verification roles, with a short answer for each and worked numbers for the ones that interviewers like to push on.

How to use this list

Interviewers rarely want a memorized definition. They want to see that you can reason from first principles: draw the circuit, write the timing equation, put numbers in it. For each question below, practice saying the short answer in two or three sentences, then be ready to sketch a waveform or do the arithmetic in the deep dive.

The core questions, with short answers

Combinational logic

  • Why are NAND and NOR called universal gates? Any Boolean function can be built from NAND gates alone, or from NOR gates alone. An inverter is a NAND with its inputs tied together, and AND and OR follow from it.
  • Build a 2:1 multiplexer from basic gates. Y = (A AND NOT S) OR (B AND S). It is also the classic way to show that a mux is universal: tie inputs to constants or to the select to make any two-input gate.
  • What is a glitch (hazard) and how do you remove it? A short unwanted pulse when inputs change through paths of different delay. Add the redundant consensus term in the logic, or, in synchronous design, simply sample the output with a flip-flop after it has settled.

Sequential logic

  • Latch or flip-flop? A latch is level-sensitive: transparent while its enable is active. A flip-flop is edge-triggered: it samples only at the clock edge. Flip-flops make timing analysis simple; latches allow time borrowing but are harder to verify.
  • What are setup and hold time? Setup is how long data must be stable before the clock edge; hold is how long it must stay stable after. Setup limits the maximum clock frequency; hold does not depend on frequency at all.
  • Moore or Mealy machine? A Moore machine's outputs depend only on the state; a Mealy machine's outputs depend on the state and the current inputs. Mealy machines can react one cycle earlier and often need fewer states, but their outputs can glitch with the inputs.

Clocks and clock domains

  • What is metastability? When a flip-flop's input changes inside its setup and hold window, the output can hang between 0 and 1 for an unpredictable time before resolving. It cannot be prevented, only made very unlikely.
  • How do you pass a signal between clock domains? A single bit goes through a two-flip-flop synchronizer. A bus needs a handshake or an asynchronous FIFO, with Gray-coded pointers so that only one bit changes at a time.
  • Why Gray code? Consecutive values differ in one bit, so a synchronizer that samples during a change sees either the old or the new value, never a mix.
  • What is clock gating? Stopping the clock to idle registers to save dynamic power. It is done with an integrated clock-gating cell (a latch plus an AND gate) so that the gated clock cannot glitch.

Verilog

  • Blocking or non-blocking assignments? Use non-blocking (<=) in clocked always blocks and blocking (=) in combinational ones. Mixing them up creates simulation races and mismatches between simulation and synthesis.
  • Why do you get an unintended latch? A combinational always block that does not assign an output in every branch. Assign a default at the top of the block.

Deep dive: the numbers and details

This part holds the equations and worked examples interviewers ask you to calculate. Skip it if the overview is all you need. All numbers below are illustrative values chosen to show the method.

1. Maximum clock frequency

For a register-to-register path:

T_min = T_clk_to_q + T_logic_max + T_setup - T_skew

where T_skew is positive when the capture clock arrives later than the launch clock. With clock-to-Q 0.15 ns, logic 1.2 ns, setup 0.10 ns and +0.05 ns skew: T_min = 0.15 + 1.2 + 0.10 - 0.05 = 1.40 ns, so f_max is about 714 MHz.

The hold check on the same path is T_clk_to_q + T_logic_min >= T_hold + T_skew. Positive skew helps setup but hurts hold, which is the trade-off interviewers want you to state.

2. Synchronizer MTBF

The usual model for the mean time between synchronizer failures is:

MTBF = exp(t_r / tau) / (T_0 x f_clk x f_data)

t_r is the time allowed for the flip-flop to resolve, tau and T_0 are properties of the flip-flop, f_clk is the sampling clock and f_data the rate of input changes. Take tau = 20 ps, T_0 = 100 ps, f_clk = 500 MHz and f_data = 10 MHz.

  • One flip-flop with 0.5 ns left to resolve: exp(25) is about 7.2 x 10^10, divided by (10^-10 x 5 x 10^8 x 10^7) = 5 x 10^5, gives about 1.4 x 10^5 seconds, roughly 40 hours. Not acceptable.
  • Add a second flip-flop and t_r grows by a full 2 ns period to 2.5 ns: exp(125) is about 2 x 10^54, and the MTBF becomes astronomically long.

That is the whole argument for the two-flip-flop synchronizer: the exponent, not the constant, does the work.

3. FIFO depth

A writer sends bursts of 120 words back to back at 200 MHz. The reader takes one word per cycle at 100 MHz. Bursts are far enough apart for the FIFO to empty in between.

  • Time to write a burst: 120 / 200 MHz = 600 ns.
  • Words read in that time: 600 ns x 100 MHz = 60.
  • Words left to store: 120 - 60 = 60.

The FIFO needs at least 60 entries, plus a few for the synchronizer delay on the pointers in each direction. A round power of two (64) is the usual answer.

4. Divide-by-3 clock with 50 percent duty cycle

A mod-3 counter on the rising edge gives a divided clock that is high for one input period out of three (33 percent). To reach 50 percent, generate the same waveform from a flip-flop clocked on the falling edge, which is shifted by half an input period, and OR the two. The result is high for 1.5 of every 3 input periods. Mention that the output is a generated clock that must be declared to the timing tool, and that in an FPGA you would use a PLL or MMCM instead.

5. Dynamic power

P_dyn = alpha x C x V^2 x f

With activity alpha = 0.15, switched capacitance 2 nF, 0.9 V and 1 GHz: 0.15 x 2 x 10^-9 x 0.81 x 10^9 = about 0.24 W. Dropping to 0.8 V cuts that by (0.8 / 0.9)^2, about 21 percent, which is why voltage scaling is the strongest power lever.

6. Sequence detector

For "detect 1011 with overlap", a Mealy machine needs four states (nothing, 1, 10, 101) and asserts the output on the transition out of 101 with input 1, moving to the state for "1" to allow overlap. A Moore version needs a fifth state to hold the output. Draw the state table and check the overlap case 1011011, which should produce two detections.

Common mistakes in interviews

  • Saying that a higher clock frequency fixes hold violations. Hold does not depend on frequency.
  • Synchronizing each bit of a binary counter separately across clock domains.
  • Forgetting the synchronizer latency when sizing a FIFO.
  • Gating a clock with a plain AND gate.

-------------------------------PROMOTION-------------------------------
Advertise on this Blog and see yourself grow!
Contact us at onenanometer[at]gmail.com

The Editor's Desk
About the Author
The Editor's Desk
Share Facebook X LinkedIn WhatsApp Email

Post a Comment

0 Comments

Your comments will be moderated before it appears here.

Post a Comment (0)

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Learn more
Ok, Go it!