Floating Point Arithmetic Flashcards
(25 cards)
Why is floating point arithmetic importent?
We need to be able to handle very small and very large numbers and need a representation where the decimal point can move.
How is a floating-point number represented?
The floating point representation has a base and a precision. It takes the form:
d.dddd x b^e
Where d.dddd is the significand (mantissa) which has p digits. and e is the exponent.
What is IEEE 754?
It is the most widely adopted standard for floating-point arithmetic. The standard specifies number representations as well as how operations should behave.
What is double precision?
Double precision is a representation of a floating point number using 64 bits.
Why is double precision used?
Floating point numbers are an approximation of the actual number and have a finite accuracy and finite range. Because of the range and accuracy needed for scientific and engineering calculations double precision is used.
How are the 64 bits of double precision split?
52 bits for the mantissa, 11bits for the exponent, 1 bit for the sign
What is a normalised floating point number?
A floating point number that has an exponent that is neither all zeros or all ones.
What is the smallest normalised numbers structure?
All mantissa bits are 0, all exponent bits are 0 except the last.
What is the largest normalised number structure?
all mantissa bits are 1 and all exponent bits are 1 except the last
What is the machine epsilon?
The difference between 1 and the next largest representable floating point number.
What is round off error?
The error introduced from the difference between the floating point approximation and the actual number represented.
What does it mean for a solution to be machine precise?
If the error from the numerical method is smaller than the error from the floating point representation.
What is an exceptional value?
If the exponent bits of a floating point number are all 1’s or all 0’s.
What is a subnormal floating-point number?
A number with all the exponent bits as 0s.
Why are subnormal numbers sometimes used?
They expand the range around 0 and allow for more gradual underflow.
How are infinities and NaNs represented?
- inf - all exponent bits are 1s, all mantissa bits are 0s
- -inf - all exponent bits are 1s, all mantissa bits are 0s, sign bit is 1
- NaN - all exponent bits are 1s and not all mantissa bits are 0
What are the 5 floating point exception types?
- Overflow
- Underflow
- Divide by zero
- Invalid
- Inexact
How can exceptions be handled?
Floating point errors set a flag in the hardware and can be trapped for debugging.
What is peak performance?
The theoretical maximum performance of a system
What are the 4 main areas performance depends on?
- The number of sockets
- The number of processor cores per socket
- The clock frequency
- The number of operations per cycle
Which two techniques allow for multiple clock operations per cycle?
- vector instructions
- fused multiply-add
How is node peak performance caluclated?
Rpeak = Sockets X CoresPerSockets X Clock X OperationsPerCycle
How is cluster peak performance calculated?
Multiple node peak performance (Rpeak) by the number of compute nodes
What can influence the number of floating point instructions per cycle?
- The instruction set
- Precision