Texas Instruments TMS320C3x 사용자 설명서

다운로드
페이지 757
Normalization Using the NORM Instruction
5-37
Data Formats and Floating-Point Operation
5.7
Normalization Using the NORM Instruction
The NORM instruction normalizes an extended-precision floating-point number
that is assumed to be unnormalized (see Example 5–17). Since the number is
assumed to be unnormalized, no implied most significant nonsign bit is assumed.
The NORM instruction:
1) Locates the most significant nonsign bit of the floating-point number
2) Left shifts to normalize the number
3) Adjusts the exponent
Example 5–17. NORM Instruction
Assume that an extended-precision register contains the value:
man = 00000000000000000001000000000001, exp = 0
When the normalization is performed on a number assumed to be unnormalized,
the binary point is assumed to be:
man = 0.0000000000000000001000000000001, exp = 0
This number is then sign-extended one bit so that the mantissa contains 33 bits:
man = 00.0000000000000000001000000000001, exp = 0
The intermediate result after the most significant nonsign bit is located and the
shift performed is:
man = 01.0000000000010000000000000000000, exp = –19
The final 32-bit value output after removing the redundant bit is:
man = 00000000000010000000000000000000, exp = –19
The NORM instruction is useful for counting the number of leading 0s or leading
1s in a 32-bit field. If the exponent is initially 0, the absolute value of the final
value of the exponent is the number of leading 1s or 0s. This instruction is also
useful for manipulating unnormalized floating-point numbers.
Given the extended-precision floating-point value 
a to be normalized, the
normalization, norm ( ), is performed as shown in Figure 5–18.