Binary Flashcards
Define unsigned binary:
Binary that only represents positive numbers
0+0:
0
0+1:
1
1+1:
0, carry 1
1+1+1:
1, carry 1
Binary multiplication rules:
Multiply the first number by each digit of the second, shifting one left each time. Each result will be 0 or the original number shifted by an appropriate amount. Then add all the results.
Define two’s complement:
A method of working with signed binary values
How does two’s complement work:
The most significant bit is negative, the rest are positive.
How to convert positive numbers to negative ones:
Flip all the digits, then add 1
Binary subtraction rules:
Convert the number being subtracted into a negative number, then add them
Define fixed point:
Where the decimal point is in a fixed position in a number
Where is the decimal point in a fixed point number:
It can be anywhere, it just can’t move so the size of the number is limited by where it is
Define floating point:
Where the decimal point can move within a number
What is the benefit of floating point numbers:
It means less bits are needed, and that a wider range of numbers is available
Define mantissa:
The actual number being represented in floating point, not to the actual power
Define exponent:
What power the mantissa is raised to to give the actual number
If the exponent is positive, what happens to the point:
The point shifts left - the mantissa increases in size
If the exponent is negative, what happens to the point:
The point shifts right - the mantissa becomes smaller
Where is the decimal point in a normalised floating point number:
After the most significant bit of the mantissa
What are floating point numbers equivalent to in decimal:
Standard form
What is the benefit of fixed point numbers:
Less processing is required, so it’s faster and the absolute error is always the same
Define signed binary:
Binary that can represent positive and negative numbers
Define overflow error:
When a number is too big to be represented with the allocated number of bits
Define underflow error:
When a number is too small to be represented with the allocated number of bits
Define precision:
How accurate a number is
Define normalisation:
A process for adjusting numbers onto a common scale
How much is a positive number adjusted to be normalised:
It should have a 0 as the most significant bit, and a 1 after it
How much is a negative number adjusted to be normalised:
It should have a 1 as the most significant bit, and a 0 after it
Define rounding error:
When the actual number can’t be represented in the available number of bits or at all (like 1/3), so it is up to the programmer to decide how accurate it needs to be
Define absolute error:
The error interval between the actual number and the number being used
How to calculate the absolute error:
The smaller number subtracted from the larger number (it’s always positive)
Define relative error:
The comparative error between the number and how accurate it needs to be
How to calculate the relative error:
The absolute error divided by the actual number
Where is the point in a normalised number:
After the MSB