Presentation is loading. Please wait.

Presentation is loading. Please wait.

ELEN 033 Lecture #5 Tokunbo Ogunfunmi Santa Clara University.

Similar presentations


Presentation on theme: "ELEN 033 Lecture #5 Tokunbo Ogunfunmi Santa Clara University."— Presentation transcript:

1 ELEN 033 Lecture #5 Tokunbo Ogunfunmi Santa Clara University

2 Number Systems ä A computer’s variables have to be represented efficiently to reduce cost of computing the instructions ä Chosen method of representation affects the difficulty of performing arithmetic operations.

3 Number System Representations ä Unary system ä Roman Numerals (see table) ä Weighted Positional Notation ä Binary (MSB ….. LSB) ä Octal ä Decimal ä Hexadecimal

4 Number System Representations Some of the desirable properties of number system representations are l Uniqueness (no two numbers have the same representations ) l Ability to rep. any number large/small including fractions, rationals, irrationals, etc. exactly l Efficiency of rep. to permit fast implementations of mathematical operations

5 Number System Representations ä In a weighted positional rep., the radix/base r can be any integer (e.g. 2, 4, 8, 10, 16) ä The best choice for a computer is different from the best choice for humans. Why?…. ä The higher the radix, the larger the numbers that can be rep. with same #digits. ä Can easily convert numbers between one radix and the other.

6 What about negative numbers? ä The weighted positional rep. can still be used to rep. zero, negative and fractional numbers. ä Using + and -- to rep. positive and negative numbers introduce additional symbols. ä Instead, we use other means such as One’s complement, Two’s complement, Sign- magnitude, etc.

7 Transformations Between Radices l Arithmetic operations are performed with respect to a certain radix. l Conversion involves three radices: original rep. radix, final rep. radix and the radix in which the arithmetic is performed. l Conversion Into Decimal, Conversion From Decimal and Powers of Two Conversions. Examples are given ….

8 Representation of Non-Integer numbers ä Extending weigthed positional rep. to include non-integers ä Conversion of fractions ä Approximate Values ä Scientific Notation ä Normalization

9 Precision and Accuracy l Precision is defined as … ä Many computations have a fixed precision determined by the maximum number of significant digits it is capable of rep. correctly. l Accuracy is defined as … ä The accuracy of a computation is limited by the lesser of (1) the precision of the rep. and the computations and (2) the accuracy of the values used in the computation. l Accuracy can never be more (is usually less) than the precision of a computer.


Download ppt "ELEN 033 Lecture #5 Tokunbo Ogunfunmi Santa Clara University."

Similar presentations


Ads by Google