Data Representation Flashcards
What is a number base?
The amount of symbols, notations it used to represent value
How many digits are in it’s number system
Describe the binary base
Base 2 : 0 and 1
Starts from 1 and double up the column, right to left
How do you do binary addition?
1+0=1
0+0=0
1+1=0 carried 1
1+ 1+1 = 1 carried 1
What are binary shifts used for?
Multiplying or dividing by powers of 2
Left shift =✖️
Right shift = ➗
Eg : n shifts left is ✖️2^n
What happens when 1s are lost?
The answer will be a lot more inaccurate
What is hexadecimal?
Base 16
0-15 (0-F)
Each hexadecimal is represented in nibbles
*still not understood by computers
Why is hex preferred?
💻reduces large binary strings into nibbles
💻 Simpler to remember large number
💻easier to convert between hex and binary than decimal
💻less chance of input errors
What is an overflow error?
The calculation requires more bits than available
What is a bit?
Smallest measure of data
0 or 1
What is a nibble?
4 bits
What is a byte?
8 bits
What is a kilobyte?
1000 bytes **3
8000 bits
What is a megabyte?
1000 kilobytes
1,000,000 bytes
8,000,000 bits
1*10^6
What is a gigabyte
1000 megabytes
1*10^9
1,000,000,000 bytes
What is a terabyte?
1000 gigabytes
1*10^12
1,000,000,000,000 bytes
How do you calculate how many values can be made from a specific number of bytes?
Eg a nibble - 4 bits
n = amount of bits
2^n =how many different values can be made
What is a character set?
A group of characters that a computer recognises from their binary representation
Describe ASCII
〽️7 bits , 128 characters
〽️represents English alphabet, numbers , symbols, commands
〽️A=65
Describe Unicode
〽️used for all languages
〽️used 16 bits, 65,000 characters
〽️first 128 codes are the same as ASCII
Which is easier dec to hex or binary to hex?
Binary to hex as splitting into nibbles is a lot easier
How do you convert from hex to decimal?
Put it into a 16&1 chart
How do you convert from decimal to hex?
Divide number by 16 and remainder goes in one’s column
How do you convert binary to hex?
Split in nibbles
In the 8421 column find the decimal value
Place it so that it fits in hex
Eg 15: F
How do you convert hex to binary?
Convert to nibbles
Add the two nibbles together to forms byte
What is metadata?
Information about the file, eg date of file/ size of file code
What is a pixel?
Small squares of colour that make up a bitmap image. Too small for the human eye to see so it appears as though the colours are merged together.
Each pixel is represented by a binary number
What is the colour depth?
The number of bits used for each pixel
Total colours= 2^n
(n= colour depth)
Measured in bits per pixel
What is image resolution /size ?
The number of pixels in a specific area of an image
Width ✖️height
The higher the resolution, the more pixels and the better the quality is.
How do you calculate the file size of an image ?
Image:
In bytes= (resolution *colour depth)/8
How is sound stored on a computer?
Recorded analogue signal stored digitally
SAMPLING the amplitude of the wave at regular intervals
What is sample rate?
The number of samples taken per seconds, measured in hertz. Higher sample rate means higher quality
What is sample resolution ?
The number of bits used to record each sample.
Increasing this will help pick up more background noises , therefore making or sound closer to the original (increases quality)
What is bit rate?
The measure of how much data is processed for each second of sound
Bit rate= sample rate * bit depth
How do you calculate the file size of sound?
Bytes
= sample rate✖️sample resolution ✖️length (seconds)➗8
What is meant by ‘analogue’ ?
Normal what is recorded by the microphone.
A continuous signal, which can’t be processed by a computer. Therefore must be converted into electrical.
What is sound sampling?
Taking samples of the of the amplitude of the wave are taken at regular intervals and stored as a binary value.
What is data compression?
The method is reducing file size , while trying to make the compressed file s true to the original as possible.
What is the impact of increasing sample rate and resolution?
Sample rate: will increase the quality as it will match more closely to the original recording.
Sample resolution: will pick up more quieter sounds, resulting in a smaller sound that is closer to the quality of the original.
What are some uses of data compression?
0️⃣smaller files take up less storage on a device
0️⃣streaming and downloading files from the internet is quicker as they take up less bandwidth
0️⃣allows web pages to load more quickly into web browsers
0️⃣Emails have restrictions on size, but with compression you can send attachments
What is Lossy compression?
Permanently removing data from the file , to limit the number of bits the file needs , therefore reducing space.
✅less bandwidth
✅reduce a lot of file size
❌cannot be used on text or software files
❌cannot regain original file , but the worse quality is normally unnoticeable
MP3 , AAC ,JPEG
What is lossless compression
Data is removed temporarily, so reduction in quality. then restores to it’s original state ✅can be Used for software and text files ❌only slight reduction in file size FLAC, TIFF, PNG
Huffman
Lossless data compression
- Make a frequency tally for the amount of times a letter was used
- Order it from lowest to highest
- put the two lowest together and addd the Total, keep on branching off until all the values are done.
- Zeros on the left hand side
- On the chart add the new binary values
How do you calculate the size of Huffman encoding
Times the frequency by the amount of bits used to represent the character and add the total.
Compare this to the previous amount of total characters ✖️ 7
Run Length Encoding
Another form of lossless compression
1. Count the number of times the same data is repeated and store this instead
2. Store the information as data pairs
(Number of pixels, colour)
Times number by 8 and colour by colour depth and add it all together
3. Compare this to the previous by timing width and height of pixels by colour depth.
What is run length coding
A form of lossless compression,
Looks for runs of data and stores the number of times data is repeated and one copy of the data as a data pair.