What is the value of out after simulation? reg [3:0] a; reg [3:0] out; in…
What is the value of out after simulation? reg [3:0] a; reg [3:0] out; initial begin a = 4'b1011; out = a >> 2; end
- 4'b1110
- 4'b0010
- 4'b1100
- 4'b0011
Correct answer
B. 4'b0010
Explanation
The logical right shift operator ( >> ) shifts bits to the right and strictly zero-fills from the most significant bit (MSB). Shifting 4'b1011 right by two positions yields 4'b0010 .