jamesqjf
Newbie level 6
verilog casex
I read the IEEEstandard1364-2005 for Verilog HDL and came across these code:
The following is an example of the casex statement. It demonstrates an extreme case of how donot-
care conditions can be dynamically controlled during simulation. In this case, if r = 8'b01100110,
then the task stat2 is called.
reg [7:0] r, mask;
mask = 8'bx0x0x0x0;
casex (r ^ mask)
8'b001100xx: stat1;
8'b1100xx00: stat2;
8'b00xx0011: stat3;
8'bxx010100: stat4;
endcase
I just wonder if r^mask=00110011, then I think it satisfied the condition of stat1 and stat3, but I guess there should be just one statement being excuted,which statement will be excuted? stat1 or state3? Why? Thank you.
I read the IEEEstandard1364-2005 for Verilog HDL and came across these code:
The following is an example of the casex statement. It demonstrates an extreme case of how donot-
care conditions can be dynamically controlled during simulation. In this case, if r = 8'b01100110,
then the task stat2 is called.
reg [7:0] r, mask;
mask = 8'bx0x0x0x0;
casex (r ^ mask)
8'b001100xx: stat1;
8'b1100xx00: stat2;
8'b00xx0011: stat3;
8'bxx010100: stat4;
endcase
I just wonder if r^mask=00110011, then I think it satisfied the condition of stat1 and stat3, but I guess there should be just one statement being excuted,which statement will be excuted? stat1 or state3? Why? Thank you.