+0  
 
0
45
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

Guest Oct 6, 2017
Sort: 

1+0 Answers

 #1
avatar+17613 
+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.

geno3141  Oct 6, 2017

20 Online Users

avatar
avatar
avatar
avatar
avatar
avatar
We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.  See details