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
What is Underflow Error?
An underflow error occurs when very small numbers are to be represented but there aren’t enough bits available.
What is Overflow Error?
An overflow error occurs when very large numbers are to be represented but there aren’t enough bits available.
Overflow happens in binary addition when a number is too large for the given number of bits.
How many bits is ASCII?
7 bits
How many bits is Unicode?
Anywhere from 8 to 48 bits
What’s the advantage of using Unicode instead of ASCII?
It can represent a wider range of characters
What’s the advantage of using ASCII instead of Unicode?
It takes up less storage space
What is a Parity bit?
A single bit added to a transmission that can be used to check for errors in transmitted data.
How do Parity bits work?
There are two types of parity bit: even and odd.
In even parity, the total number of ones should be even; in odd, it should be odd.
When data is received a “parity check” is carried out. If the parity check is wrong, the computer will request that the sender re-transmits the data.
What is Majority Voting?
When using majority voting, each bit is sent multiple times.
Then it’ll tally up the number of each bit in each section and choose the one there is the most of.
What is the advantage of Majority Voting?
Majority Voting corrects the error
What is the disadvantage of Majority voting?
Means more data must be sent, since each bit must be sent multiple times
What is a Checksum?
Like a parity bit, a checksum is added to the data being transmitted.
However, a checksum is made from the data using an algorithm.
What is a Check Digit?
A check digit is a type of checksum in which only a single digit is added to the transmitted data.
What is a Digital Signal?
A system of discrete states; 1 or 0.
What is an Analogue Signal?
A continuous signal that varies in amplitude or frequency.
Advantages of Analogue signals over Digital signals?
Analogue has more exact values because Digital has a finite range of values between zero and one.
Advantages of Digital signals over Analogue signals?
Has less data to transmit than analogue
Easier to store and compress
What is an ADC and how does it work?
Analogue to Digital Converter; converts an analogue signal into a digital signal.
Regular samples are taken of the amplitude of the analogue signal wave, that amplitude is then converted to a binary integer.
What is a Bitmap Graphic?
A bitmap is organised as a grid of coloured squares called pixels; each different pixel has a colour which is stored by a binary number.
What happens to the quality of a bitmap as it’s enlarged?
It decreases
What is image resolution?
Number of pixels on an image; width * length
What is image resolution?
Number of pixels in an image; width * length
What is the Colour Depth of an image?
The number of bits used to represent each pixel in a bitmap.
How do you figure out the number of colours each pixel could make?
No. Colours = 2^(bits)
What is Nyquist Theorem?
the sampling rate should be at least twice the highest frequency
Lossy Compression
Works by removing non-essential information.
Comes at the cost of quality
Lossless Compression
Works by recording patterns in data rather than actual data, and using these patterns the computer can reverse the procedure and reassemble an image, sound or text file with exact accuracy, and no data is lost.
Can’t reduce size as much as lossy but doesn’t lose any data when it does compress.
Run-Length Encoding (RLE)
an example of lossless compression; takes note of repeated data and writes them in a way they no longer are being repeated.
Dictionary-based compression techniques
The compression algorithm works in a way that searches through the text to find suitable entries in its own dictionary and translates the message accordingly.
What is encryption?
process of converting plaintext into ciphertext
Caesar Cipher
substitution cipher that works by shifting letters of the alphabet along by a given number of characters (key)
brute force attack would only need 25 different possibilities to crack it.
Vernam Cipher
- one-time pad must be equal to or longer in characters than the plaintext but truly random and only used once
- Boolean XOR operation is carried out between binary representation of plaintext and the one-time pad
to decrypt XOR operation carried out on the ciphertext using same one-time pad to restore to plaintext.
What is a MIDI? What does it do?
Musical Instrument Digital Interface
Creates synthesized sounds as requested from from an instrument/software.
How does a MIDI pay sounds? Why are they synthesized and not recorded?
The sounds are triggered by instructions called event messages, which are 2-3 bytes long. Using a synthesized sound means only the instruction is needed to play the sound, reducing data sent.
In assembly language how do you DIVIDE
Logical shift RIGHT
In assembly language how do you MULTIPLY
Logical shift LEFT