Binary Numbers
Binary Numbers
Binary Numbers
Basic mathematical operations with binary numbers works similar to the decimal system.
However there are a few rules specific to the binary system. We’ll look at each of them
individually.
Binary Addition
Binary addition is one of the operations of binary operations concept. To recall, the term
“Binary Operation” represents the basic operations of mathematics that are performed on two
operands. Basic arithmetic operations like addition, subtraction, multiplication, and division
play an important role in mathematics. In this lesson, all the concepts about binary addition are
explained which includes:
Definition
Rules
Method
table
Examples
Using 1’s complement
0+0=0
0+1=1
1+0=1
1 + 1 =10
Step 1: First consider the 1’s column, and add the one’s column,( 1+1 ) and it gives the
result 10 as per the condition of binary addition.
Step 2: Now, leave the 0 in the one’s column and carry the value 1 to the 10’s column.
1
101
(+) 101
————–
0
Step 3: Now add 10’s place, 1+( 0 + 0 ) = 1. So, nothing carries to the 100’s place and
leave the value 1 in the 10’s place
1
101
(+) 101
————-
10
Step 4: Now add the 100’s place ( 1 + 1 ) = 10. Leave the value 0 in the 100’s place and
carries 1 to the 1000’s place.
1
101
(+) 101
————-
1010
So, the resultant of the addition operation is 1010.
When you cross-check the binary value with the decimal value, the resultant value should be
the same.
The binary value 101 is equal to the decimal value 5
So, 5 + 5 = 10
The decimal number 10 is equal to the binary number 1010.
x y x+y
0 0 0
0 1 1
1 0 1
You can see from the above table, x and y are the two binary numbers. So when we give the
input for x = 0 and y = 0, then the output is equal to 0. When x = 0 or 1 and y = 1 or 0, then x+y =
1. But when both x and y are equal to 1 then their addition equals to 0 but the carryover
number will equal to 1, which means basically 1 + 1 = 10 in binary addition, where 1 is carry
forwarded to the next digit.
Binary subtraction is another basic binary operation. The basic operations in mathematics are
addition, subtraction, multiplication, and division. To recall, binary operation represents the
operations of mathematics that are performed on two operands and the result is obtained.
Here, the topic of a binary subtraction operation is explained in detail. The concepts that are
included in this lesson are:
0–0=0
0 – 1 = 1 ( with a borrow of 1)
1–0=1
1–1=0
Now, look at the example of the binary subtraction: 101 from 1010
Step 4: Now subtract the values in 100’s place. Borrow 1 from the 1000’s place ( 0 – 1 ) =
1.
1 1 Borrow
1010
(-) 1 0 1
——————
0101
So, the resultant of the subtraction operation is 0101.
When you cross-check the binary subtraction resultant value with the decimal value, the
resultant value should be the same.
The binary value 1010 is equal to the decimal value 10 and 101 is equivalent to 5
So, 10 – 5 = 5
Therefore, the decimal number 5 is equal to the binary number 0101.
0×0=0
0×1=0
1×0=0
1×1=1
Division
Binary division is similar to decimal division. The only difference is that in decimal system, since
we are dividing traditional numbers, the dividend (or portion of it) can be 0, 1 or more than 1
times of the divisor. However in binary, it can only be 0 or 1 times, i.e. the dividend (or portion of
it) is >= or < than the divisor.
Let’s try dividing 6 by 3. Binary of 6 is 110 and that or 3 is 11. Following decimal division
convention
1. We check for a portion of dividend from its left that is >= the divisor.
2. Then we subtract the multiple of the divisor that is <= the portion of the dividend. The
multiplier (1) gets appended to the quotient and result of the subtraction is the remainder.
3. We bring down 1 bit at the time (going left to right) for the remaining portion of the
dividend and check if the expression (remainder + brought down bit) is >= the divisor. If not,
we append 0 to the quotient, or else we follow step 2 again.
2. Is 11 (left 2 most bits of 110) >= 11. Yes. We add 1 (multiplier) to the quotient, and subtract
11 from 11. That gives us a remainder of 0. Note, we are subtracting “one-one from one-
one NOT eleven from eleven”.
3. Now we bring down the remaining bit (0) from 110. Is 0 >= 11. No. So we append 0 to the
quotient.
Since we have no more bits remaining in the dividend, we stop here and check. Our remainder is
0 and quotient is 10 (binary) = 2.
Division can become more complicated with signed numbers, and floating point binary numbers
(not covered in this tutorial).