Lecture31 - 0306-250 Assembly Language Programming Lecture Thirty-One • Floating-Point Representation C Floating-Point Numbers(Platform Dependent

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 0306-250 Assembly Language Programming Lecture Thirty-One • Floating-Point Representation C Floating-Point Numbers (Platform Dependent) Intel processors (in general) • float IEEE-754 single precision (32 bits) • double IEEE-754 double precision (64 bits) • long double Intel IA-32 double extended precision (80 bits, but may be stored in 96 or 128 bits) 2 Floating-Point Nomenclature Decimal Scientific Notation X = a ´ 10b – a: Significand or mantissa – b: Exponent • Binary Scientific Notation X = a ´ 2b – a: Binary significand or mantissa – b: Binary exponent Basis of binary floating-point representations 3 IEEE-754 Single Precision • Value = (-1)S ´ 2E-127 ´ 1.F – S: sign – E: biased exponent – F: fractional part of significand (normalized) • 32 bits 1 bit 8 bits 23 bits S E F 31 23 0 4 IEEE-754 Double Precision • Value = (-1)S ´ 2E-1023 ´ 1.F – S: sign – E: biased exponent – F: fractional part of significand (normalized) • 64 bits 1 bit 11 bits 52 bits S E F 63 52 0 5 Intel IA-32 Double Extended-Precision • Value = (-1)S ´ 2E-16383 ´ I.F – S: sign – E: biased exponent – I: integer part of significand • 1: normalized numbers, infinities, and NaNs • 0: denormalized numbers and zero – F: fractional part of significand • 80 bits 1 bit S 15 bits 1 bit E 79 1 64 63 63 bits F 0 6 IEEE-754 Special Representations Zero, infinity, and not a number (NaN) • ± 0 (zero) –E=0 –F=0 • ± ¥ (infinity) – E = Maximum value –F=0 • NaN (not a number) – E = Maximum value –F¹0 7 IEEE-754 Single-Precision Example I Represent 0.7510 in IEEE-754 SP format • Convert to binary: 0.112 • Normalize: 1.1 ´ 2-1 • Calculate field values: (-1)S ´ 2E-127 ´ 1.F – S = 0 (1 bit) – E = -110 + 12710 = 12610 = 011111102 (8 bits) – F = 100000000000000000000002 (23 bits) 1 31 30 8 23 22 23 0 0 0 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 S E F 8 IEEE-754 Single-Precision Example II Represent -2048.12510 in IEEE-754 SP format • Convert to binary: -100000000000.0012 • Normalize: -1.00000000000001 ´ 211 • Calculate field values: (-1)S ´ 2E-127 ´ 1.F – S = 1 (1 bit) – E = -1110 + 12710 = 13810 = 100010102 (8 bits) – F = 000000000000010000000002 (23 bits) 1 31 30 8 23 22 23 0 1 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 S E F 9 ...
View Full Document

This note was uploaded on 05/06/2010 for the course EECC 0306-250 taught by Professor Roymelton during the Fall '10 term at RIT.

Ask a homework question - tutors are online