HDL & Verification
What circuit does the Verilog assign statement above represent?
assign y = (a & b) | c;
- ACombinational logic ORing c with the AND of a and b; y changes immediately when inputs change
- BA flip-flop that updates y on every clock
- CA circuit that computes once and never changes afterward
Show answer and explanation
Answer: A. Combinational logic ORing c with the AND of a and b; y changes immediately when inputs change
An assign statement, called a continuous assignment, represents wiring in which the value of the right-hand expression is always reflected on the left-hand signal. If any input on the right changes, the output y changes right away (after gate delay). This example becomes combinational logic made of an AND gate and an OR gate. It has no memory, so holding a value requires an always block updated by a clock.
- A. Correct. It is called a continuous assignment.
- B. No clock is involved.
- C. The output follows every input change.