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.
Asked
Active
Viewed 527 times
1 Answers
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
-
Actually binary 0100 is decimal 4 as far as I know... – Blablablaster May 03 '13 at 16:55
-
@Blablablaster: Thanks for the correction. That's what I get for doing binary conversions in my head. – Gilbert Le Blanc May 03 '13 at 16:57
-
But isn’t that exactly the kind of binary operations that is not wanted according to the question? – Joachim Breitner May 03 '13 at 17:00
-
actually I need some decimal calculation... is there any way? – Md. Shahadat Sarker May 03 '13 at 17:01
-
@Joachim Breitner: I don't know of any way to do bit logical operations without using bits. If anyone does know, go ahead and answer. – Gilbert Le Blanc May 03 '13 at 18:12
-
Then the answer would be „no“, wouldn’t it? – Joachim Breitner May 03 '13 at 19:37
-
I think the answer is no, not sure as well how to answer this as we need to convert it to binary first. Have a look at this site, it explains and has a calculator as well: http://www.bitwiseoperatorcalculator.com – jonprasetyo Sep 20 '14 at 18:35