Verilog Interview
Verilog Interview
== ===
The blocking assignment completes the entire statement before the control goes
unit and the left-hand side later at the end of the time unit. It is symbolized as <=.
Always @ (a or b or c)
Begin
X <= a | b; 1. Evaluate a | b but defer assignment of x
Y <= a ^ b ^ c; 2. Evaluate a^b^c but defer assignment of y
Z <= b & ~c; 3. Evaluate b&(~c) but defer assignment of z
End 4. Assign x, y, and z with their new values
WHAT IS THE SENSITIVITY LIST?
It specifies the list of the signals one wants to cause the code during the process
At T = 0: i1 = 0, i2 = 0, i3 = 0, out = 0
// or At T = 5: i1 = 0, i2 = 1, i3 = 0, out = 0
At T = 13: i1 = 1, i2 = 1, i3 = 0, out = 0
//always @(*) out = i1 & i2 & i3;
At T = 16: i1 = 1, i2 = 1, i3 = 1, out = 1
endmodule
EXPLAIN $MONITOR, $DISPLAY AND $STROBE.
• These commands have similar syntax and show text on the screen during
simulation.
It means all delays are interpreted in nanoseconds, and fractions are rounded off
Can have zero or more than one argument. It needs to have at least one argument.
You should use tasks instead of functions in Verilog when you need to perform a
sequence of procedural actions or when you require multiple input/output
variables.
Tasks are more suitable for modeling complex behavior. They can contain both
procedural statements and timing controls, allowing you to model more
complicated processes.
CAN RACE CONDITIONS OCCUR IN VERILOG? HOW TO AVOID RACE
CONDITIONS IN VERILOG
Yes, race conditions can occur in Verilog. A race condition arises due to concurrent events happening in
different orders, and the final outcome depends on the order of timing of these events.