Welcome to NRICH.

 
Adding in binary


By Jeff Mills on Monday, October 22, 2001 - 12:56 pm:

Can any one out there explain to me how to add 8 bit binary numbers together eg 01001111 + 00110111


By Julian Pulman on Monday, January 07, 2002 - 05:09 pm:

Binary Numbers are such that they work essentially to the base 2 (bi meaning 2), so if the magnitude of a digit reachs 2 you move it a digit to the left:
e.g
0 = 0
1 = 1
2 = 10
3 = 11
4 = 100
5 = 101
6 = 110
and so on.
so 01001111=2 + 4 + 8 + 16 + 128=158
00110111 = 2 + 4 + 8 + 32 + 64 = 110
so their sum is 268 = 256 + 12 = 256 + 8 + 4 == 10000110


By James Oldfield on Tuesday, January 08, 2002 - 03:26 am:

Actually, you don't need to convert binary numbers to decimal to add them up: you can just use the usual method of adding and carrying digits. i.e.:

units (1's): 1+1=10 so 0, carry the 1
2's: 1+1+1=11 (including the carried 1) so 1, carry the 1
... etc...
256's: 0+0+1=1 (including a carried 1 from the 128's) so 1.

Of course you would be better off writing it like a decimal sum:

..01001111
+00110111
-------------
with the answer and carried 1's here.