Floating Point Arithmetic Flashcards

(24 cards)

1
Q

How are integers represented in computing?

A

Integers can be represented exactly using a fixed number of bits.

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

What is the largest unsigned integer that can be represented with n bits?

A

(2^n) - 1

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

How are negative integers represented in computing?

A

Using two’s complement notation.

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

Why do we need floating point representation?

A

Many scientific calculations involve non-integer values.

e.g., mass of an electron

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

What key feature makes floating point representation different from integer representation?

A

The decimal point can float, allowing for a wide range of values.

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

What components make up a floating point number?

A
  1. Significand/Mantissa
  2. Exponent
  3. Base
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How would 9.109 × 10−31 be represented in floating point?

A
  • Significand: 9.109
  • Base: 10
  • Exponent: -31
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the most widely adopted standard for floating point arithmetic? What does it specify?

A
  • IEEE 754
    It specificies:
  • Number representations (e.g., single precision, double precision)
  • How operations like addition, subtraction, multiplication, and division behave
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the two most commonly used floating point precisions in C?

A
  • Single Precision: 32-bit (float)
  • Double Precision: 64-bit (double)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why is double precision preferred for scientific computing?

A

It provides greater accuracy and range compared to single precision

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

What happens if a number exceeds single precision limits?

A

It is represented as infinity (inf)

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

How many bits does double precision floating point use? How are they split?

A

64-bits (8-bytes):
- 52 bits for the mantissa
- 11 bits for the exponent
- 1 bit for the sign

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

What does it mean for a floating point number to be normalised?

A

The exponent bits are not all 0s and not all 1s

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

How is a normalised floating point number represented in IEEE 754?

A

x=±(1.b{1}.b{2}…b{52}) x 2^(a{1}.a{2}…a{11})-1023
where:
- b{1}, b{2}, …b{52} are the mantissa bits
- a{1}, a{2}, …a{11} are the exponent bits

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

What is the smallest normalised double precision number? What is the largest?

A
  • Small: 1 x 2^(1−1023) ≈ 10^(−308)
  • Large: (2-2^-52) x 2^(2046-1023) ≈ 10^308
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Why are floating point numbers not always exact?

A

Because they have finite precision, leading to rounding errors.

17
Q

What is machine epsilon?

A
  • The smallest difference between 1 and the next representable number
  • For double precision, approximately: 2^(−52) ≈ 10^(−16)
18
Q

What are the five floating point exceptions in IEEE 754?

A
  1. Overflow (Result is too large) → inf or -inf
  2. Underflow (Result too small) → 0 or subnormal
  3. Divide by Zeroinf or -inf
  4. InvalidNaN
  5. Inexact → Rounded result
19
Q

What is peak performance (R_{peak})?

A

The theoretical maximum performance of a system, measured in FLOP/s.

20
Q

How is R_{peak} used in HPC rankings?

A

It is listed in Top500 rankings, but R_{max} is used for final ranking.

21
Q

What system factors determine R_{peak}?

A
  1. Number of sockets
  2. Number of processor cores per socket
  3. Clock frequency
  4. Number of operations per cycle
22
Q

What modern features can increase the number of operations per cycle?

A
  • Vector instructions: operates on multiple numbers at once
  • Fused Multiply-Add operations: can multiply and add in one instruction
23
Q

Given:
- 2 sockets
- 6 cores per socket
- 2.8 GHz clock speed
- 4 operations per cycle

What is the compute node R_{peak}?

A

R_{peak} = 2×6×2.8×4 = 134.4GFLOP/s

24
Q

If a cluster has 192 compute nodes, where each compute node’s R_{peak} = 134.4 GFLOP/s, what is its peak performance?

A

192×134.4GFLOP/s = 25.2TFLOP/s