1

Is there any way to find the bitwise operations value in manual calculation. such as school math without binary calculations.... for example c=a&b; to find the results of c I need some elementary school math calculation.

1 Answers1

1

Let's say that a = 12 and b = 7. We're using small numbers to illustrate the process.

Write out the values in binary bits

12 - 1100
 7 - 0111
     ----
     0100

If a column has all 1's (ones), bring the 1 down as the answer. Otherwise, the answer is 0 (zero).

Binary 0100 = decimal 4.

So 12 & 7 = 4.

If you are using bigger numbers, group the bits in groups of 4 to make it easier to convert decimal numbers to hexadecimal, then binary and to convert the binary answer back to hexadecimal and then decimal.

Gilbert Le Blanc
  • 50,182
  • 6
  • 67
  • 111