Binary Addition

We have looked at how to convert denary (decimal) to binary, next we need to learn how to add binary numbers.


 Adding Denary  Adding Binary
 12345
+  154
 12499
 
 10010
+  101
 10111
  98114
+   899 
 99013
   111   carry over
 10011
+  111
 11010
   11    carry line

The largest number that can be represented by 8 bits is 255 (128 + 64 + 32 + 16 + 8 + 4 + 2 + 1)


When adding binary numbers together if they exceed 255 then you will need 9 bits to store the number. A computer stores data in a finite amount of space called memory. If you don't have sufficient memory then we get an overflow. Overflows can cause errors in calculations using the number that has been sotred in memory.


For example:

 Denary  Binary
 252
   15 +
 267
  11111100 
  00001111 +
100001011

You can see this number is longer than the 8 bits / 1 byte we have for storage in the memory, this causes an overflow.

Q. What is the largest denary number you can represent with 4 bits?

Q. What is the largest denary number you can represent with 2 bytes?