Page 77 - Programmable Logic Controllers, Fifth Edition - Mobile version
P. 77
vary based on the position of the decimal point, which
floats to the left or right, with a corresponding change in 32 bits
the exponent value.
• The numbers shown on the left side represent the
significand, or mantissa, and the numbers shown on Mantissa (23 bits)
the right indicate the exponent value.
Exponent (8 bits)
• A significand contains the number’s digits and an
exponent indicates where the decimal (or binary) Mantissa sign (1 bit)
point is located relative to the beginning of the
significand. Figure 3-17 Basic components of a floating point number.
• Decimal floating-point numbers usually take the Floating point numbers are also known as real num-
form of scientific notation with a decimal point al- bers. The IEEE 754 Standard is the most commonly used
ways between the 1st and 2nd digits. standard for representing these numbers and includes:
Floating point numbers have three basic components: • Single precision: 32 bits, consisting of
the sign, the exponent, and the mantissa, as shown in - Sign bit (1 bit)
Figure 3-17. - Exponent (8 bits)
• The sign of a binary floating-point number is rep- - Mantissa (23 bits)
resented by a single bit. A 1 bit indicates a negative • Double precision: 64 bits, consisting of
number, and a 0 bit indicates a positive number. - Sign bit (1 bit)
• The mantissa, always a positive number, holds the - Exponent (11 bits)
significant digits of the floating-point number. - Mantissa (52 bits)
• The exponent indicates the positive or negative Figure 3-18 is an example of how the decimal num-
power of the radix that the mantissa and sign should ber 23.5 would be represented in a single precision 32-bit
be multiplied by. floating point binary format.
Figure 3-18 Decimal number 23.5
represented in a single precision 32-bit 0 1 0 0 000 11 0 1 111 0 0 0 0 0 0000000000000
floating point binary format.
Sign bit Exponent Mantissa
(23 bits)
(8 bits)
58 Chapter 3 Number Systems and Codes
pet73842_ch03_046-060.indd 58 03/11/15 3:50 PM