Please enable JavaScript.
Coggle requires JavaScript to display documents.
Fundamentals of data representation (Units of information (bit: (b) a…
Fundamentals of data representation
Number bases
Decimal
: base 10
Binary
: base 2
Computer memory is based on transistors which have only two states.
all data must be converted into binary to be processed
Hexidecimal
: base 16
Programmers prefer to use to use hex when coding:
it's simpler to remember large hex number
there's less chance of input errors, due to hex numbers being shorter
it's easier to convert between binary and hex
Units of information
bit
: (b) a fundamental unit of information - either a 1 or a 0
byte
: (B) a group of 8 bits
1kB = 1000B
1MB = 1000kB
1GB = 1000MB
1TB = 1000GB
Character encoding
Character set
: a collection of characters that a computer recognises from their binary representation
ASCII
: most commonly used character set in the English language
each ASCII character is given a
7-bit binary code
can represent
128
different characters
extended ASCII uses
8-bit binary code
to represent
256
characters
Unicode
: covers every possible letter or symbol that might be written
uses
multiple bytes
for each character
covers
all major languages
the first
128
are the same as ASCII
Representing Images
Pixels
: a single point in a graphical image
Bitmap
: a graphical image represented as an array of brightness values
Size in pixels
: width x height
size of a bitmap is known as the
image resolution
Colour depth
: the number of bits used to represent each pixel
Total number of colours = 2^n (where n = bpp)
the higher the colour depth and size in pixels the better quality picture
increasing colour depth and resolution increases the
file size
File size
(in bits) = image resolution x colour depth = width x height x colour depth
Resolution
: the number of pixels
Black and white images only need two colours, so they only need 1 bit to represent each pixel
Representing Sound
Sound is analogue - it must be converted to a digital form for storage and processing in a computer
Analogue signals
: pieces of continually changing data
Sound waves are sampled to create the digital version of sound
A sample is a measure of amplitude at a point in time
sampling rate
: the number of samples taken in a second, Hertz
Sample resolution
: the number of bits per sample
Bit rate
= sample rate x sample resolution
File Size
(in bits) = rate x res x secs
Data Compression
: the reduction is file size to reduce download times and storage requirements
Lossy
: works by permanently removing data from the file- this limits the number of bits the file needs and so reduces its size
Lossless
: makes the file smaller by temporarily removing data to store the file and then restores it to its original state when it's opened
Huffman Coding
: use the frequency of each data value
gives each data value a unique binary code - it gives shorter binary codes to the data values that appear more frequently
Run-Length Encoding
: looks for repeating data
isn't very efficient on text files
each run requires
2 bytes
- 1 for the number of repetitions and 1 for the character