4.5 - Fundamentals of data representation Flashcards
What are natural numbers? (2 points)
Symbols used to count objects
ℕ of natural numbers = {0, 1, 2, 3, …}
What are whole numbers? (2 points)
Any positive or negative whole numbers (integers)
ℤ = { …, -3, -2, -1, 0, 1, 2, 3, … }
What are rational numbers? (2 points)
Values that can be expressed as fractions or ratios
ℚ - the set of numbers that can be written as fractions (ratios of integers)
What are irrational numbers?
Numbers that cannot be expressed exactly as a fraction
What are real numbers? (2 points)
Numbers used for measurement/any positive or negative number with/without a fractional part
ℝ - the set of all ‘possible real world quantities’
What are ordinal numbers?
Numbers that describe the numerical position of objects
What are the 3 number systems in Computer Science?
Denary - base-10 (0-9)
Binary - base-2 (0-1)
Hexadecimal - base-16 (0-9, A-F)
How do you convert from denary to binary? (3 steps)
- Divide number by 2 and take remainder as last digit.
- Keep dividing result by 2 until result of division = 0.
- Write digits right to left to get the binary number.
How do you convert from denary to hexadecimal and vice-versa? (4 steps)
Denary -> Hexadecimal
1. Divide the number by 16 to get the quotient and remainder.
- Convert the quotient and remainder into hexadecimal digits and put them together.
How do you convert from binary to hexadecimal and vice-versa?
Split the number into 2 halves, convert each and then put the halves back together
What are the 4 advantages of hexadecimal over binary?
Much easier to remember than a binaryvalue
Quicker to write/type - digits only takeup 1 character, not 4
Less likely to make an error - fewer characters
Easy to convert to and from binary
Define ‘bit’.
The fundamental unit of information
What are the 4 SI-established binary prefixes?
Kilo = 10^3 B
Mega = 10^6 B
Giga = 10^9 B
Tera = 10^12 B
What are the 4 IEC-established binary prefixes?
Kibi = 2^10 B
Mebi = 2^20 B
Gibi = 2^30 B
Tebi = 2^40 B
How do you multiply two binary numbers together? (6 points)
First number = multiplicand
Second number = multiplier
If multiplier bit = 1: Write down multiplicand
If multiplier bit = 0: Write down a line of 0s with the same amount of bits as the multiplicand
Shift the partial product to the left by one bit with every bit multiplied
Add the partial products together to attain the product