Lesson 5 Binary Arithmetic Operations
Lesson 5 Binary Arithmetic Operations
2
BINARY ARITHMETIC OPERATIONS
In most arithmetic and logic unit (ALU) hardware, the operating numbers are
stored in a fixed number of bits. Therefore, an exact limit or error is performing binary
arithmetic on computers, and this binary arithmetic is called fixed-precision arithmetic.
We will discuss binary arithmetic from the logic design perspective in this part
of the module. In this part of the discussion, you should know four basic arithmetic
processes to understand the binary arithmetic operation easily.
Arithmetic Operations
4 Arithmetic Operations
1. Binary Addition
2. Binary Subtraction
3. Binary Multiplication
4. Binary Division
Binary Addition
▪ The rules are:
➢ 0 + 0 is equal to 0
➢ 0 + 1 is equal to 1
➢ 1 + 0 is equal to 1
➢ 1 + 1 is equal to 1 0
FUNDAMENTALS OF COMPUTING 2020
Step 1 — In the first step, we must write two binary numbers. Write one number in the
top to another number. The alignment should be made appropriately.
Step 2 — In the second step, we must start from the right side. Then we can add the
two binary numbers.
Step 3 — If any carry comes means, it must be added to the next digit numbers.
By using the following rules, we can do the binary addition.
Solution:
Step 1 1 1 0 1
Arrange the given. + 1 1 1 1
Step 2
REMAINDER
1
1 1 0 1 Note that in the binary addition rules
+ 1 1 1 1 1+1=0 provided that you will add 1 as
0 remainder on the upper part of the
next column on the left side.
1 1 REMAINDER
1 1 0 1 Since 1 is the answer on the first two
1
rows on the second column, you will add
+ 1 1 1 1
the binary number on the third line which
0 0
is also 1. Note that 1 + 1 = 0 remainder
1 on the upper part of the next column
on the left side.
REMAINDER
The remainder 1 on the previous step will
1 1 1 become a part of the next column on the left
1 1 0 1 side. Go back to the binary addition rules, it
1
+ 1 1 1 1 indicates there that 1 + 1 = 0 if you will add 1 as
0 0 remainder on the upper part of the next column
on the left side.
1 1 1
1 1 0 1 Since 0 is the answer on the first two
0 1 rows on the third column, you will add
+ 1 1 1 1 the binary number on third line which is
1 0 0 1. Note that 0 + 1 = 1.
REMAINDER
The remainder 1 on the previous step will become
1 1 1 1 a part of the next column on the left side. Go back
1 1 0 1 to the binary addition rules, it indicates there that 1
0 1 + 1 = 0 if you will add 1 as remainder on the upper
+ 1 1 1 1 part of the next column on the left side.
1 0 0
1 1 1 1
1 1 0 1 Since 0 is the answer on the first two rows
0 0 1 on the fourth column, you will add the binary
+ 1 1 1 1 number on the third line which is 1. Note that
1 1 0 0 0 + 1 = 1.
1 1 1 1
1 1 0 1
0 0 1 Last step brings down the remainder on the
+ 1 1 1 1 fifth column. If ever that the next column has
1 1 1 0 0 no binary number, it assumes that there
exist a binary number which is 0.
1 1 1 1
1 1 0 1 The final answer for 1101
0 0 1 plus 1111 is equal to 11100.
+ 1 1 1 1
1 1 1 0 0
Solution:
Step 1
Arrange the given.
101111
+ 111000
Step 2
Step 3
Continue the process according to the
101111 rule: 1 plus 0 is 1 and it is the same
+ 111000 scenario until the third column from right
11 1 to left.
Binary Subtraction
➢ 0–0=0
➢ 1–0=1
➢ 1–1=0
➢ 0 – 1 = 1 (with a borrow of 1)
Step 2 — In the second step, we must start from the right side. Then we can subtract
the two binary numbers.
Step 3 — If "0 minus 1" exist, then the answer is 1 if you will borrow 1 on the next
column on the left side.
Solution:
Step 1
Step 2
Step 3
0 10
1 1 0 1 Since 0 borrow 1 from the third
column first row it now
- 1 0 1 1 becomes 0. By looking back to
0 1 0 the binary subtraction rules, 0
– 0 = 0.
0 10
1 1 0 1
Lastly, 1 – 1 = 0.
- 1 0 1 1
0 0 1 0
0 10
1 1 0 1
The final answer for 1101 minus
- 1 0 1 1 1011 is equal to 0010.
0 0 1 0
Step 1
Arrange the given. 1 0 0 1
- 1 1 1 0
Step 2
1 0 0 1 By looking back to the
binary subtraction
- 1 1 1 0 rules, 1-0 = 1.
1
Step 3
In the binary subtraction rules, 0
0 10
– 1 = 1 provided that 0 can borrow
1 0 0 1
to the first row on the next
- 1 1 1 0 column. So now 0 will become
1 1 10.
0 1 10
The next 0 will borrow to the
1 0 0 1
binary number next to it which is
- 1 1 1 0 1, so the second 0 which is the
0 1 1 second borrower will become 1
and the last binary number 1 will
become 0.
0 1 10
0 – 1 = 0: according to the rule the
1 0 0 1
answer is 0 but it cannot be done
- 1 1 1 0 by just putting the binary number
0 1 1 0 as the answer on the last
column because the rule also
indicates that the answer will only
become 0 provided that it can
borrow to the binary next to it. But
there’s no binary number follows.
When it happens, there is an
0 1 10 alternative solution.
1 0 0 1 Disregard if no more digit on the
- 1 1 1 0 next column, get the opposite bit
0 1 1 then add one (1).
Binary Multiplication
➢ 0x0=0
➢ 0x1=0
➢ 1x0=0
➢ 1x1=1
Step 1: In the first step, we must write two binary numbers. Write one number in the
top to another number. The alignment should be appropriately made.
Step 2: In the second step, multiply the first column in the second row to all the bit
entry on the first row like the decimal multiplication process.
Step 3: Repeat step 2 until the last multiplier of bit on the second row.
By using the following rules, we can do the binary multiplication.
Solution: 1 0 1 1
Step 1 X
1 1 0 1
Arrange the given.
1 0 1 1
X
1 1 0 1
1 0 1 1
1
00 0 0
1
101 1 Using the binary addition rules, you’ll
1
get the final answer of 10001111.
1011 _
10001 1 1 1
Binary Division
The binary numbers' division process is carried out in the simple division,
while the binary numbers are subtracted in their 2 - complemented notations.
Solution:
ANSWER
1 If you look back to the
11 111011 definition, it’s written there that
it is done by simple division.
You only need to justify if the
divisor is fitted to the dividend,
if yes, the answer will be 1.
DIVISOR ANSWER
1 Multiply the answer to the
11 111011 divisor to move on to the next
1 1
step. The answer should be at
the lower part of the dividend.
1
11 1 1 1 0 1 1
1 1 _ Subtract the answer to the
0 0 1 dividend. If the answer is all 0,
then it is better not to write it
and move to the next bit.
ANSWER
10011
11 1 1 1 0 1 1
1 1 _ Do the same processes
1 until you reach the last bit of
0 _ the dividend.
10
0 _
10 1
1 1_
1 0 1
1 1 If the last answer is not all
1 0 0, then it will declare as
remainder.
FINAL ANSWER: 10011 r. 10
Example 2: Find
Solution:
1
Divide 1100 by 100; since the divisor has
100 1100 3 digits only, we will use the first 3 digits
of the dividend. The dividend 110 is
divisible by 100, so the answer is 1.
1
Multiply your answer to the divisor, write
100 1100 the quotient under the dividend
1 0 0__ accordingly, and subtract the dividend
100 quotient.
11
Repeat the steps, divide the present
100 1100 dividend to the divisor. The dividend 100
1 0 0__ is divisible by 100, so the answer is 1.
100