SynaptiCAD Tutorials

(TT) 6: Bit-slices and the Boolean operators

(TT) 6: Bit-slices and the Boolean operators

Previous topic Next topic  

(TT) 6: Bit-slices and the Boolean operators

Previous topic Next topic  

and_ with_bitslice = {BUS[1:0] & BUS[3:2]}

This assertion uses the bit slice operator to AND together the two least significant bits of BUS with the next two bits of BUS. The result of this operation is considered true if the value is greater than 0, so for Boolean truth, it is equivalent to: {(BUS[1] & BUS[3]) | (BUS[0] & BUS[2])}

The assertion matches at time 600 (when BUS has a value of 5, so BUS[3:2] =’b01 and BUS[1:0]=’b01) and at time 800 (when BUS has a value of 7, so BUS[3:2] =’b01 and BUS[1:0]=’b11).

With_bitslice