Professional Documents
Culture Documents
TECHNOLOGY
INSTITUTE OF SCIENCE AND TECHNOLOGY
CS 8235
Addition
Subtraction
Multiplication
Division
7’s AND 8’s COMPLEMENT ARITHMETIC
The 7’s complement of an octal number can be found by subtracting
each digit in the number from 7.
8’s complement can be obtained by subtracting the LSB from 8 and
the rest of each digit in the number from 7.
The 7’s and 8’s complement of the octal digits 0 to 7
is shown in Table below.
Subtraction Using 7’s Complement
Ex.1: Subtract (372)8 from (453)8 using the 7’s complement method. Also
subtract using the direct method and compare.
Ex.2: Subtract (453)8 from (372)8 using the 7’s complement method. Also
subtract using the direct method and compare.
In the direct method, whenever a larger number is
subtracted from a smaller number, the result obtained is in
8’s complement form and opposite in sign.
To get the true result we have to discard the carry and make
the 8’s complement of the result obtained and put a negative
sign before the result.
Subtraction Using 8’s Complement
Ex.1: Subtract (256)8 from (461)8 using the 8’s complement method. Also
subtract using the direct method and co
Ex.2: Subtract (461)8 from (256)8 using the 8’s complement method. Also
subtract using the direct method and compare.
In the direct method, whenever a larger number is subtracted
from a smaller number, the result obtained is in 8’s complement
form and opposite in sign.
To get the true result we have to discard the carry and make the
8’s complement of the result obtained and put a negative sign
before the result.
DECIMAL ARITHMETIC
Addition
Subtraction
Multiplication
Division
9’s AND 10’s COMPLEMENT ARITHMETIC
The 9’s complement of a decimal number can be found by
subtracting each digit in the number from 9.
The 10’s complement can be obtained by subtracting the LSB
from 10 and the rest of each digit in the number from 9.
The 9’s and 10’s complement of the decimal digits 0 to 9 is shown
in Table below.
• The method of subtraction using 9’s complement method is the same as
1’s complement method in a binary system.
• Here also the carry obtained is added to the result to get the true result.
• As like in the previous cases, if the minuend is larger than the
subtrahend, no carry is obtained and the result is obtained in 9’s
complement form.
• To get the true result we have to again get the 9’s complement of the
result obtained and put a negative sign before it.
• Similarly, the method of subtraction using 10’s complement method is
the same as 2’s complement method in a binary system.
• Here also the carry obtained is discarded to get the true result.
• And as in the previous cases, if the minuend is larger than the
subtrahend, no carry is obtained and the result is obtained in 10’s
complement form.
• To get the true result we have to again get the 10’s complement of the
result obtained and put a negative sign before it.
Subtraction Using 9’s Complement
Ex.1: Subtract (358)10 from (592)10 using the 9’s complement method. Also
subtract using the direct method and compare.
Ex.2: Subtract (592)10 from (358)10 using the 9’s complement method. Also
subtract using the direct method and compare.
Subtraction Using 10’s Complement
Ex.1: Subtract (438)10 from (798)10 using the 10’s complement method.
Also subtract using the direct method and compare.
Ex.2: Subtract (798)10 from (438)10 using the 10’s complement method. Also
subtract using the direct method and compare.
HEXADECIMAL ARITHMETIC
Addition
Subtraction
Multiplication
Division
15’s AND 16’s COMPLEMENT ARITHMETIC
The 15’s complement of a hexadecimal number can be found by
subtracting each digit in the number from 15.
The 16’s complement can be obtained by subtracting the LSB from 16
and the rest of each digit in the number from 15.
The 15’s and 16’s complement of the hexadecimal digits 0 to F is
shown in Table below.
The method of subtraction using 15’s complement method is the same
as 9’s complement method in a decimal system.
Here also the carry obtained is added to the result to get the true result.
And as in the previous cases, if the minuend is larger than the
subtrahend, no carry is obtained and the result is obtained in 15’s
complement form.
To get the true result we have to again get the 15’s complement of the
result obtained and put a negative sign before it.
Similarly, the method of subtraction using 16’s complement method is
the same as 10’s complement method in a decimal system.
Here also the carry obtained is discarded to get the true result.
And as in the previous cases, if the minuend is larger than the
subtrahend, no carry is obtained and the result is obtained in 16’s
complement form.
To get the true result we have to again get the 16’s complement of the
result obtained and put a negative sign before it.
Subtraction Using 15’s Complement
Ex.1: Subtract (2B1)16 from (3A2)16 using the 15’s complement method.
Also subtract using the direct method and compare.
Ex.2: Subtract (3A2)16 from (2B1)16 using the 15’s complement method. Also
subtract using the direct method and compare.
In the direct method, whenever a larger number is subtracted from a
smaller number, the result obtained is in 16’s complement form and
opposite in sign.
To get the true result we have to discard the carry and make the
16’s complement of the result obtained and put a negative sign
before the result.
Subtraction Using 16’s Complement
Ex.1: Subtract (1FA)16 from (2DC)16 using the 16’s complement method. Also
subtract using the direct method and compare.
Ex.2: Subtract (2DC)16 from (1FA)16 using the 16’s complement method.
Also subtract using the direct method and compare.
BCD ADDITION
• The full form of BCD is Binary Coded Decimal.
• In this code, each decimal digit from 1 to 9 is coded in 4-bit binary
numbers.
• But with 4-bit binary sixteen different groups can be obtained,
whereas we require only ten groups to write BCD code.
• The other six groups are called forbidden codes in BCD and they
are invalid for BCD.
BCD ADDITION
• BCD is a numerical code.
• Many applications require arithmetic operation.
• Addition is the most important of these because the other three
operations, viz. subtraction, multiplication, and division, can be
performed using addition.
BCD ADDITION
There are certain rules to be followed in BCD addition as given below.
1. First add the two numbers using normal rules for binary addition.
2. If the 4-bit sum is equal to or less than 9, it becomes a valid BCD
number.
BCD ADDITION
3. If the 4-bit sum is greater than 9, or if a carry-out of the group is
generated, it is an invalid result.
In such a case, add (0110)2 or (6)10 to the 4-bit sum in order to
skip the six invalid states and return the code to BCD.
If a carry results when 6 is added, add the carry to the next 4-bit
group.
Add the following BCD numbers:
(a) 0111 and 1001 and (b) 10010010 and 01011000.
BCD SUBTRACTION
In order to subtract any number from another number we have to add the
9’s complement of the subtrahend to the minuend.
Also, we can use the 10’s complement to perform the subtraction
operation.
Carry out BCD subtraction for (893) – (478) using 9’s
complement method.
Carry out BCD subtraction for (768) – ( 274) using 10’s
complement method.