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

25
Q

What are the four fields when representing a number in scientific notation?

A
  • Sign
  • Left side of decimal point
  • Right side of decimal point
  • Exponent
26
Q

True or False: The IEEE 754 standard is used for consistent floating-point representation across computers.

27
Q

What does the biased representation allow for negative numbers?

A

Operations on the biased numbers to be the same as for unsigned integers

28
Q

What is the bias value typically chosen based on?

A

The number of bits available for representing an integer

29
Q

What are the three fields in the encoding of a real number value in IEEE 754?

A
  • S field (sign field)
  • E field (exponent field)
  • F field (significand/mantissa field)
30
Q

What does the S field in IEEE 754 represent?

A

Encodes the sign of the number: 0 for positive, 1 for negative

31
Q

What is the formula for the real number decimal value represented in IEEE 754?

A

(-1)^s * (f) * (2^e)

32
Q

How is the exponent represented in the E field of IEEE 754?

A

E is an 8-bit biased integer representing the exponent e

33
Q

What is the bias value for single precision (32-bit) representation in IEEE 754?

34
Q

What is the bias value for double precision (64-bit) representation in IEEE 754?

35
Q

Fill in the blank: In IEEE 754, the exponent field (E) contains ______ plus the true exponent for single precision.

36
Q

What is the significance of the hidden bit in IEEE 754?

A

It is implied to be 1 for normalized numbers and not stored in the encoding

37
Q

What are the three types of values used in IEEE 754?

A
  • Denormalized values
  • Normalized values
  • Special values (e.g., +/- infinity, NaN)
38
Q

What does NaN stand for in IEEE 754?

A

Not a Number

39
Q

What is the purpose of denormalized values in IEEE 754?

A

To provide gradual underflow and fill the gap between zero and the smallest normalized number

40
Q

How is the exponent determined from the biased representation?

A

e = E - bias

41
Q

What happens during abrupt underflow in floating-point representation?

A

The relative change is infinite

42
Q

True or False: Denormalized values are used to keep the relative difference between tiny numbers small.

43
Q

What is the effect of using denormals compared to abrupt underflow?

A

Denormals provide a more reasonable relative change in calculations

44
Q

How do you represent the decimal number 64.2 in IEEE standard single precision?

A

Follow a 5-step process to obtain Sign(S), Exponent(E), and Mantissa(F)

45
Q

What is the first step to convert a decimal number into IEEE 754 format?

A

Get a binary representation for the whole number and fractional parts

46
Q

What is the binary representation of 64?

47
Q

What is the binary representation of 0.2?

A

.0011 0011 0011…

48
Q

What happens during normalization of the binary representation?

A

Make it look like scientific notation with a single 1 to the left of the binary point

49
Q

What is the normalized form of 64.2?

A

1.0000 0000 1100 1100 1100 110 x 2^6

50
Q

What is the true exponent (e) for the normalized form of 64.2?

51
Q

What is the binary representation of the exponent E for 64.2?

52
Q

How many bits are reserved for the mantissa in single precision?

53
Q

What is the mantissa stored (F) for 64.2 in IEEE 754?

A

000 0000 0110 0110 0110 0110

54
Q

What is the final IEEE 754 representation for 64.2?

A

0 1000 0101 000 0000 0110 0110 0110 0110

55
Q

What is the purpose of denormals in floating-point representation?

A

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

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
Q

What happens during abrupt underflow in floating-point arithmetic?

A

The difference between two tiny but different numbers becomes zero if it is less than the minimum cutoff value

This leads to the violation of the equivalence x == y when x and y are close but not equal.

57
Q

How does gradual underflow differ from abrupt underflow?

A

Gradual underflow allows the difference between two tiny but different normal numbers to become a denormal, preserving the equivalence

In contrast, abrupt underflow results in a loss of distinction between the two values.

58
Q

Is it advisable to use denormals on purpose in calculations?

A

No, using denormals on purpose is not advised

Denormals were designed only as a backup mechanism in exceptional cases.

59
Q

Fill in the blank: Denormals were designed as a _______ mechanism in exceptional cases.