E
Evan Lavelle
Guest
I've got some test code below which carries out the assignment
k = (($signed(3'b110) >>> 1) === 3'b111);
On the face of it, k should evaluate to 1. However, the more
trustworthy of my test sims both agree that it's 0; they report
i is '1'; j is '111'; k is '0'
Any thoughts on what the correct answer is, and why?
Thanks -
Evan
---------------------------
module test;
reg i, k;
reg [2:0] j;
initial
begin
i = ($signed(3'b111) === 3'b111);
j = $signed(3'b110) >>> 1;
k = (($signed(3'b110) >>> 1) === 3'b111);
$display("i is '%b'; j is '%b'; k is '%b'", i, j, k);
end
endmodule
k = (($signed(3'b110) >>> 1) === 3'b111);
On the face of it, k should evaluate to 1. However, the more
trustworthy of my test sims both agree that it's 0; they report
i is '1'; j is '111'; k is '0'
Any thoughts on what the correct answer is, and why?
Thanks -
Evan
---------------------------
module test;
reg i, k;
reg [2:0] j;
initial
begin
i = ($signed(3'b111) === 3'b111);
j = $signed(3'b110) >>> 1;
k = (($signed(3'b110) >>> 1) === 3'b111);
$display("i is '%b'; j is '%b'; k is '%b'", i, j, k);
end
endmodule