Looks like no one added any tags here yet for you.
What is an unsigned binary number?
A binary number representing a positive number
What does signed binary allow for?
Representation of negative numbers in binary
What is the range of numbers that can be represented by unsigned binary?
Depends on the number of bits available (2^n)
What are the rules when adding two unsigned binary numbers?
- 0 + 0 = 0
- 0 + 1 = 1
- 1 + 1 = 10
- 1 + 1 + 1 = 11
How are unsigned binary integers multiplied together?
- Choose and write the guide number
- Write the second number under every instance of 1 in the guide number
- Align the least significant bit with the 1 in the guide number
- Add the columns together, excluding the guide
What is two’s complement?
A coding scheme in which the most significant bit is given a negative place value
How can subtraction be down using two’s complement?
- Convert the subtractor to two’s complement binary
- Add the two numbers together
What is the range of numbers that can be represented with two’s complement binary?
From 2^(n-1) - 1 to 2^(n-1)
How can binary be used to represent numbers with a fractional part?
- Fixed point form
- Floating point form
How is a fractional number represented using fixed point binary?
A specified number of bits are placed before a binary point and the remaining fall behind
What does the placement of the binary point in fixed point notation determine?
The range and precision of representation
- Close to the left → good precision but small range
- Close to the right → increased range but low precision
How is a fractional number represented using floating point binary?
- A number of bits are allocated to the mantissa
- The remaining form the exponent
What is the advantage of using floating point?
Allows for representation of a greater range of numbers with a given number of bits than fixed point
Why are floating point numbers normalised?
To provide the maximum level of precision for a given number of bits
What does a large exponent and a small mantissa allow for?
Large range but little precision
What does a small exponent and a large mantissa allow for?
Good precision but a small range
How is a floating point number converted to decimal?
- Convert the exponent to decimal
- Move the binary point by the number positions specified by the exponent
- Treat the mantissa as a fixed point binary number and convert it to decimal
How is a decimal number converted to floating point?
- Convert the decimal number to fixed point binary
- Normalise the result (01 for positive and 10 for negative)
- Move the binary point until it is between the first two digits
Why might some representations of decimal numbers be inaccurate?
There a numbers that binary cannot possibly accurately represent
→ e.g. 1/3
What are the types of error?
- Absolute
- Relative
What is absolute error?
The actual amount by which a value is inaccurate
How is absolute error calculated?
Find the difference between the given value and the actual value
What is relative error?
A measure of uncertainty in a given value compared to the actual value which is relative to the size of the given value
How is relative error calculated?
absolute error / actual value
→ x100 to give percentage error
How is a number normalised?
- Split into mantissa and exponent
- Adjust the mantissa to 01 or 10 and shift the bits accordingly
- Reduce the exponent by 2 to ensure the same number is represented
What are the types of error when working with binary?
- Overflow
- Underflow
When do underflow errors occur?
When there are not enough bits available to represent very small numbers
When do overflow errors occur?
When a number is too large to be represented with the available bits
→ Especially important when using signed binary