We can do arithmetic operations with binary numbers just like we do with decimals. Simple enough, arithmetic operations can be very straightforward we just need to follow some rules and concentration. Since we work only with two digits 0 and 1 some operations can be challenging, however a bit of concentration will allow your logic to clear its path. So lets see how electronic machines actually do math on their way.
Before we do some operations take a look at the table below and see how addition on binary numbers is not like normal decimals. Simple enough because in binary 1 + 1 is not equal to 2 right. We only work with two digits 0 and 1 and in binary there is no number 2.
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 1
This may sound odd, but in binary 1 + 1 = 1. Actually this is not often true. We will see why when we do operations with larger binary numbers. Take a look at the example below.
Let us break in detail. We start adding numbers like we do with decimals. Start with the first number and the first digit from the right that is 0. We add that digit with the first right digit of the second number that being 0. And 0 + 0 = 0. So lets continue with the second digits. 1 + 1 = 1 in binary when we have addition like this we write 0 and we carry 1. That is actually 10 but we write 0 and carry 1 just like we do with decimals. Take a look at the picture below where we describe the steps of solving the equation above.
Lets take another example.
The logic goes same here. Even if we have to carry many bits we continue till we have none to carry. If you practice some examples you will get used to adding binary numbers. The problem can be challenging when we carry bits but some concentration will keep you in straight way. Again the picture below shows the steps for the equation above. See how bits are carried along nearest digits and then added with the result.
Binary operations can be useful. If you want to understand how electronic machines logic and then you must learn how to operate with binary numbers. Computers brain the CPU does logical operation like this. Every electronic chip uses binary to do tasks that is designed for. For curiosity if you didn't know, every CPU only knows how to Add and Substract. You may ask how can i play my RPG game if the CPU does only addition and substraction. Well that is a very long story to cover, but know everything is done upon addition and substraction.
Suggested Article : Boolean Algebra - Digital Logic