Computer Number Systems
d n-1 d n-2 d n d 2-m d 1-m d -m Conventional Radix Number r is the radixd i is a digit d i Є {0, 1, ….., r – 1 } -m ≤ i < n
d n-1 d n-2 d n d 2 d 1 d 0 Conventional Radix Number (Integer Part) r is the radixd i is a digit d i Є {0, 1, ….., r – 1 } 0 ≤ i < n
.d -1 d -2 d d m d 1-m d -m Conventional Radix Number (Fraction Part) r is the radixd i is a digit d i Є {0, 1, ….., r – 1 } 0 ≤ i < n
N = d n-1 w n-1 + d n-2 w n d 1-m w -m The Conventional Number System is a Positional Weighted System N = ∑ d i. w i
Most Significant Digit & Least Significant Digit MSD corresponds to digit with maximum weight LSD corresponds to digit with minimum weight
d n-1 d n-2 d n d 2-m d 1-m d -m MSD Most Significant Digit LSD Least Significant Digit b n-1 b n-2 b n b 2-m b 1-m b -m MSB Most Significant Bit LSB Least Significant Bit For all Number Systems For the Binary Number System
N = d n-1 w n-1 + d n-2 w n d -m w -m The Conventional Number System is a Positional Weighted System N = ∑ d i. w i
In a Fixed-Radix Number System w i = r i N = ∑ d i. w i => N = ∑ d i. r i N = ∑ d i. r i
Examples (7051) 10 = 7 x x x x 10 0 = = 7051 (.27) 10 = 2 x x = =.27 (34.903) 10 = 3 x x x x x = = Decimal Number System : Radix 10 d i = {0, 1, 2, 3, 5, 6, 7, 8, 9}
Examples (7051) 8 = 7 x x x x 8 0 = (.27) 8 = 2 x x 8 -2 = (34.903) 8 = 3 x x x x x 8 -3 = Octal Number System : Radix 8 d i = {0, 1, 2, 3, 5, 6, 7}
Examples (72A) 16 = 7 x x x 16 0 = (.CF1) 16 = 12 x x x = (3B.2D) 16 = 3 x x x x = Hexadecimal Number System : Radix 16 d i = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}
Examples (101) 2 = 1 x x x 2 0 = = 5 (.0101) 2 = 0 x x x x 2 -4 = = (10.101) 2 = 1 x x x x x 2 -3 = = 2.75 Binary Number System : Radix 2 d i = {0, 1}
Base Conversion Integer Part
Base Conversion Fraction Part
Base Conversion Both Integer and Fraction Part
Representation of Signed Numbers Integer Part
(a n ) a n-1 a n-2 a n a 2 a 1 a 0 Sign of a n-Digit Signed Number The (n+1) th digit a n is the sign digit 0 if A ≥ 0 r- 1 if A < 0 a n =
Magnitude of a n-Digit Signed Number There are 3 different ways to represent the magnitude Sign Magnitude Form (SMF) Diminished Radix Complement Form (DRC) Radix Complement Form (RC) DRC is also known as (r-1)’s complement RC is also known as r’s complement
SMF (0) a n-1 a n a 2 a 1 a 0 DRC (0) a n-1 a n a 2 a 1 a 0 RC (0) a n-1 a n a 2 a 1 a 0 If A is a positive number [ A ≥ 0 ]
SMF (r-1) a n-1 a n a 2 a 1 a 0 DRC (r-1) ā n-1 ā n ā 2 ā 1 ā 0 RC (r-1) ā n-1 ā n ā 2 ā 1 ā where,ā i = (r-1) - a i r = radix If A is a negative number [ A < 0 ]
ā n-1 ā n ā 2 ā 1 ā 0 a n-1 a n a 2 a 1 a 0 (r-1) n-1 (r-1) n (r-1) 2 (r-1) 1 (r-1) 0 The ā i notation is implicative of –
Addition
Subtraction