Data Rep Flashcards
How does Twos Complement work?
Most significant bit is given a negative value
Range of Twos Complement?
2^(n-1)-1 to -2^(n-1)
Floating point - Binary to Decimal
Convert the exponent to decimal (x)
Place a point x+1 digits into binary number
Convert everything to decimal as you would normally
Floating point - Decimal to Binary
First, find binary version normally
Add a zero to the leftmost side
Move the point to the left until in-between the 0 and 1, count how many movements
Convert number of movements to binary - that is the exponent. Mantissa is the OG binary conversion incl 0
Absolute error method
Difference between actual and given decimal values.
Relative error method
Abs error/Actual value
multiplied by 100
Floating Point allows for…
Allows for larger range of numbers with a given number of bits as exponent can be negative or positive
Large Exponent and small mantissa allows a large range but little precision
Normalisation Method
Split into mantissa and exponent
Shift x positions left or right to get 10 or 01 start
Take away x from decimal exponent value
Combine new mantissa and exponent
Underflow Def
When very small numbers are being represented but there aren’t enough bits available.
Analogue to Digital Conversion
ADC takes regular readings (samples) of analogue signal per second
Samples are quantised
Stored digitally as a bit pattern
Storage formula for Bitmap image
Area*Bit Depth
Minimum value however, may also contain metadata eg height, width, date created and colour depth
Vector Graphics
Geometric shapes stored in a list
List also stores colours, start positions, fill styles, dimensions
Vector Graphics vs Bitmaps
Vector graphics use shapes not pixels hence can be scaled with our quality loss
VG well suited to logos etc but useless for photos
VG uses less storage space as info is stored for each shape instead of each pixel
Sound size formula
Duration * Sample rate * Sample resolution
+ metadata
Nyquist Theorem
Sampling rate must be double sound frequency to accurately represent sound
MIDI
Musical Instrument Digital Interface
Stores event messages instead of sound
Event message contains volume of note, pitch, instrument used etc
MIDI Pros and Cons
Easy manipulation of music without loss in quality
Smaller in size and lossless
HOWEVER produces less realistic sound and can’t be used for storing speech
Lossy compression
Compression with loss of data
Lossless compression
RLE - replaces everything with number of times it occurs in a row
If high level of unique values present then compression is ineffective
Dictionary - Each token is shown given a key, and data is replaced by keys. Dictionary appended to the file.
How does the vernam cipher work
Aligns plaintext and the key
Converts each character into binary
Applies XOR to the two rows
Converts back into character
4 error checking methods
Parity bit - Odd parity makes sure total number of 1s is odd
Majority Voting
Check digit
Checksum - data is modded and then appended to the packet. checked on the other side.