Binary is a number system in which there are only two values for each digit, the 0 and 1. Binary numbers or base 2 numbers is the only number system that is used by computers. Aside from computers, binary is also commonly used in electronic devices like mobile phones, remote controls, even calculators and simple electronics like integrated circuits. People in the technology industry should at least know the basics of binary and how to perform addition, subtraction, multiplication and division. All operations in decimal system (addition, subtraction, multiplication and division) are also possible in the binary system.
Binary Addition
Adding binary numbers is just like adding decimal numbers. But in binary addition you will only use two digits, 0 and 1.
Rules for Binary Addition:
0+0=0
0+1=1
1+0=1
1+1=10 (0, Carry 1)
Just like adding decimal numbers, you have to align the addends. Then, start adding the bits from right to left. When the sum in one column is two-bits (two digits in decimal), the least significant is written as a part of the total sum and the most significant figure is carried to the left adjacent column.
Example 1:
STEPS
Step 1: 0+0=0
Step 2: 1+0=1
Step 3: 1+1=0, carry 1
Step 4: Bring down the carry which is 1.
Example 2:
STEPS
Step 1: 1+1=0, carry 1
Step 2: 1+1=0, carry 1 to the left adjacent column then, 0+1=1
Step 3: We will start from the carry. 1+0=1 then, 1+0=1
Step 4: 1+0=1
Step 5: 1+1=0, carry 1
Step 6: Bring down the carry which is 1.
Note: Don’t forget to put the base (2).
Binary Subtraction
Rules for Binary Subtraction:
0-0=0
1-0=1
1-1=0
10-1=1 (Borrow 1 from the left adjacent column)
Binary subtraction is like subtraction in decimal. But in the last rule, it maybe new to you. In binary, it is 10 is not read as “ten” it is “one, zero” or “two”. Remember that if you are subtracting 1 from 0 you need to borrow from its next column.
Example 1:
STEPS
Step 1: 0-0=0
Step 2: 0-0=0
Step 3: 1-0=1
Step 4: 1-1=0
Example 2:
Step 1: 1-0=1
Step 2: 0-1=1 (borrow 1 bit from the left adjacent column to make it 10)
Step 3: 1-0=1
Step 4: 10-1=1 (borrow 1 bit from the left adjacent column to make it 10)
Step 5: 0-0=0
Note: 10 is equal to 2 that is why 10-1=1.
Binary Multiplication
In binary multiplication, it has only 3 rules, (0x0=0, 0x1=0 and 1×1=1). Just as in decimal, any digit that is multiplied by 1, the answer is the number itself and any number that is multiplied by 0, the answer is 0.
Note: There will be no carries and overflow of bits in Binary Multiplication.
Example 1:
Step 1: 101×0=000
Step 2: 101×0=000
Step 3: 101×1=101
Step 4: After getting the product of each digits, you will now get the sum of all the products.
Step 5: Bring down 0
Step 6: 0+0=0
Step 7: 0+0+1=1
Step 8: 0+0=0
Step 9: Bring down 1.
Example 2:
Step 1: 11011011×1=11011011
Step 2: 11011011×0=00000000
Step 3: 11011011×1=11011011
Step 4: After getting the product of each digits, you will now get the sum of all the products.
Step 5: Bring down 1.
Step 6: 1+0=1
Step 7: 0+0+1=1
Step 8: 1+0+1=0, carry 1
Step 9: 1+1=0, carry 1, 0+0=0
Step 10: 1+0+0+1=0, carry 1
Step 11: 1+1=0, carry 1, 0+0=0, 0+1=1
Step 12: 1+1=0, carry 1, 0+0+0=0
Step 13: 1+0+1=0, carry 1
Step 14: 1+1=0, Carry 1
Step 15: Bring down 1
Note: Don’t forget to put base (2).
Binary Division
In binary division, we will be using the long division process. It is easy to understand specially for newbies. Binary division is a repeated subtraction process. So let’s start.
Position the dividend and the divisor for the long term division process.
Compare the divisor to the first bit in the dividend, if the divisor is bigger than the dividend then, add another one bit until the divisor is lesser than the dividend.
101>1, add another 1-bit
101>11, Add again another 1-bit
101<111, get the quotient of this term.
Since, 101 goes into 111 we will put 1 in the quotient above. It can only goes once that is why we have 1 above. Then, Multiply: 101×1=101 (recall the binary multiplication process). Whatever will be the product you will subtract it to the dividend. Just like in the example above. Bring down the next bit which is 0 to make it 100. Just repeat the process above until you finish the problem.
Finally, we have now the quotient for 11100110/101. 101110 base 2.