Skip to question
SystemVerilogDesignVerificationFirmwareArchitectureASIC Interview Questions→
/Interview questions/SystemVerilog logic, bit, and wire 4-State Types

Q003·Free·SystemVerilog

SystemVerilog logic, bit, and wire 4-State Types

Difficulty
Easy
Topic
SystemVerilog
Language
SV
Interview prompt

Question

A signal is assigned only in one always_ff block, and the verification environment must be able to observe X and Z values. Which declaration best matches that intent?

Comparison of a two-state bit containing zero or one and four-state logic containing zero, one, X, or Z, including conversion of unknown values to zero.
A bit stores two states; logic and reg store four. Assigning X or Z into a two-state bit converts the unknown value to zero.
Choose one

Answer choices

  1. A. bit q;
  2. B. int unsigned q;
  3. C. wire q;
  4. D. logic q;
Answer framework

Short answer

Choose D, logic q. logic is a four-state variable, so it can represent 0, 1, X, and Z and may be assigned by a single always_ff process. bit loses unknown information, while wire describes a net and is not the appropriate procedural storage declaration here.

Why this reasoning works

SystemVerilog separates the signal’s value domain from how it is driven. The logic data type retains unknown and high-impedance values, which is important when the verification environment must detect initialization or connectivity problems. In contrast, bit is two-state and coerces away X/Z information, making it unsuitable for this requirement.

An always_ff block models sequential procedural assignment and imposes a single-writer discipline on its left-hand variables. A plain logic declaration expresses that intent directly. A wire is a resolved net intended for structural or continuous driving; although nets are also four-state by default, choosing one here would conflict with the specified procedural ownership rather than clarify it.

Interview takeaways

  • logic preserves X and Z
  • always_ff needs procedural storage
  • wire models a driven net
Exact question handoffPractice Q003

Solve it in the question bank, keep your progress, and reveal the reviewed solution when your access allows.

Open in question bank →
Solution accessEach time you open this Solution, one Practice Credit is used; it is not permanently unlocked. Premium Solution content also uses one credit per opening.
Continue learning

Values and Layout

Review value domains, object kinds, widths, signedness, and packed and unpacked layout.

  • SystemVerilog
  • Types and resolution
Values and Layout →
Continue practicing

Related questions

Q288 · SystemVerilog4-state equalityEasyP→Q569 · SystemVerilogMatch uninitialized values to their data typesEasyP→Q666 · SystemVerilogNets and variablesEasyP→Q016 · Data StructuresPacked and unpacked arraysEasy→
ASIC.FYI · Learn silicon end to end.info@asic.fyi