























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Lecture 1 Material Type: Notes; Professor: Gaj; Class: Computer Arithmetic; Subject: Electrical & Computer Enginrg; University: George Mason University; Term: Unknown 1989;
Typology: Study notes
1 / 31
This page cannot be seen from the preview
Don't miss anything!
























Chapter 1, Numbers and Arithmetic, Sections 1.1-1.6, pp. 3-
Chapter 2, Representing Signed Numbers, Sections 2.1-2.6, pp. 19-
Behrooz Parhami, Computer Arithmetic: Algorithms and Hardware Design
= (34) 10
?
IX
MCDXLVII −
Brahmi numerals, India, 400 BC-400 AD
Evolution of numerals in early Europe
Positional
wi - weight of the digit xi
Fixed-radix
i
k
i l
X = (^) ∑ xi ⋅ w
−
=−
1
i
k
i l
X = (^) ∑ xi ⋅ r
−
=−
1 r - radix of the number system
Conventional fixed-radix
i
k
i l
X = (^) ∑ xi ⋅ r
−
=−
1 r integer, r > 0 x i ∈ {0, 1, …, r -1}
Unconventional fixed-radix
i
k
i l
X = (^) ∑ xi ⋅ r
−
=−
1 x i ∈ {-α, …, β }
Non-redundant number of digits = α + β + 1 ≤ r Redundant number of digits = α + β + 1 > r
Signed-digit α>0 ^ negative digits
Integral part Fractional part
Radix point
Decimal
X = ( xk -1 xk -2 … x 1 x 0. x -1 … x - l ) 10
X min X max
0 10 k^ - 10- l
Binary
Number system
X = ( xk -1 xk -2 … x 1 x 0. x -1 … x - l ) 2 0 2 k^ - 2- l
Conventional fixed-radix
X = ( xk -1 xk -2 … x 1 x 0. x -1 … x - l ) r 0 rk^ - r - l
ulp = r - l
Notation: (^) u nit in the l east significant p osition u nit in the l ast p osition
XF = (. x -1 x -2 … x - l +1 x - l )R = =
R - destination radix
i i l
−
=−
1
= R-1^ ( x-1 + R-1^ ( x-2 + R-1^ (…. + R-1^ ( x-l+1 + R-1^ x-l )….)))
Integer part Fractional part
x-1 R-1^ ( x-2 + R-1^ (….. + R-1^ ( x-l+1 + R-1^ x-l )….))
x-2 R-1^ (….. + R-1^ ( x-l+1 + R-1^ x-l )….) …………………………………. x-l+1 (^) R-1 (^) x-l x-l ...
r=bg^ →→→→ b →→→→ R=bG
4=2^2 →→→→ 2 →→→→ 8=2^3
(2301.302) 4 = (10 11 00 01. 11 00 10) 2 = (261.62) 8
Signed-magnitude Biased^ Complement
Radix-complement Diminished-radix complement (Digit complement)
Two’s complement One’s complement
r = r =
-8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
R(X) = X + B B = 2 k -1, k =
-2k-1^ ^ X ^2 k-1-
X
R(X)
R
Signed number X
Unsigned Representation R( X )
Bit vector ( xk -1 xk -2... x 0. x -1... x-l )
Binary mapping
Representation mapping
k i i li
R ( X ) x 2
1 ⋅
− =−
Complement Signed Number Representations
Signed number X
Unsigned Representation R( X )
Bit vector ( xk -1 xk -2... x 0. x -1... x-l )
Binary mapping
Representation mapping
k i i li
R ( X ) x 2
1 ⋅
− =−
R(X) =
X for X > 0
0 or OC(0) for X = 0
OC(|X|) for X < 0
For –(2 k-1^ – 2 -l ) ≤ X ≤ 2 k-1^ – 2 -l
0 ≤ R(X) ≤ 2 k^ – 2 -l
def
-8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
X
X >0 (^0) k = X < 0, X +2 k -1 = 2 k -1 - | X | 2 k -
i l
1