cornell-brg / pymtl

Python-based hardware modeling framework
BSD 3-Clause "New" or "Revised" License
235 stars 82 forks source link

Bit operations (and, or, xor) between a Bits and integer literal won't perform bit extension if literal is longer #108

Open cbatten opened 9 years ago

cbatten commented 9 years ago
>>> a = Bits( 4, 0b1010 )
>>> b = Bits( 6, 0b110011 )
>>> a & b
Bits( 6, 0x02 )
>>> a & 0b110011
Bits( 4, 0x02 )

It looks like 0b110011 is implicitly converted into a 4-bit Bits object, but I wonder if it shouldn't be converted into a 6-bit Bits object?