E
easily_confused
On a 32 bit machine, ~0<<32 gives 11111111111111111111111111111111 (I was
expecting 0)
(~0<<31)<<1 gives 0.
I was trying ~(~0<<$size) to create a mask of $size ones.
((1<<$size) -1) was what I tried first but it also failed for the same
reason, I guess.
I like that in verilog I can just say {$size{1'b1}}
I know I can use Math::BigInt, but I still wonder what the rationale is
behind the first example failing.
EC
expecting 0)
(~0<<31)<<1 gives 0.
I was trying ~(~0<<$size) to create a mask of $size ones.
((1<<$size) -1) was what I tried first but it also failed for the same
reason, I guess.
I like that in verilog I can just say {$size{1'b1}}
I know I can use Math::BigInt, but I still wonder what the rationale is
behind the first example failing.
EC