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
What is the advantage and disadvantage of fixed point binary?
Advantage:
Binary point is set in a fixed position - does not need to be stored in memory
Disadvantage:
Allocation of the bits between the whole part and fractional part cannot change - trade-off between the number of bits allocated to the
the whole and fractional part
- Large whole part = large values without fractional detail
- Large fractional part = precise decimal values represented with small whole numbers
What are the 2 advantages of floating point binary?
More flexible technique - allows the way that the bits are allocated to vary so that both very large and very small numbers can be represented
2’s complement used for both the mantissa and the exponent - allows positive and negative values to be stored
Why may both fixed point and floating point representations of decimal numbers be inaccurate? (3 points)
In fixed point form, truncation can occur when numbers with large fractional points (or recurring binary sequences) needing to be represented using a specific number of bits
The bits that come after the available places are filled are dropped or rounding is used
The mantissa in floating point follows the same form
Define ‘absolute error’ and ‘relative error’.
Absolute error - the difference between the approximate value of the binary representation of a number and the original value of the number
Relative error - the absolute error divided by the original value of the number
Define ‘under/overflow’.
When the result of a calculation is too small/large to be represented with the available number of bits
What are the 4 advantages of vector graphics over bitmap images?
Can be resized without distortion
File sizes are usually smaller - especially when they do not include many intricate shapes
Much easier to create and edit images - each object in a vector graphic can be adapted independently by using its set of attributes
High-quality resolution - stays good quality, regardless of the resolution of the medium that they are displayed on
What is the advantage of bitmapped graphics over vector graphics? (2 points)
Can depict almost any level of complexity and detail
Vector graphics produced by combining limited number of shapes - variety of images they can represent is restricted
How are digital sound files created from analogue sound waves? (3 points)
- Microphone picks up sound waves - converts the waves into analogue electrical signals
- Signals are processed by an ADC which does sampling - takes measurements of level of analogue signal at regular time intervals
- Measurements are assigned a binary pattern and stored in the computer’s memory
What are MIDI files and what do they explain? (4 points)
Files consisting of a list of instructions orevent messages
They explain:
- What notes must be played
- When they must be played
- How long or loud each note should be