Fundamentals of Data Representation Flashcards
What are Natural Numbers?
All positive numbers and zero; used to count
Denoted by an N
What are Integer Numbers?
All whole numbers, positive and negative
Denoted by a Z
What are Rational Numbers (Quotients)?
Where a number can be written exactly as a fraction of one number over another where the numerator and denominator are whole numbers
Denoted by a Q
Irrational Numbers are the opposite; they have no symbol
What are Real Numbers?
All possible real-world quantities; all rational and irrational numbers
Denoted by an R
What are Ordinal Numbers?
Integers used to describe the position of objects in relation to others. E.g., 1st
Arrays index items using Ordinal Numbers, typically starting with element 0
Why do we use Hexadecimal?
Because it’s the most compact; it can represent long binary numbers in a short form.
How do you convert from denary to hexadecimal?
Convert the denary number into an 8-bit binary number.
Split the binary number into two nybbles (four bits).
Convert each nybble back into denary.
Plug them back into the hex table [0-9=0-9, 10-15=A-F]
For Kibi, Mebi, Gibi, Tebi… how do we work out the number of bits?
Kibi = 2^10, Mebi = 2^20, Gibi = 2^30 etc. It has a base of 2 and increments in powers of 10.
For Kilo, Mega, Giga, Tera… how do we work out the number of bits?
Kilo = 10^3, Mega = 10^6, Giga = 10^9 etc. It has a base of 10 and increments in powers of 3.
What does signed binary mean?
It can be used to represent both positive and negative numbers.
What are the four rules of binary arithmetic?
0 + 0 + 0 = 0 [carry 0]
0 + 0 + 1 = 1 [carry 0]
0 + 1 + 1 = 0 [carry 1]
1 + 1 + 1 = 1 [carry 1]
How do you multiply binary numbers?
Align binary numbers.
Do normal long multiplication.
Add all lines together to find the result.
What does Two’s Complement mean?
In two’s complement, the most significant bit is its negative version.
It’s used to represent negative binary numbers.
How do you subtract binary numbers?
Turn the second binary number into two’s complement negative equivalent.
Add it to the first one.
How do you convert a Binary Number into Two’s Complement?
Move from right to left, until you find the first binary 1.
Flip every bit more significant than that first binary 1.
How do you convert a decimal number to normalised binary number?
Write the number in fixed point binary. (If it’s negative, write the positive version and find its Two’s Complement).
Move the binary point to the most significant instance of 10 or 01 depending on whether it’s positive or negative.
Your exponent is the number of places you moved the binary point. Left = Positive, Right = Negative. Then convert that to binary.
The mantissa is the sequence from the 10/01 section onwards to fill the gap.
How do you convert a floating-point binary number to a decimal number?
Assume that the binary point starts after the first bit in the mantissa.
Move it by the exponent, where right is positive, and left is negative.
Now, whatever is to the left of the point is 1, and to the right of it is a half.
Convert to denary as if it were fixed point.
What is a Rounding Error?
Some decimal numbers can’t be represented exactly in binary. So, we try to get as close as possible.
Sometimes this isn’t very accurate and gives us a “Rounding Error”.
How can you calculate Absolute Error?
Absolute error is the amount by which the given value is inaccurate to the actual value.
It’s found by the difference between the two values.
How do you calculate Relative Error?
A relative error is a measure of uncertainty in a given value compared to the actual value.
Calculated using the formula: relative error = absolute error / actual value
You can multiply by 100 to find this as a percentage.
What are the advantages of Floating-Point Binary instead of Fixed-Point Binary?
It allows for representation of a greater range of numbers.
What are the advantages of using normalised binary?
Maximises precision/accuracy for a given number of bits.
Gives a unique representation of each number.
What are the effects of a greater mantissa and exponent (MARE)?
Greater Mantissa ===> Greater Accuracy
Greater Exponent ===> Greater Range