4.5 Fundamentals of Data Representation Flashcards
How many different values can be represented with n bits?
2^n
What are the 4 binary prefixes?
kibi, Ki - 2^10
mebi, Mi - 2^20
gibi, Gi - 2^30
tebi, Ti - 2^40
What are the 4 decimal prefixes?
kilo, k - 10^3
mega, M - 10^6
giga, G - 10^9
tera, T - 10^12
In unsigned binary, what are the minimum and maximum values for a given number of bits, n
minimum : 0
maxiumum : (2^n) - 1
What can be represented using signed binary?
Negative integers
In two’s complement:
when is the leftmost value negative?
When it is a 1
Why are binary representation of decimals sometimes inaccurate?
Some numbers can never be represented in binary, such as decimal number 0.1
How do you normalise floating point binary?
Convert the number to normal binary. Shift the decimal point n times until there is only 1 digit before it (1.0 if negative, 0.1 if positive). This become the mantissa.
The exponent becomes n in binary form (this also uses two’s complement)
What is overflow?
When the absolute value of a number is too high for the computer to represent it.
What is underflow?
When the absolute value of the number is too close to zero for the computer to represent it.
How many bits are needed to represent ASCII?
7