Data Representation Flashcards
How many inputs and outputs do NOT gates have?
1) one input
2) one output
Put these units in order of size (smallest to largest):
Terabyte, Byte, Kilobyte, Gigabyte, Megabyte
Byte, Kilobyte, Megabyte, Gigabyte, Terabyte
Convert 17 (decimal) to binary.
10001
Convert 17 (decimal) to hexadecimal.
11
Convert 0011 1000 (binary) to decimal.
56
What effect do left and right shifts have on binary numbers?
1) left shifts multiply a binary number. For every place shifted left, the number is doubled
2) right shifts divide a binary number. For every place shifted right, the number is halved
Convert 1001 1111 (binary) to decimal.
159
Convert 1001 1111 (binary) to hexadecimal.
9F
Convert 10 1011 (binary) to decimal.
43
Convert 10 1011 (binary) to hexadecimal.
2B
Convert 4A (hexadecimal) to decimal.
74
Convert 4A (hexadecimal) to binary.
1001010
Convert 75 (hexadecimal) to decimal.
117
Convert 75 (hexadecimal) to binary
1110101
Convert 148 (decimal) to binary.
10010100
Convert 148 (decimal) to hexadecimal.
94
Convert 240 (decimal) to binary.
11110000
Convert 240 (decimal) to hexadecimal.
F0
Convert BD9 (hexadecimal) to decimal.
3033
Convert BD9 (hexadecimal) to binary.
101111011001
Encode this string using run-length encoding:
PPPPQQRRRSSSSSSPPPPPQQQ
(4,P), (2,Q), (3.R), (6,S), (5, P), (3, Q)
Calculate the number of bits needed to store this string if it was encoded with ASCII:
PPPPQQRRRSSSSSSPPPPPQQQ
23 X 8 = 184 bits
Calculate the number of bits needed to store this string if it was encoded with huffman coding:
PPPPQQRRRSSSSSSPPPPPQQQ
9 + 15 +9 +12 = 45 bits
Calculate the number of bits needed to store this string if it was encoded with run-length encoding (if each data pair used 2 bytes):
PPPPQQRRRSSSSSSPPPPPQQQ
8 x 2 x 6 = 96 bits
Why do programmers prefer hexadecimal over binary and decimal?
1) it’s simpler to remember large numbers in hex - they’re far shorter than binary numbers
2) due to hex numbers being shorter, there’s less chance of input errors
3) it’s easier to convert between binary and hex than binary and decimal
What is the definition of a character set?
A collection of characters that a computer recognises from their binary representation
What are the four types of characters that are included in a character set?
1) uppercase letters
2) lowercase letters
3) digits
4) symbols
What are the two main character sets?
1) ASCII
2) Unicode
Define the term ‘pixel’.
One of the individual units that that make up an image
Define the term ‘bitmap’.
An image made up of pixels
Define the term ‘colour depth’.
The number of bits used for each pixel
Define the term ‘image resolution’.
The number of pixels in the image
What are the effects of choosing a greater image resolution or colour depth for an image?
Using a greater image resolution or colour depth means that there are more bits in the image. This can give a higher-quality image, but also increases the file size
How does audio sampling work?
1) sound is recorded by a microphone as an analogue signal
2) the analogue signals are converted into digital data by analogue to digital converters so that computers can read and store sound files
Define the term ‘sample rate’.
How many samples you take in a second
What happens when you increase the sample rate?
Increasing the sample rate means the analogue recording is sampled more often. The sampled sound will be better quality and will more closely match the original recording. However, increasing the sample rate will increase the file size
Define the term ‘sample resolution’.
The number of bits available for each sample
What happens when you increase the sample resolution?
Increasing the sample resolution means the digital file picks up quieter sounds, even if they’re happening at the same time as louder ones. This will also result in a sampled sound that is closer to the quality of the original recording. However, increasing the sample resolution will increase the file size
Why might you want to compress data?
1) smaller files take up less storage space on a device
2) streaming and downloading files from the internet is quicker as they take up less bandwidth
3) it allows web pages to load more quickly in web browsers
4) email services normally have restrictions on the size of the attachment you can send - compressing the file allows you to send the same content with a much smaller file size
What is the difference between lossy compression and lossless compression?
1) lossy compressionn works by permanently removing data from the file - this limits the number of bits the file needs and so reduces its size
2) lossless compression makes the file smaller by temporarily removing data to store the file and then restores it to its original state when it’s opened
Why might you want to use lossy compression?
1) greatly reduced file size, meaning more files can be stored
2) takes up less bandwidth so can be downloaded and streamed more quickly
3) commonly used - lots of software can read lossy files
Why might you want to use lossless compression?
1) data is only removed temporarily so there is no reduction in quality - the compressed file should look or sound like the original
2) can be decompressed - turned back into the original
3) can be used on text and software files
What is the formula used to work out how many bits an image will take up?
file size (in bits) = image resolution x colour depth = width x height x colour depth
What is the formula used to calculate the size of a sound file?
file size (in bits) = sample rate (in Hz) x sample resolution x length (in seconds)