Number systems and floating point numbers Flashcards
What is normalised form of floating point numbers?
A floating point number needs an implied binary point after most significant bit.
Always in twos complement.
The first two values are always different
Problem with FP numbers?
FP numbers can only represent a finite amount of real numbers. Some numbers such as 3.8 cannot be represented as .8 cannot be represented in binary. Therefore a loss in precision
Define Absolute error and Relative error?
Absolute error: The difference between the actual value and the nearest representable value for a given number of bits.
Relative error: Percentage of the actual value
For FP numbers, how do you get:
Largest positive
Smallest positive
Largest magnitude negative
Smallest magnitude negative
Largest positive: Most positive mantissa and Most positive exponent
Smallest positive: Least positive mantissa and Most negative exponent
Largest magnitude negative: Most negative mantissa and Most positive exponent
Smallest magnitude negative: Least negative mantissa and Most negative exponent
Define an overflow and an underflow
Overflow: Number too large to be represented by number of bits
Underflow: Number too small to be represented by number of bits
What are the different number systems and what letters are attributed to them
Real number: R
Rational number: Q
Integer: Z
Natural numbers: N
Irrational numbers: R/Q
Ordinals numbers (describes position like 1n, 2n): N/a
Define binary, denary and Hexadecimal
Denary is counting in base 10, each digit is multiple of 10
Binary is in base 2, each digit is multiple of 2
Hexadecimal is in base 16, each digit is multiple of 16 (0-9 and A-F)
How do you add and multiply binary numbers.
ADD: Put in columns and then for 0 and 1 put down a 1. For 0 and 0 put down a 0. For 1 and 1 put down a 0 and carry over a 1.
MULTIPLY: Exactly like normal column method
- 0111 0010 + 0111 0010
- 0000 0011 + 0000 1110
- 1101 1001 + 0011 1101
- 1110 0100
- 0001 0001
- 1 0001 0110 (the first digit is an overflow)
- 1101 * 11
- 10101 * 101
- 11101 * 10111
- 10 0111
- 110 1001
- 101 0011 011