what is the difference between casex
and casez
in Verilog
?
I have searched about it and find this sentence :
casez treats all z values in the case alternatives or the case expression as don't cares. All bit positions with z can also represented by ? in that position.
casex treats all x and z values in the case item or the case expression as don't
cares.
for example , what is the difference between first one and second one:
1-
casez (instr)
7'b1zzzzzzz: // arithmetic
7'b01zzzzzz: // load-reg
7'b00zzzzzz: // store-reg
endcase
2-
casex (instr)
7'b1zxxxxzz: // arithmetic
7'b01zzxxxx: // load-reg
7'b00xxxzzz: // store-reg
endcase