Computer Arithmetic: 1. Integer arithmetic:
Virtually all the computer offer integer arithmetic. The two properties of integer arithmetic are as follows a) Result of any arithmetic operation is an integer b) Result is always exact with two exceptions • Range of integer that can be represented is not infinite but is bounded above and below. • The result of the division operation is given as the combination of the quotient and the remainder. Remainder of the result is always truncated. 2. Floating point arithmetic
Due to economic consideration, computers are designed such that each location in memory at stores only a finite number of digits. For example, A computer has a memory in which each location can store one or more signs. There are two methods for representing the real numbers.
Assume a fix position for decimal point and store all number (after appropriate shifting if necessary) with assumed decimal point. If such convention is used, maximum and minimum numbers that can be stored are 9999.99 and 0.00001 respectively
Another convention aims to preserve the maximum no of significant digits. This representation is called normalized floating point mode of representation and storing real number. In this, real number is expressed as combination of mantissa and exponent. The mantissa is made lass than one greater that or equal to 0.1 exponent is power of 10 which multiplies mantissa. Memory location with 6 digit are divided in two parts, 4 digits for mantissa and 2 digits for exponent. While storing number the leading digit is mantissa is always made nonzero by appropriate shifting and adjusting the value of exponent.
Shifting the mantissa to left till its most significant digit is nonzero is called normalization. Normalization is useful to preserve the maximum number of useful digits. Maximum range for the number to represent in the