Complements are used in the digital system (computers) for logical
manipulation and for the ease of subtraction operation. For a given base r
there are two types of compliments.
1. (r -1)’s
compliment
For the give number N of n digits in base r system, the (r -1)’s
compliment
is given by (
. Or we can consider as
. Where m denotes the number of digits in fractional part of a real
number and n is the no of digits in non fractional part. For an integer m=0.
Eg. Decimal number system- 9’s compliment and binary number system-1’s
compliment.
2. (r ’s)
compliment
For the give number N of n digits in base r system, the (r )’s
compliment
is given by (
). Eg. Decimal number system- 10’s compliment and binary number
system-2’s compliment.
eg: for decimal number system:
9’s compliment of 325.23 is
=1000-0.01-325.23 =674.76
10’s compliment of 325 is
=675
NOTE: We cannot calculate r’s compliment of floating numbers.
No comments:
Post a Comment