The Dec VAX computer did not have instructions for Boolean o

The Dec VAX computer did not have instructions for Boolean operations and, or, instead, it had instructions bis and bic, both of which take data word x and a mask word m and generated a result z, which consisted of the bits of x modified by the bits of m. For bis, the modification sets the bits of z to 1 at each position m is 1. For bic the modification sets the bits of z to 0 where ever m is 1. (a) Find the Boolean function (in disjunctive normal form), implemented by (i) bis (ii) bic. (b) Implement the bitwise operator xor only using bis and bic (write it as a C function).

Solution

Truth table :

x      m          bis        bic

0      0           0          0

0      1           1          0

1       0         1           1

1      1          1          0

1)Boolean function (in DNF) implemented by bis,bic

bis(x,m) = .m +x. +x.m = (+x).m + x. = x+m

bic = (x,m) = x.

2) bitwise operator XOR using bis and bic

since as above   bis(x,m) = x+m

                        bic(x,m) = x.

and using    x^y = x. +.y

x^y = bis(bic (x,y),bic(y,x))

 The Dec VAX computer did not have instructions for Boolean operations and, or, instead, it had instructions bis and bic, both of which take data word x and a m

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site