Home » NUMBER SYSTEM

Category Archives: NUMBER SYSTEM

R’s AND (R-1)’s COMPLEMENT OF NUMBER SYSTEMS

In digital system complement is used to find subtraction of number base system and for digital manipulation. If R be the base of a number system then that number system can have two complements respectively R’s and (R-1)’s complement. The base of binary number system is 2 so there can be 2’s complement and 1’s complement of this system. Similarly in hexadecimal number system there are 15’s complement and 16’s complement. Now the general formula for find R’s complement and (R-1)’s are given below:
R’s complement of any number system = (Rn)10-N and
(R-1)’s complement of any number system = {(Rn)10-1)}-N
Where R = Radix or base of that number system
            n = Number of digits in the number and
            N = The given number
Let us start finding complement of each number system. Here we will start with binary number system.

R’s AND (R-1)’s COMPLEMENT OF BINARY NUMBER SYSTEM

The base of binary number system is 2 so for binary number R=2 and R-1 = 1 thus 1’s complement for binary numbers is {(2n)10-1)}-N and 2’s complement is (2n)10-N.
Example: Find 1’s complement and 2’s complement of the binary number 10110012?
Solution: 1’s complement and 2’s complement is found as:
1’s complement of 1011001
= {(27)10-1)} – 10110012                                                          
= 12710– 10110012                                                    
= 11111112– 10110012                                                          
= 01001102
2’s complement of 1011001
= (27)10-N                                                        
= 12810– 10110012                                                    
= 100000002– 10110012                                                        
= 01001112
There is a short cut method for finding 1’s complement and 2’s complement of binary numbers. We just need to alter 0’s by 1’s and 1’s by 0’s for 1’s complement and for 2’s complement find 1’s complement from this method then add 1 to LSB(least significant bit). So the above problem can be solved as:
1’s complement of 10110012
= 01001102
2’s complement of 10110012
= 1’s complement of the binary number + 1
= 01001102+ 1
= 01001112

R’s AND (R-1)’s COMPLEMENT OF BASE 3 NUMBER SYSTEM

Here the base is 3 so R = 3 and R-1 = 2 thus 3’s complement of base 3 number system = (3n)10-N and 2’s complement of base 3 number system = {(3n)10-1)}-N.
Example: Find 3’s complement and 2’s complement of 1213?
Solution: 3’s complement and 2’s complement is found as:
2’s complement of 1213
= {(33)10-1)} – 1213                                          
= 2610– 1610                                       
= 1010                                      
= 1013
3’s complement of 1213
= (3n)10-N                                                 
= 2710– 163                                              
= 1110                                           
= 1023
There is a shortcut method for finding 2’s and 3’s complement of this number base system. Subtract each digit of the given number from 2 and take them together. Thus the value obtained is the 2’s complement of the given number. And for 3’s complement just add 1 to the LSB.
Example: Find 3’s complement and 2’s complement of 1213?
Solution: The solution is as follows:
2’s complement of 1213
= 222 – 121                                                
= 1013
And 3’s complement of 1213
= 2’s complement + 1
= 1013+ 1
= 1023

R’s AND (R-1)’s COMPLEMENT OF BASE 4 NUMBER SYSTEM

In this system base is 4 so R = 4 and R-1 = 3 thus 4’s complement in this number system is (4n)10-N and 3’s complement in this system is {(4n)10-1)}-N.
Example: Find the 3’s complement and 4’s complement of 1304?
Solution: 3’s complement and 4’s complement is found as:
3’s complement of 1304
= {(43)10-1)} – 1304
= 6310– 1304                                                                                    
= 6310– 2810                               
= 3510                                           
= 2034
4’s complement of 1304
= (43)10– 1304                                          
= 6410– 1304                                            
= 6410– 2810                                             
= 3610                                                    
= 2044
The shortcut method for this system is as follows: first subtract each bit of number from 3 and then take them together for 3’s complement and for 4’s complement add 1 to the LSB.
Example: Find the 3’s complement and 4’s complement of 1304?
Solution: The solution is as follows:
3’s complement of 1304
= 333 – 130
= 2034
4’s complement of 1304
= 3’s complement of 1304 + 1
= 2034+ 1
= 2044

R’s AND (R-1)’s COMPLEMENT OF BASE 5 NUMBER SYSTEM

This number system has 4’s and 5’s complement so 4’s complement for this number system is {(5n)10-1)}-N and 5’s complement is (5n)10-N.
Example: Find the 4’s complement and 5’s complement of 2245?
Solution: The solution is as follows:
4’s complement of 2245
= {(53)10-1)} – 2245
= 12410– 2245
= 12410– 6410
= 6010
= 2205
5’s complement of 2245
= (53)10– 2245
= 12510– 2245
= 12510– 6410
= 6110
=2215
The shortcut method for 4’s complement is as: we have to subtract each digit of the given number from 4. And for 5’s complement just add 1 to the 4’s complement. So let’s solve the above problem by this method.
4’s complement of 2245
= 444 – 224
= 2205
5’s complement of 2245
= 4’s complement of 2245 + 1
= 2205+ 1
= 2215

R’s AND (R-1)’s COMPLEMENT OF BASE 6 NUMBER SYSTEM

6 is the base of this system so R = 6 and R-1 = 5 thus 6’s complement is equal to (6n)10-N and 5’s complement is equal to {(6n)10-1)}-N.
Example: Find 5’s complement and 6’s complement of 5306?
Solution: 5’s and 6’s complement of 5306 is found as:
5’s complement of 5306
= {(63)10-1)} – 5306
= 21510– 5306
= 21510– 19810
= 1710
= 256
6’s complement of 5306
= (63)10– 5306
= 21610– 5306
= 21610– 19810
= 1810
= 266
By shortcut method we can solve it as we have solved the above problems of base 3, 4 or 5. In this system the starting digit is 0 and the last digit is 5 so repeat the above method.
5’s complement of 5306
= 555 – 530
= 256
6’s complement of 5306
= 5’s complement of 5306 + 1
= 256+ 1
= 266

R’s AND (R-1)’s COMPLEMENT OF BASE 7 NUMBER SYSTEM

The base 7 number system has 6’s and 7’s complement so R = 7 and R-1 = 6 thus 6’s complement is {(7n)10-1)} – N and 7’s complement is (7n)10– N.
Example: Find the 6’s complement and 7’s complement of 6537?
Solution: The solution is as follows:
6’s complement of 6537
= {(73)10-1)} – 6537
= 34210– 6537
= 34210– 33210
= 1010
= 137
7’s complement of 6537
= (73)10– 6537
= 34310– 6537
= 34310– 33210
= 1110
= 147
The above problem can also be solved by a shortcut method as: subtract each digit of the given number from 6 and then take them as a whole number. For 7’s complement add one to the 6’s complement of the given number. Thus the above problem is solved as:
6’s complement of 6537
= 666 – 653
= 137
7’s complement of 6537
= 6’s complement of 6537 + 1
= 137+ 1
= 147

R’s AND (R-1)’s COMPLEMENT OF OCTAL NUMBER SYSTEM

In octal number system there is 7’s complement and 8’s complement because here R = 8 and R-1 = 7. Now 7’s complement of octal number is {(8n)10-1)} – N and 8’s complement of octal number is (8n)10 – N.
Example: Find 7’s complement and 8’s complement of the octal number 1728?
Solution: The 7’s and 8’s complement of 1728 is found as:
7’s complement of 1728
= {(83)10-1)} – 1728
= 51110– 1728
= 51110– 12210
= 38910
= 6058
8’s complement of 1728
= (83)10– 1728
= 51210– 1728
= 51210– 12210
= 39010
= 6068
In short the above problem can be solved by subtracting each digit from 7 for 7’s complement and add 1 to the 7’s complement to find 8’s complement of given octal number.
7’s complement of 1728
= 777 – 172
= 6058
8’s complement of 1728
= 7’s complement of 1728 + 1
= 6058+ 1
= 6068

R’s AND (R-1)’s COMPLEMENT OF BASE 9 NUMBER SYSTEM

The base 9 number system has R = 9 and R-1 = 8 so 8’s complement and 9’s complement of base 9 number system are {(9n)10-1)} – N and (9n)10 – N respectively.
Example: Find 8’s complement and 9’s complement of 8079?
Solution: The solution is as follows:
8’s complement of 8079
= {(93)10-1)} – 8079
= 72810 – 8079
= 72810 – 65510
= 7310
= 819
9’s complement of 8079
= (93)10– 8079
= 72910 – 8079
= 72910 – 65510
= 7410
= 829
The shortcut method for this problem is shown below:
8’s complement of 8079
= 888 – 807
= 819
9’s complement of 8079
= 8’s complement of 8079+ 1
= 819 + 1
= 829

R’s AND (R-1)’s COMPLEMENT OF DECIMAL NUMBER SYSTEM

The base of decimal number system is 10 since there are 10 distinguish digits in this system starting from 0 to 9. In this system R = 10 and R-1 = 9 thus 9’s complement of decimal number is {(10n)10-1)} – N and 10’s complement is (10n)10 – N.
Example: Find 9’s and 10’s complement of the decimal number 40010?
9’s complement 40010
= {(103)10-1)} – 40010
= 99910– 40010
= 59910
10’s complement 40010
= (103)10– 40010
= 1000 – 40010
= 60010
The shortcut method for 9’s complement and 10’s complement of decimal number is shown below:
9’s complement 40010
= 999 – 400
= 59910
10’s complement 40010
= 9’s complement 40010 + 1
= 59910+ 1
= 60010

R’s AND (R-1)’s COMPLEMENT OF BASE 11 NUMBER SYSTEM

In this system there are 11 digits. The last digit of this system is represented by the English alphabet A which is equivalent to 10 in decimal number system. Here R = 11 and R-1 = 10. Thus 10’s complement of this number system is {(11n)10-1)} – N and 11’s complement of this system is (11n)10 – N.
Example: Find 10’s complement and 11’s complement of 1A111?
Solution: 10’s complement and 11’s complement of 1A111 is found as:
10’s complement of 1A111
= {(113)10-1)} – 1A111
= 133010– 1A111
= 133010– 23210
= 109810
= 90911
11’s complement of 1A111
= (113)10– 1A111
= 133110– 1A111
= 133110– 23210
= 109910
= 90A11
To find 10’s complement of 1A111 by shortcut method we subtract each digit of the given number from A which is equal to 10. And for 11’s complement add 1 to the value of 10’s complement of 1A111. So the given problem is solved as:
10’s complement of 1A111
= AAA – 1A1
= 90911
11’s complement of 1A111
= 10’s complement of 1A111 + 1
= 90911+ 1
= 90A11

R’s AND (R-1)’s COMPLEMENT OF BASE 12 NUMBER SYSTEM

Here the base of the number system is 12. In this system the last two digits are represented by A and B which are equivalent to 10 and 11. The digits are as: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A and B. Here R = 12 and R-1 = 11 thus 11’s complement is equal to {(12n)10-1)} – N and 12’s complement is equal to (12n)10– N.
Example: Find 11’s complement and 12’s complement of AB012?
Solution: 11’s complement and 12’s complement of AB012 is as follows:
11’s complement of AB012
= {(123)10-1)} – AB012
= 172710– AB012
= 172710– 157210
= 15510
= 10B12
12’s complement of AB012
= (123)10– AB012
= 172810– AB012
= 172810– 157210
= 15610
= 11012
We can solve these problems by another method: for 11’s complement subtract each digit from B and for 12’s complement add 1 to 11’s complement of the given number.
11’s complement of AB012
= BBB – AB0
= 10B12
11’s complement of AB012
= 11’s complement of AB012 + 1
= 10B12+ 1
= 11012

R’s AND (R-1)’s COMPLEMENT OF BASE 13 NUMBER SYSTEM

In this system R = 13 and R-1 = 12 so 12’s complement and 13’s complements are as follows: 12’s complement of base 13 number system = {(13n)10-1)} – N and 13’s complement of base 13 number system = (13n)10 – N.
Example: Find 12’s complement and 13’s complement of ABC13?
Solution: 12’s complement and 13’s complement of ABC13 is as follows:
12’s complement of ABC13
= {(133)10-1)} – ABC13
= 219610– ABC13
= 219610– 184510
= 35110
= 21013
13’s complement of ABC13
= (133)10– ABC13
= = 219710– ABC13
= 219710– 184510
= 35210
= 21113
By shortcut method:
12’s complement of ABC13
= CCC – ABC
= 21013
13’s complement of ABC13
= 12’s complement of ABC13 + 1
= 21013+ 1
= 21113

R’s AND (R-1)’s COMPLEMENT OF BASE 14 NUMBER SYSTEM

For base 14 number system R = 14 and R-1 = 13 so 14’s complement of base 14 number system is (14n)10 – N and 13’s complement of this system is {(14n)10-1)} – N.
Example: Find 14’s complement and 13’s complement of D1514?
Solution: Here base is 14 so let’s use above two formulas to find 14’s and 13’s complement of D1514.
14’s complement of D1514
= (143)10– D1514
= 274410– D1514
= 274410– 256710
= 17710
= C914
13’s complement of D1514
= {(143)10-1)} – D1514
= 274310– D1514
= 274310– 256710
= 17610
= C814
Shortcut method for this problem is as follows: (D = 13)
13’s complement of D1514
= DDD – D15
= C814
14’s complement of D1514
= 13’s complement of D1514 + 1
= C814+ 1
= C914

R’s AND (R-1)’s COMPLEMENT OF BASE 15 NUMBER SYSTEM

Base 15 number system has 15’s complement and 14’s complement which are as follows:
15’s complement of base 15 = (15n)10 – N
14’s complement of base 15 = {(15n)10-1)} – N
Example: Find 15’ complement and 14’s complement of AE015?
Solution: The solution of the above problem using the above two formulas:
14’s complement of AE015
= {(153)10-1)} – AE015
= 337410– AE015
= 337410– 246010
= 91410
= 40E14
15’s complement of AE015
= (153)10– AE015
= 337510– AE015
= 337510– 246010
= 91510
= 41015
Shortcut method:
14’s complement of AE015
= EEE – AE0
= 40E15
15’s complement of AE015
= 14’s complement of AE015 + 1
= 40E15+ 1
= 41015

R’s AND (R-1)’s COMPLEMENT OF HEXADECIMAL NUMBER SYSTEM

Hexadecimal number system has 15’s complement and 16’s complement. Here R = 16 and R-1 = 15 thus we can write:
15’s complement of hexadecimal number = {(16n)10-1)} – N
16’s complement of hexadecimal number = (16n)10 – N
Example: Find 15’s complement and 16’s complement of the hexadecimal number F916?
Solution: The solution is as follows:
15’s complement of hexadecimal number F916
= {(162)10-1)} – F916
= 25510– F916
= 25510– 24910
= 610
= 616
16’s complement of hexadecimal number F916
= (162)10– F916
= 25610– F916
= 25610– 24910
= 710
= 716
Shortcut method:
15’s complement of hexadecimal number F916
= FF – F9
= 616
16’s complement of hexadecimal number F916
= 15’s complement of hexadecimal number F916 + 1
= 616+ 1
= 716

(more…)

HEXADECIMAL ARITHMETIC

The basic arithmetic operations such as Addition, Subtraction, Multiplication and Division for hexadecimal numbers are performed here. In hexadecimal number system there are 16 digits starting from 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F. Here the addition of hexadecimal numbers is performed first.

ADDITION OF HEXADECIMAL

The addition of hexadecimal numbers are achieved by following the given two steps given below.

  1. Add the right most digits of each hexadecimal numbers.
  2. Find the modulo of the sum of digits means divide the sum by 16 and the remainder so obtained is hexadecimal equivalent of the sum and the quotient is added to the next sum of digits from right side. Perform the second step until we add the last left most digits.

Let us solve some examples to understand the processes.

Example 1: Find the sum of the numbers A2316 and 1B116?
Solution: The addition of A2316 and 1B116 is shown below:

Digit (Starting from Right) Remainder Quotient
3+1=4 4%16=4 4/16=0
(Quotient added) 2+B+0=13 13%16=13(D) 13/16=0
(Quotient added) A+1+0=11 11%16=11(B) 11/16=0

  Thus the addition of A2316 + 1B116 = BD416.

Example 2: Find the sum of the hexadecimal numbers 2AC16 and FAB16?
Solution: The solution of the above problem is shown below:

Digit (Starting from Right) Remainder Quotient
C+B=23 23%16=7 23/16=1
(Quotient added) A+A+1=21 21%16=5 21/16=1
(Quotient added) 2+F+1=18 18%16=2 18/16=1
(Quotient added) 0+0+1=1 1%16=1 1/16=0

Thus the sum of the hexadecimal numbers 2AC16 and FAB16 is 125716.

Example 3: Find the addition of A2B.D416 and 247.6516?
Solution: The solution of the above problem is performed as:

Digit (Starting from Right) Remainder Quotient
4+5=9 9%16=9 9/16=0
(Quotient added) D+6+0=19 19%16=3 19/16=1
(Quotient added) B+7+1=19 19%16=3 19/16=1
(Quotient added) 2+4+1=7 7%16=7 7/16=0
(Quotient added) A+2+0=12 12%16=12(C) 12/16=0

Thus the sum is C73.3916.

SUBTRACTION OF HEXADECIMAL

Subtraction of hexadecimal numbers is obtained by following the given steps:

  1. First find 15’s complement or 16’s of the subtrahend.
  2. Add minuend and 15’s complement or 16’s of the subtrahend using the above addition steps of hexadecimal numbers.
  3. Discard the left most end carry and add 1 to the right most digit (only in case of 15’s complement) and that will be the final solution.

Example 1: Subtract the hexadecimal numbers ABC16 and A3B16?
Solution: here we will find the subtraction of the two given numbers using 15’s complement. So the solution for 15’s complement of A3B16 is as follows.

15 – A = 5
15 – 3 = 12 (in hexadecimal number system 12=C)
15 – B = 4
So the 15’s complement of A3B16 is 5C416.
Now add ABC16and 5C416.

Digit (Starting from Right) Remainder Quotient
C+4=16 16%16=0 16/16=1
(Quotient added) B+C+1=24 24%16=8 24/16=1
(Quotient added) A+5+1=16 16%16=0 16/16=1
(Quotient added) 0+0+1=1 1%16=1 1/16=0

The remainder is 108016. Now we have to discard the left most end carry 1 and then we have to add 1 to the right most digit.
Thus 108016becomes 8016+1=8116
Hence, ABC16– A3B16=8116.

We can solve the same problem taking 16’s complement of subtrahend. So let’s solve the problem by this method.

The 16’s complement of A3B16
= 15’s complement of A3B16 + 1
= 5C416 + 1
= 5C516
Now add ABC16and 5C516.

Digit (Starting from Right) Remainder Quotient
C+5=16 17%16=1 16/16=1
(Quotient added) B+C+1=24 24%16=8 24/16=1
(Quotient added) A+5+1=16 16%16=0 16/16=1
(Quotient added) 0+0+1=1 1%16=1 1/16=0

Thus the remainder is 108116. Now we have to discard the left most end carry 1 then number obtained is final value.
Hence, ABC16 – A3B16 = 8116.

Example 2: Subtract the hexadecimal numbers 67A16 and 54916?
Solution: The solution of this problem is as follows:

By using 15’s complement of subtrahend:

15’s complement of 54916 is found as.
15 – 5 = 10 (in hexadecimal number system 10=A)
15 – 4 = 11 (in hexadecimal number system 11=B)
15 – 9 = 6
So the 15’s complement is AB616.
Now add 67A16and AB616.

Digit (Starting from Right) Remainder Quotient
A+6=16 16%16=0 16/16=1
(Quotient added) 7+B+1=19 19%16=3 19/16=1
(Quotient added) 6+A+1=17 17%16=1 17/16=1
(Quotient added) 0+0+1=1 1%16=1 1/16=0

Thus the remainder is 113016. Now discard left most end carry 1 and add 1 to the right most digit.
Hence, 113016become 13016 and after adding 1 we get 13116.
So 67A16 – 54916 = 13116.

By using 16’s complement of subtrahend:

16’s complement of 54916
= 15’s complement of 54916 + 1
= AB616 + 1
= AB716
Now add 67A16 and AB716.

Digit (Starting from Right) Remainder Quotient
A+7=17 17%16=1 17/16=1
(Quotient added) 7+B+1=19 19%16=3 19/16=1
(Quotient added) 6+A+1=17 17%16=1 17/16=1
(Quotient added) 0+0+1=1 1%16=1 1/16=0

Thus when we arrange the remainder we get 113116. Now discard the left most end carry and we will get the final solution.
Hence after discarding end carry of 113116.
We get 13116.

Example 3: Solve ABC16 + FAB16 – 2AC16?
Solution: first we add ABC16 and FAB16 then we subtract 2AC16from the sum of ABC16 and FAB16.

Digit (Starting from Right) Remainder Quotient
C+B=23 23%16=7 23/16=1
(Quotient added) B+A+1=22 22%16=6 22/16=1
(Quotient added) A+F+1=26 26%16=10(A) 26/16=1
(Quotient added) 0+0+1=1 1%16=1 1/16=0

Thus sum of ABC16and FAB16 is 1A6716.
Now subtract 1A6716 and 2AC16.
15’s complement of 2AC is obtained as.
15 – 2 = 13 (in hexadecimal number system 13=D)
15 – A = 5
15 – C = 3
Thus the 15’s complement of 2AC16 is D5316.
Now add 1A6716and D5316.

Digit (Starting from Right) Remainder Quotient
7+3=10 10%16=10(A) 10/16=0
(Quotient added) 6+5+0=11 11%16=11(B) 11/16=0
(Quotient added) A+D+0=23 23%16=7 23/16=1
(Quotient added) 1+0+1=2 2%16=2 2/16=0

Thus we get 27BA16. After discarding 1 from left most digit of 27BA16and then we add 1.

Hence 27BA16becomes 17BA16 and 17BA16+1=17BB16.
ABC16 + FAB16 – 2AC16 = 17BB16.

ALTERNATIVE METHOD FOR ADDITION AND SUBTRACTION OF HEXADECIMAL NUMBERS

There is an alternative method also to find addition and subtraction of hexadecimal numbers. The steps are as follows:

  1. Convert each hexadecimal numbers into decimal numbers.
  2. Add or subtract the decimal numbers obtained from step one.
  3. Convert the decimal number obtained from step two into hexadecimal number.
  4. The hexadecimal number obtained from step three is the final answer.

Example 1: Add the hexadecimal numbers A2116 and 2B116?
Solution: To add the above two hexadecimal numbers we have to follow the above steps:
Convert A2116 and 2B116 into decimal numbers:
A2116
= Ax162 + 2×161 + 1×160
= 10×256 + 2×16 + 1×1
= 2560 + 32 + 1
= 259310

2B116
= 2×162 + Bx161 + 1×160
= 2×256 + 11×16 + 1×1
= 512 + 176 + 1
= 68910

Add 259310 and 68910.
259310 + 68910 = 328210
Convert 328210 into hexadecimal number:
16|3282         Remainder
16|205                  2
16|12                   13 (in hexadecimal number system 13=D)
16|0                      12 (in hexadecimal number system 12=C)
So the sum is CD216.

Example 2: Subtract the numbers ABC16 and A8C16?
Solution: Convert the hexadecimal numbers ABC16 and A8C16 Into decimal numbers:

ABC16
= Ax162 + Bx161 + Cx160
= 10×256 + 11×16 + 13×1
= 2560 + 176 + 12
= 274810

A8C16
= Ax162 + 8×161 + Cx160
= 10×256 + 8×16 + 12×1
= 2560 + 128 + 12
= 270010

Subtract 274910 and 266810:
274810 – 270010 = 4810
Convert 4810 into hexadecimal number:
16|81               Remainder
16|3                      0
|0                     3
So the answer is 3016.

MULTIPLICATION AND DIVISION OF HEXADECIMAL NUMBERS

The alternative method of finding multiplication or division of hexadecimal numbers is shown below:

  1. Change the hexadecimal numbers into decimal numbers.
  2. Multiply or divide the hexadecimal numbers.
  3. The decimal number obtained in the second step has to be changed into hexadecimal number and that is the final value.

Example 1: Find the multiplication of the hexadecimal numbers 11A16 and 5A316?
Solution: The solution is found by the above method as:
Change hexadecimal numbers into decimal numbers:
11A16
= 1×162 + 1×161 + Ax160
= 1×256 + 1×16 + 10×1
= 256 + 16 + 10
= 28210

5A316
= 5×162 + Ax161 + 3×160
= 5×256 + 10×16 + 3×1
= 1280 + 160 + 3
= 144310

Now multiply 28210 and 144310:
28210 x 144310 = 40692610
Change 40692610 into hexadecimal number:
16|406926                  Remainder
16|25432                        14(in hexadecimal number system 14=E)
16|1589                          8
16|99                              5
16|6                                3
|0                                6
So the multiplication of 11A16 and 5A316 is 6358E16­.

Example 2: Find division of ABC16 by A116?
Solution: The solution is as follows:
Change the hexadecimal numbers into decimal numbers:
ABC16
= Ax162 + Bx161 + Cx160
= 10×256 + 11×16 + 13×1
= 2560 + 176 + 12
= 274810

A116
= Ax161 + 1×160
= 10×16 + 1×1
= 160 + 1
= 16110
Divide 274810 by 16110:
274810 / 16110 = 1710 (Around)
Now change 1710 into hexadecimal number:
16|17              Remainder
16|1                     1
|0                     1
So the answer is 1116.

15’S AND 16’S COMPLEMENTS OF HEXADECIMAL NUMBERS

15’S AND 16’S COMPLEMENTS OF HEXADECIMAL NUMBERS

As we find 1’s and 2’s complement of binary numbers or 7’s and 8’s complement of octal numbers in the same manner we can also find only 15’s and 16’s complement of Hexadecimal numbers because the radix or base of hexadecimal number is 16. In
general we can say if a number system has its radix or base R then only R’s and (R-1)’s complements can be found of that number. The general formula for finding R’s complement and (R-1)’s complement are shown below:
  • R’s complement of any number system = (Rn)10-N and
  • (R-1)’s complement of any number system = {(Rn)10-1)}-N

Where R = radix or base of that number system

            n = number of digits in the hexadecimal number and
            N = the hexadecimal number

15’S COMPLEMENT OF HEXADECIMAL NUMBERS

To find 15’s complement of hexadecimal number we have to follow some steps and these steps are given below.
  1. Calculate (Rn)10-1.
  2. Convert the hexadecimal number N into decimal number.
  3. Subtract the values obtained from above two steps with each other.
  4. Convert the decimal value obtained in step3 into hexadecimal.
Now the value obtained in the last step is the required 15’s complement of the hexadecimal number N. The above processes are explained below with suitable examples.

Example: Find the 15’s complement of (12D)16?
Solution: To the 15’s complement we have to follow the above four steps. Here the value of R is 16 and the number of digits in the hexadecimal number is 3.
(Rn)10-1 = (163)10-1
              = 4096-1
              = (4095)10
Here N = (12D)16
   (12D) = 1×162+2×161+Dx160
             = 256+32+13
             = (301)10
Now subtract (4095)10 and (301)10.
(4095)10– (301)10 = (3794)10
Finally convert (3794)10 into hexadecimal number.
            16 | 3794        Remainder
            16 | 237            2
            16 | 14              13 = D
            16 | 0                14 = E
Therefore (3794)10 = (ED2)16
Hence the 15’s complement of (12D)16 is (ED2)16.

SHORTCUT METHOD FOR FINDING 15’S COMPLEMENT OF HEXADECIMAL NUMBERS

There is a shortcut method which can be used to find 15’s complement of hexadecimal numbers. To find 15’s complement we have to subtract each digit of the hexadecimal number from 15 and values obtained from each subtraction are together taken as the complement of that hexadecimal number. Let us solve the above problem by this method.

Example: Find the 15’s complement of (12D)16?
Solution: The solution is as follows:
            15-1 = 14 (in hexadecimal number system 14 = E)
            15-2 = 13 (in hexadecimal number system 13 = D)
            15-D = 2
So the 15’s complement of (12D)16 is (ED2)16.
[HERE WE HAVE TAKEN THE NUMBER FROM TOP TO BOTTOM]

Example: Find the 15’s complement of (1E1)16?
Solution: The solution is as follows:
            15-1 = 14 (and 14 = E)
            15-E = 1
            15-1 = 14
So the 15’s complement of (1E1)16 is (E1E)16.

16’S COMPLEMENT OF HEXADECIMAL NUMBERS

16’s complement of hexadecimal numbers can be found by the formula shown above {(Rn)10-N} or we can do thing first we find 15’s complement of the hexadecimal number then we have to add 1 to right most digit. The process of finding 16’s complement of hexadecimal numbers is shown by examples.

Example: Find the 16’s complement of the hexadecimal number (1BA)16?
Solution: To find 16’s complement of (1BA)16 first we will find 15’s complement of (1BA)16. So let’s find 15’s complement of (1BA)16.
(Rn)10-1 = (163)10-1
              = 4096-1
              = (4095)10
Here N = (1BA)16
   (1BA) = 1×162+Bx161+Ax160
             = 256+176+10
             = (442)10
Now subtract (4095)10 and (442)10.
(4095)10– (442)10 = (3653)10
Finally convert (3653)10 into hexadecimal number.
            16 | 3653        Remainder
            16 | 228            5
            16 | 14              4
            16 | 0                E
Therefore (3653)10 = (E45)16
Hence the 15’s complement of (1BA)16 is (E45)16.
 Now the 16’s complement of (1BA)16= (E45)16+1 = (E46)16

SHORTCUT METHOD FOR FINDING 16’S COMPLEMENT OF HEXADECIMAL NUMBERS

Here we will find the 15’s complement of the given hexadecimal number by the above shortcut method then we will add 1 to right most digit hence the 16’s complement is found.

Example: Find the 16’s complement of the hexadecimal number (1BA)16?
Solution: The solution is as follows:
            15-1 = 14 (in hexadecimal number system 14 = E)
            15-B = 4
            15-A = 5
So the 15’s complement of (12D)16 is (E45)16.
Hence 16’s complement of (12D)16 = (E45)16+1 = (E46)16

Example: Find the 16’s complement of (FAB)16?
Solution: The solution is as follows:
            15-F = 0 (in hexadecimal number system 14 = E)
            15-A = 5
            15-B = 4
So the 15’s complement of (FAB)16 is (54)16.

7’s AND 8’s COMPLEMENT OF OCTAL NUMBER

7’s COMPLEMENT OF OCTAL NUMBER

To find 7’s complement or (r – 1)’s complement of Octal number we have to follow some steps. There is a general formula to find (r-1)’s complement of any number system. So

(r-1)’s complement = {(rn)10 – 1} – N
r = Radix or Base
n = Number of digits
N = Number.

  1. Calculate (rn)10 – 1.
  2. Convert the given Octal number (N) in Decimal system.
  3. Subtract the values obtained from Step One and Step Two.
  4. The decimal value obtained from Step Three has to be converted into octal value and that will be 7’s complement of octal number.Let us have an example to have a better consideration of 7’s complement of octal number.

(more…)

OCTAL ARITHMETIC

The addition and subtraction of octal number are shown here. An alternative method of solving this types of problem is also discussed in this section below.

OCTAL ADDITION

The addition of two or more octal numbers can be achieved by following some specific rules which are listed below. Since there are eight digits in this system starting from 0 and the last digit are 7. The additions of octal numbers are discussed below.

  1. Add the right most digits of each octal numbers.
  2. Find the modulo of the sum of digits means divide the sum by 8 and the remainder so obtained is the octal equivalent of the sum and the quotient is added to the next sum of digits from right side. Perform the STEP 2 until we add the left most digits.

Let us take an example to have a better idea how the whole operation takes place.

Exp1:- Add the octal numbers (123)8 and (527)8.

Digit (Starting from Right) Remainder Quotient
3+7=10 10%8=2 10/8=1
(Quotient added) 1+2+2=5 5%8=5 5/8=0
(Quotient added) 0+1+5=6 6%8=6 6/8=0

Hence, the sum of (123)8 and (527)8 is (652)8.

[NOTE: WHEN THE SUM OF THE DIGITS IS LESS THAN 8 THEN THE MODULO OF THE SUM WILL BE THE SUM ITSELF AND THE QUOTIENT WILL BE ZERO.]

Exp2:- Add the octal numbers (325.4)8 and (723.8)8.

Digits (Starting from Right) Remainder (Octal Equivalent)               Quotient
4+8 = 12 12%8 = 4 12/8 = 1
(Quotient Added) 1+5+3 = 9 9%8 = 1 9/8 = 1
(Quotient Added) 1+2+2 = 5 5%8 = 5 5/8 = 0
(Quotient Added) 0+3+7 = 10 10%8 = 2 10/8 = 1
(Quotient Added) 1 = 1 1%8 = 1 1/8 = 0

Therefore, the sum is (1251.4)8.

OCTAL SUBTRACTION

Octal subtraction is performed as we perform the binary subtraction. In binary subtraction, first we find 1’s complement or 2’s complement of subtrahend in the same way first we will find 7’s complement or 8’s complement of that octal number then we add the minuend and the subtrahend (The addition is performed as we have stated above.). So to find the subtraction of two octal numbers we have to follow two steps:

  1. Find either 7’s complement or 8’s of the subtrahend.
  2. Add the minuend and the subtrahend.

By using 7’s complement

Let us take an example:

Exp1:- subtract (453)8 – (234)8.
STEP 1: 7’s complement of (234)8= 777 – 234 = (543)8
STEP 2: Add the numbers (453)and (543)8.

Digits (Starting from Right) Remainder (Octal Equivalent) Quotient
3+3 = 6 6%8 = 6 6/8 = 0
(Quotient added) 0+5+4 = 9 9%8 = 1 9/8 = 1
(Quotient added) 1+4+5 = 10 10%8 = 2 10/8 = 1
(Quotient added) 1 = 1 1%8 = 1 1/8 = 0

So, the sum is (1216)8. Now, discard the end carry and add 1 to the right most digit and that will be the answer.
Hence, (453)8 – (234)8 = (217)8.

Exp2:- Subtract (165)8 – (76)8.

STEP 1: 7’s complement of (76)8 = 77 – 76 = (1)8
STEP 2: Add the octal numbers (165)and (1)8.

Digits (Starting from Right) Remainder (Octal Equivalent) Quotient
1+5 = 6 6%8 = 6 6/8 = 0
(Quotient added)0+6 = 6 6%8 = 6 9/8 = 0
(Quotient added)0+1 = 1 1%8 = 1 1/8 = 0

The sum is (166)8.
Now, discard the end carry and add 1 to the right most digit.
Hence, (165)8 – (76)8 = (67)8.

By 8’s complement:

Exp1:- Find the value of (574)8– (341)8.
To solve this problem we use 8’s complement of subtrahend. There are also two steps first find the 8’s complement of subtrahend and the follow the STEP 2 of the 7’s complement method.
Now, 8’s complement any octal number = 7’s complement of that octal number + 1
STEP 1: Therefore, 8’s complement of (341)8 = (777 – 341) + 1 = (437)8
STEP 2: Add the minuend (574)8and 8’s complement of subtrahend (437)8.

Digits (starting from right) Remainder (Octal Equivalent) Quotient
4+7 = 11 11%8 = 3 6/8 = 1
(Quotient Added) 1+7+3 = 11 11%8 = 3 11/8 = 1
(Quotient Added) 1+5+4 = 10 10%8 = 2 10/8 = 1

 

(Quotient Added)          1 = 1 1%8 = 1 1/8 = 0

Sum of (574)8 and (437)8 is (1233)8. So, the required value is obtained by discarding the end carry only.

Therefore, (574)8 – (341)8 = (233)8
Exp2:- (764)8 – (444)solve the problem using 8’s complement?
STEP 1: 8’s complement of subtrahend = (777 – 444) + 1 = (334)8
STEP 2: Add the numbers (764)and (334)8.

Digits (Starting from Right) Remainder (Octal Equivalent)           Quotient
4+4=8 8%8=0 8/8=1
(Quotient added) 1+6+3=10 10%8=2 10/8=1
(Quotient added) 1+7+3 = 11 11%8 = 3 11/8 = 1
(Quotient added) 1 = 1 1%8 = 1 1/8 = 0

So the sum is (1320)8.
Now discard the end carry and that will be the required answer.
Hence, (764)8 – (444)8 = (320)8.

PROBLEM INCLUDING BOTH ADDITION AND SUBTRACTION OF OCTAL NUMBER

Exp1:- Solve the given problem: (223)8+ (527)8 – (436)8

To solve this problem, first we are going to add the first two octal numbers then we subtract the third octal number from the sum of the first two octal numbers. So, let us start to add first two octal numbers. To add these numbers we will follow the above rules.

Digits (Starting from Right) Remainder (Octal Equivalent) Quotient
3+7=10 10%8=2 10/8=1
(Quotient added) 1+2+2=5 5%8=5 5/8=0
(Quotient added) 0+2+5 = 7 7%8 = 7 7/8 = 0

So the sum is (752)8.
Now, find the either 7’s complement or 8’s complement of the subtrahend (436)8.
Therefore, 7’s complement of (436)8 = 777 – 436 = (341)8
Now, add the sum (752)and (341)8.

Digits (Starting from Right) Remainder (Octal Equivalent) Quotient
1+2 = 3 3%8 = 3 8/8 = 0
(Quotient added) 0+5+4 = 9 9%8 = 1 9/8 = 1
(Quotient added) 1+7+3 = 11 11%8 = 3 11/8 = 1
(Quotient added) 1 = 1 1%8 = 1 1/8 = 0

So, the sum of (752)and (341)8 is (1313)8. Now discard the end carry and add 1 to the right most digit.
Hence, (223)8 + (527)8– (436)8 = (314)8.

ALTERNATE METHOD FOR ADDITION AND SUBTRACTION OF OCTAL NUMBER

The addition or subtraction of two or more octal numbers can be performed by an alternate method that follows as:

  1. The addition or subtraction is performed first by changing the given octal numbers into their equivalent decimal number and then we add or subtract them.
  2. Change the obtained final addition value or subtraction value into octal number.

Now the question arises here how an octal number can be altered in decimal number the answer is as follows:

  1. Multiply each digit of the octal number with its corresponding position octal value and it start from left side as for first digit 80=1, 81=8, 82=64, 83=512 and so on.
  2. Add all the numbers obtained from first step and that is the final decimal equivalent value of an octal number.

Let us verify the above problem by this rule.

Example:- Add the octal numbers (123)8 and (527)8.
Solution:- First we change both the octal number into decimal number by above rules.
(123)8 = 1×82+2×81+3×80
            = 64+16+3
= 83
= (83)10

(527)8 = 5×82+2×81+7×80
            = 320+16+7
= 343
= (343)10
(83)10 + (343)10 = (426)10

Now the step one has been executed. Thus we will start second step as: In the first step we have found the final decimal value, now we are going to change this decimal number into its equivalent octal number. The process of altering a decimal number into octal number is done by repeated division of the decimal number by 8 until the number becomes less than 8. The remainder found in each division together forms the octal number. The remainders are taken in order from bottom to up. Thus the octal equivalent of (426)10 is as obtained:

426/8=53+ 2R
53/8=6+   5R
6/8=0+   6R
Hence the octal equivalent is (652)8. And this is the final answer in octal number system.
(123)8 + (527)8 = (652)8

Similarly any octal numbers can be added by this method. Now we will discuss about the subtraction of octal number in the same procedure. The subtraction of octal numbers are illustrated below with proper example.

Example:- Subtract the octal number (453)8 and (234)8.

Solution:- The subtraction process will be processed in the same way as the addition is performed above. Now we change the octal numbers (453)8 and (234)8 into decimal numbers.
(453)8 = 4×82+5×81+3×80
            = 256+40+3
= 299
= (299)10

(234)8 = 2×82+3×81+4×80
            = 128+24+4
= 156
= (156)10

 (299)10 – (156)10 = (143)10

Since the first step is complete now so we will go for the next step to change the decimal value into octal value.
143/8 = 17+ 7R
17/8 = 2+   1R
2/8 = 0+   2R
The octal equivalence of (143)10 is (217)8.
Hence the result is (453)8 – (234)8= (217)8.

MULTIPLICATION AND DIVISION OF OCTAL NUMBER

Multiplication and Division of octal number can also be achieved by this method easily. To take a good understanding let us go through an example:

Example:- Multiply the octal number (488)8 and (555)8.
Solution:- let us change the numbers into decimal number system.
(488)8 = 4×82+8×81+8×80
           = 256+64+8
= 328
= (328)10

(555)8 = 5×82+5×81+5×80
           = 320+40+5
= 365
= (365)10

(328)10 X (365)10 = (119720)10

Now change (119720)10 into octal equivalent.
119720/8 = 14965+0R
14965/8 = 1870+  5R
1870/8 = 233+     6R
233/8 = 29+       1R
29/8 = 3+          5R
3/8 = 0+           3R

Hence the octal equivalent is (351650)8.
Therefore (488)8 X (555)8 = (351650)8

Binary Addition Subtraction Multiplication and Division

Binary Addition

Binary addition is performed in the same manner as decimal addition. However, since binary system has only two digits, the addition table for binary arithmetic is very simple consisting of only four entries. The complete table for binary addition is as follows:

(more…)

POSITIONAL NUMBER SYSTEM

In a positional number system, there are only a few called digits, and these digits represent different values depending on the position they occupy in the number. The value of each digit in such a number is determined by three consideration.

  1. The digit itself.
  2. The position of the digit in the number.
  3. The base of the number system.

(more…)