3 - Data representation Flashcards
Why is hexadecimal often used in computer science?
-easier for people to read/remember (shorter representation)
-faster to convert to/from binary
Why can’t you use hexadecimal to save storage space on a computer?
computers only read/understand binary, so it will be stored as binary and not hex
What are binary shifts?
multiplying/dividing a binary number by a power of 2 by shifting all the digits up/down
What is a character set?
all the symbols that can be understood and displayed by a computer
What does ASCII stand for?
American Standard Code for Information Interchange
How many bits does ASCII use, and how many characters can be represented using this many?
7
(2⁷=) 128
Why is Unicode often used over ASCII?
more characters can be represented
uses 16 bits usually but you don’t need to know that
How is Unicode similar to ASCII?
the first 127 characters of Unicode are all of the ASCII characters
What is colour depth?
number of bits used to represent the colour of each pixel
What is a pixel, and what is it short for?
-smallest addressable point in an image
-picture element
What is a bitmap?
an array of pixels used to make an image
How is analogue sound recorded so that it can be stored on a computer?
analogue sound signals are sampled at regular intervals as a series of bits to convert it to digital
What is a sample, and what is sampling rate?
-a measure of the amplitude of a sound at a point in time
-sampling rate is the number of samples recorded in a given time
Give an advantage of using a higher sampling rate:
the resulting digital sound is a closer representation of the analogue sound
Define sampling resolution:
number of bits per sample of audio
What are the 2 types of compression?
-lossless (no reduction in quality, can be used on text)
-lossy (original data cannot be reconstructed)
What does Huffman encoding do to data?
takes most frequently used data and assigns it a bit pattern with the least number of bits
A form of lossless compression
How do you construct a Huffman tree?
-create a frequency table of all the characters used (including spaces)
-write them in a line in order of frequency
-pair up adjacent letters with the smallest frequency, and add their frequencies up to get another value to put above
-repeat the pairing process until you get 1 value at the top (total number of digits)
-assign left/right to be 0/1, find bit pattern for each letter
How does run length encoding (RLE) compress data?
-takes a string of bits
-stores it in frequency-data pairs (eg 4x1s means 1111)
Not necessarily in that format of 4x1s
RLE can sometimes increase the file size if there aren’t many bits in the first place
Why is data compressed?
-to reduce its file size so it decreases the amount of storage it takes up
-to make it faster to transmit as it takes up less bandwidth