Comprog1 - Module 4
Comprog1 - Module 4
GRADE
11
Name: _______________________________________________________________________
After this lesson, you will be able to answer the following question:
How to perform Binary Arithmetic operations
LESSON PROPER
Binary Addition
Rules for Binary
Just like adding decimal numbers, you have to align the addends. Addition:
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 0+0=0
as a part of the total sum and the most significant figure is carried to 0+1=1
the left adjacent column.
1+0=1
1+1=10 (0, Carry 1)
Example
STEPS
Step 1: 0+1=1
Step 2: 1+1=0, carry 1 to the left adjacent column then
Step 3: We will start from the carry. 1+0=1 then, 1+1=0, carry 1
Step 4: We will start from the carry. 1+1=0, carry 1 then, 0+1=1
Step 5: We will start from the carry. 1+1=0, carry 1
Step 6: We will start from the carry. 1+1=0, carry 1
Step 7: Bring down the carry which is 1. 2
Note: Do not forget to put the base (2).
1
Example
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.
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
2
Binary Division
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.
3
ACTIVITIES
A B C
1111 1011 11011
+ 1001 + 1101 + 11101
D E
101101 101111
+ 110011 + 111011
A B C
1111 11011 111011
-1001 - 1101 -11101
D E
101111 101111
- 1011 - 11011
4
III Perform Binary Multiplication
A B C
A B
10 11000 10 10100
REFERENCES:
Innovative Training Works, Inc. (2016) Computer Programming Vol. 1, Rex Bookstore Inc. Rex
Publishing Inc.