(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
Number system arithmetic
1. NUMBERING SYSTEM
PREPARED BY
RENATUS KATUNDU
NUMBER SYSTEM ARITHMETIC
Binary Addition
Adding two binary numbers together is easy, keeping in mind the following four addition
rules:
(1) 0 + 0 = 0
(2) 0 + 1 = 1
(3) 1 + 0 = 1
(4) 1 + 1 = 10
Consider the following binary addition problems and note where it is necessary to carry the 1:
2. Subtraction Using Complements
The operation is carried out by means of the following steps:
(i) At first, 2’s complement of the subtrahend is found.
(ii) Then it is added to the minuend.
(iii) If the final carry-over of the sum is 1, it is dropped and the result is positive.
(iv) If there is no carry over, the two’s complement of the sum will be the result and it is
negative.
The following examples on subtraction by 2’s complement will make the
procedure clear:
Evaluate:
(i) 110110 - 10110
Solution:
The numbers of bits in the subtrahend is 5 while that of minuend is 6. We make the number
of bits in the subtrahend equal to that of minuend by taking a `0’ in the sixth place of the
subtrahend.
3. Now, 2’s complement of 010110 is (101101 + 1) i.e.101010. Adding this with the minuend.
1 1 0 1 1 0 Minuend
1 0 1 0 1 0 2’s complement of subtrahend
Carry over 1 1 0 0 0 0 0 Result of addition
After dropping the carry-over we get the result of subtraction to be 100000.
(ii) 10110 – 11010
Solution:
2’s complement of 11010 is (00101 + 1) i.e. 00110. Hence
Minued - 1 0 1 1 0
2’s complement of subtrahend - 0 0 1 1 0
Result of addition - 1 1 1 0 0
As there is no carry over, the result of subtraction is negative and is obtained by writing the
2’s complement of 11100 i.e.(00011 + 1) or 00100.
Hence the difference is – 100.
(iii) 1010.11 – 1001.01
Solution:
2’s complement of 1001.01 is 0110.11. Hence
Minued - 1 0 1 0 . 1 1
2’s complement of subtrahend - 0 1 1 0 . 1 1
Carry over 1 0 0 0 1 . 1 0
After dropping the carry-over we get the result of subtraction as 1.10.
(iv) 10100.01 – 11011.10
Solution:
4. 2’s complement of 11011.10 is 00100.10. Hence
Minued - 1 0 1 0 0 . 0 1
2’s complement of subtrahend - 0 1 1 0 0 . 1 0
Result of addition - 1 1 0 0 0 . 1 1
As there is no carry-over, the result of subtraction is negative and is obtained by writing the
2’s complement of 11000.11.
Hence the required result is – 00111.01.
Additional examples:
5.
6. Octal Addition
Octal addition is performed just like decimal addition, except that if a column of two addends
produces a sum greater than 7, you must subtract 8 from the result, put down that result, and
carry the 1. Remember that there are no such digits as "8" and "9" in the octal system, and that
810 = 108 , 910 = 118, etc.
Evaluate:
(i) (162)8 + (537) 8
Solution:
1 1 <---- carry
1 6 2
5 3 7
8. Octal Subtraction
We will use the complement method to perform octal subtraction. The steps for subtracting two
octal numbers are as follows:
(1) Compute the seven's complement of the subtrahend by subtracting each digit of the
subtrahend by 7.
(2) Add 1 to the seven's complement of the subtrahend to get the eight's complement of the
subtrahend.
(3) Add the eight's complement of the subtrahend to the minuend and drop the high-order 1. This
is your difference.
9. The Hexadecimal Number System
The hexadecimal number system uses not only the Arabic numerals 0 through 9, but also uses
the letters A, B, C, D, E, and F to represent the equivalent of 1010 through 1510, respectively.
For reference, the following table shows the decimal numbers 0 through 31 with their
hexadecimal equivalents:
10. Decimal Hexadecima
l
Decimal Hexadecima
l
0 0 16 10
1 1 17 11
2 2 18 12
3 3 19 13
4 4 20 14
5 5 21 15
6 6 22 16
7 7 23 17
8 8 24 18
9 9 25 19
10 A 26 1A
11 B 27 1B
12 C 28 1C
13 D 29 1D
14 E 30 1E
15 F 31 1F
Hexadecimal Arithmetic
Addition
Evaluate: (B A 3)16 + (5 D E)16
Solution:
We note from the table that
3 + E = 11
A + D = 17
17 + 1 (carry) = 18
B + 5 = 10
10 + 1 (carry) = 11
1 1 carry
B A 3
5 D E
1 1 8 1
Hence the required sum is 1181 in hexadecimal.
11. Subtraction
Example: (DEA9) 16 - (4FBD)16 =?
Solution
15’s complement of 4FBD is B042 (given by subtracting each hexadecimal digit from 15)
16’s complement of 4FBD is B043 (given by adding 1 to the 15’s complement)
Adding the subtrahend to the minuend, we have:
DEA9
+ B043
1 8EEC
Thus, (DEA9) 16 - (4FBD)16 =(8EEC) 16