+0  
 
0
11
5154
1
avatar

Find the bitwise OR, bitwise AND and bitwise XOR of each of these pairs of bit strips? (a) 00 0111 0001 (b) 11 1111 1111 10 0100 1000 00 0000 0000

 Oct 6, 2017
 #1
avatar+23246 
+1

The definitions:

0 OR 0  =  0          0 AND 0  =  0          0 XOR 0  =  0

0 OR 1  =  1          0 AND 1  =  0          0 XOR 1  =  1

1 OR 0  =  1          1 AND 0  =  0          1 XOR  0  =  1

1 OR 1  =  1          1 AND 1  =  1          1 XOR 1  =  0

 

To calculate the answer, combine the bit of one string with the corresponding bit of the other strip using the above definitions.

 

If I understand your question correctly:  (adding 0s to front of (a) to make both strings the same length)

 

     bitwise  (a) OR (b)     00 0000 0000 00 0000 0000 00 0111 0001

                                       11 1111  1111  10 0100 1000 00 0000 0000

                                       -------------------------------------------------------

                                       11 1111  1111  10 0100 1000 00 0111 0001

 

   bitwise  (a) AND (b)     00 0000 0000 00 0000 0000 00 0111 0001

                                       11 1111  1111  10 0100 1000 00 0000 0000

                                       -------------------------------------------------------

                                       00 0000 0000 00 0000 0000 00 0000 0000

 

   bitwise  (a) XOR (b)    00 0000 0000 00 0000 0000 00 0111 0001

                                       11 1111  1111 10 0100 1000 00 0000 0000

                                       -------------------------------------------------------

                                       11 1111  1111 10 0100 1000 00 0111 0001

 

If the 0s are to be attached to the end of (a), then repost the question.

 Oct 6, 2017

6 Online Users

avatar
avatar
avatar