IEEE 754 Floating Point Flashcards

1
Q

What is the most common representation for real numbers on computers?

A

IEEE Standard 754 floating point

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What form does floating point encode rational numbers/values?

A

V = x × 2^y

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What types of computations is floating point useful for?

A
  • Very large numbers: |V|&raquo_space; 0
  • Numbers very close to 0: |V| &laquo_space;1
  • Approximation to real numbers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the bit size of single precision in floating point representation?

A

32 bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the bit size of double precision in floating point representation?

A

64 bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the range of single precision floating point?

A

+/- 2^-149 to +/- 2^127

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the range of double precision floating point?

A

+/- 2^-1074 to +/- 2^1023

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does overflow mean in floating point representation?

A

Values have grown too large for the representation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does underflow mean in floating point representation?

A

A value too small to be represented, resulting in a loss of precision

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a characteristic of real numbers in floating point representation?

A

Having a decimal portion that is not necessarily equal to 0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How is the decimal number 123.14 represented in base 10?

A

110^2 + 210^1 + 310^0 + 110^-1 + 4*10^-2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the digit format for a decimal number?

A

dmdm-1…d1d0.d-1d-2…d-n

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How is a binary number like 110.11 represented in base 2?

A

12^2 + 12^1 + 02^0 + 12^-1 + 1*2^-2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the digit format for a binary number?

A

bmbm-1…b1b0.b-1b-2…b-n

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What happens when you shift the binary point one position left?

A

Divides the number by 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What happens when you shift the binary point one position right?

A

Multiplies the number by 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

True or False: Numbers like 0.111…11 base 2 can represent numbers just below 1.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What type of numbers can fractional binary notation represent exactly?

A

Rational numbers with denominators that are powers of 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is an example of a number that cannot be represented exactly in binary?

A

1/3 and 5/7

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is the general form for numbers that can be represented in fractional binary notation?

A

x * 2^y (for integers x and y)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How can increasing accuracy be achieved in binary representation?

A

By lengthening the binary representation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Fill in the blank: Only finite-length encodings can be stored; ______ and 5/7 cannot be represented exactly.

A

1/3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the typical format for a number in scientific notation?

A

Only 1 digit to the left of the decimal point

Example: 6.385 * 10^4 equals 63,850

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What are the four fields when representing a number in scientific notation?
* Sign * Left side of decimal point * Right side of decimal point * Exponent
26
True or False: The IEEE 754 standard is used for consistent floating-point representation across computers.
True
27
What does the biased representation allow for negative numbers?
Operations on the biased numbers to be the same as for unsigned integers
28
What is the bias value typically chosen based on?
The number of bits available for representing an integer
29
What are the three fields in the encoding of a real number value in IEEE 754?
* S field (sign field) * E field (exponent field) * F field (significand/mantissa field)
30
What does the S field in IEEE 754 represent?
Encodes the sign of the number: 0 for positive, 1 for negative
31
What is the formula for the real number decimal value represented in IEEE 754?
(-1)^s * (f) * (2^e)
32
How is the exponent represented in the E field of IEEE 754?
E is an 8-bit biased integer representing the exponent e
33
What is the bias value for single precision (32-bit) representation in IEEE 754?
127
34
What is the bias value for double precision (64-bit) representation in IEEE 754?
1023
35
Fill in the blank: In IEEE 754, the exponent field (E) contains ______ plus the true exponent for single precision.
127
36
What is the significance of the hidden bit in IEEE 754?
It is implied to be 1 for normalized numbers and not stored in the encoding
37
What are the three types of values used in IEEE 754?
* Denormalized values * Normalized values * Special values (e.g., +/- infinity, NaN)
38
What does NaN stand for in IEEE 754?
Not a Number
39
What is the purpose of denormalized values in IEEE 754?
To provide gradual underflow and fill the gap between zero and the smallest normalized number
40
How is the exponent determined from the biased representation?
e = E - bias
41
What happens during abrupt underflow in floating-point representation?
The relative change is infinite
42
True or False: Denormalized values are used to keep the relative difference between tiny numbers small.
True
43
What is the effect of using denormals compared to abrupt underflow?
Denormals provide a more reasonable relative change in calculations
44
How do you represent the decimal number 64.2 in IEEE standard single precision?
Follow a 5-step process to obtain Sign(S), Exponent(E), and Mantissa(F)
45
What is the first step to convert a decimal number into IEEE 754 format?
Get a binary representation for the whole number and fractional parts
46
What is the binary representation of 64?
0100 0000
47
What is the binary representation of 0.2?
.0011 0011 0011…
48
What happens during normalization of the binary representation?
Make it look like scientific notation with a single 1 to the left of the binary point
49
What is the normalized form of 64.2?
1.0000 0000 1100 1100 1100 110 x 2^6
50
What is the true exponent (e) for the normalized form of 64.2?
6
51
What is the binary representation of the exponent E for 64.2?
1000 0101
52
How many bits are reserved for the mantissa in single precision?
23 bits
53
What is the mantissa stored (F) for 64.2 in IEEE 754?
000 0000 0110 0110 0110 0110
54
What is the final IEEE 754 representation for 64.2?
0 1000 0101 000 0000 0110 0110 0110 0110
55
What is the purpose of denormals in floating-point representation?
Denormals fill the gap between 0 and the smallest floating-point number that is 252 times the size of the difference between the smallest two numbers ## Footnote Denormals are used to represent numbers that are too small to be represented as normal floating-point numbers, ensuring a gradual underflow instead of abrupt underflow.
56
What happens during abrupt underflow in floating-point arithmetic?
The difference between two tiny but different numbers becomes zero if it is less than the minimum cutoff value ## Footnote This leads to the violation of the equivalence x == y when x and y are close but not equal.
57
How does gradual underflow differ from abrupt underflow?
Gradual underflow allows the difference between two tiny but different normal numbers to become a denormal, preserving the equivalence ## Footnote In contrast, abrupt underflow results in a loss of distinction between the two values.
58
Is it advisable to use denormals on purpose in calculations?
No, using denormals on purpose is not advised ## Footnote Denormals were designed only as a backup mechanism in exceptional cases.
59
Fill in the blank: Denormals were designed as a _______ mechanism in exceptional cases.
backup
60
For floating point types, even whet there is no overflow and no underflow, the ____ matters
Order
61
Addition or subtraction of locating point numbers of differing magnitude involves a loss of _____
Precision
62
Summary: 5 step process to obtaining _____, _______, and _________
Sign (S), Exponent (E), Manitssa(F)
63
Ex using 76.875 First step
Get binary representation which is 100 1100.111
64
Step 2
Normalize the binary representation (make it look like scientific notation)
65
Important: the bit to the left of the binary poin will be considered the ______ bit. It does not appear in the encoding, but it is implied by the value of the exponent
Hidden
66
Step 3
Biasthe exponent to get E (either add 127 or 1023 depending on precision)
67
Step 4 THe Mantissa/significant stored (F) is the value to the right of the binary point in the normalize form. How many bits to we need for single precision
23
68
Step 5
Put it all together. Sign bit is 1 bit, exponent is 8 bits, and manitssa is 23 bits for single precision