Hardware interview practice
Identify Simulation Defaults for Variables and Nets
A four-state `logic q;` is never initialized, and a `wire w;` has no driver in a simulation. Which statement is correct before any assignment or driver is added?
Choose one
Answer choices
- A. The simulator may choose zero or one randomly for each value on every read.
- B. `q` is Z and `w` is X because variables float while nets store unknown data.
- C. Both values are guaranteed to be zero in simulation and in fabricated hardware.
- D. `q` reads as X and `w` resolves to Z in simulation; actual power-up state is technology- and implementation-dependent unless reset or initialization is guaranteed.
