Division is somewhat more than multiplication but is based on the same general principles. The operation involves repetitive shifting and addition or subtraction.
First, the bits of the dividend are examined from left to right, until the set of bits examined represents a number greater than or equal to the divisor; this is referred to as the divisor being able to divide the number. Until this event occurs, 0s are placed in the quotient from left to right. When the event occurs, a 1 is placed in the quotient and the divisor is subtracted from the partial dividend. The result is referred to as a partial remainder. The division follows a cyclic pattern. At each cycle, additional bits from the dividend are appended to the partial remainder until the result is greater than or equal to the divisor. The divisor is subtracted from this number to produce a new partial remainder. The process continues until all the bits of the dividend are exhausted.
Restoring Division (Unsigned Binary Division)
Floating Point Representation
The floating point representation of the number has two parts. The first part represents a signed fixed point numbers called mantissa or significand. The second part designates the position of the decimal (or binary) point and is called exponent. For example, the decimal no + 6132.789 is represented in floating point with fraction and exponent as follows.
Fraction Exponent
+0.6132789 +04
This representation is equivalent to the scientific notation +0.6132789 × 10+4
The floating point is always interpreted to represent a number in the following form ±M × R±E. Only the mantissa M and the exponent E are physically represented in the register (including their sign). The radix R and the radix point position of the mantissa are always assumed.
A floating point binary no is represented in similar manner except that it uses base 2 for the exponent.
For example, the binary no +1001.11 is represented with 8 bit fraction and 0 bit exponent as follows.
0.1001110 × 2100
Fraction Exponent
01001110 000100
The fraction has zero in the leftmost position to denote positive. The floating point number is equivalent to M × 2E = +(0.1001110)2 × 2+4
There are four basic operations for floating point arithmetic. For addition and subtraction, it is necessary to ensure that both operands have the same exponent values. This may require shifting the radix point on one of the operands to achieve alignment. Multiplication and division are straighter forward.
A floating point operation may produce one of these conditions:
- Exponent Overflow: A positive exponent exceeds the maximum possible exponent value.
- Exponent Underflow: A negative exponent which is less than the minimum possible value.
- Significand Overflow: The addition of two significands of the same sign may carry in a carry out of the most significant bit.
- Significand underflow: In the process of aligning significands, digits may flow off the right end of the significand.
Floating Point Addition and Subtraction
In floating point arithmetic, addition and subtraction are more complex than multiplication and division. This is because of the need for alignment. There are four phases for the algorithm for floating point addition and subtraction.
- Check for zeros:
Because addition and subtraction are identical except for a sign change, the process begins by changing the sign of the subtrahend if it is a subtraction operation. Next; if one is zero, second is result.
- Align the Significands:
Alignment may be achieved by shifting either the smaller number to the right (increasing exponent) or shifting the large number to the left (decreasing exponent).
- Addition or subtraction of the significands:
The aligned significands are then operated as required.
- Normalization of the result:
Normalization consists of shifting significand digits left until the most significant bit is nonzero.
Floating Point Multiplication
The multiplication can be subdivided into 4 parts.
- Check for zeros
- Add the exponents.
- Multiply mantissa
- Normalize the product
Floating Point Division
The division algorithm can be subdivided into 5 parts
- Check for zeros.
- Initial registers and evaluates the sign.
- Align the dividend
- Subtract the exponent
- Divide the mantissa.