Data representation
Binary, denary and hexadecimal:
Some key words:
Analogue data – A continuous stream of data that is processed by humans
Logic gate – A very small component in a computer system that controls the flow of
electricity
Digital data – Discrete data that only uses the values 0 and 1
Register – A small component in a computer system that is used to temporarily store
data
Denary – A base-10 number system that uses values 0-9
Binary – A base-2 number system that uses values 0 and 1
Hexadecimal – A base-16 number system that uses 16 symbols as shown below
(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F)
Denary and hexadecimal both must be converted into binary values to be processed by
computers.
Binary to denary:
Take your binary value and above each digit starting from the right going to the left double
the number starting from 1.
Q = Convert the Binary value 10010110 into Denary
Denary 128 64 32 16 8 4 2 1
Binary 1 0 0 1 0 1 1 0
Once complete take all the number above the digit 1 and add them all together
2 + 4 + 16 + 128 = 150
A = the denary value of 10010110 is 150
Denary to binary:
Put your binary value into a table and divide it by 2 each time and take the remainder aside
Q = what is the binary value of 150
2 150 0
2 75 1
2 37 1
2 18 0
2 9 1
2 4 0
2 2 0
2 1 1
0
A = the binary value of 150 is 10010110
When writing the binary value start from the bottom of the table
If there are not 8 digits in the 8 bit binary value place 0’s at the bottom of the binary value in
the table so at the start of the binary value.
Hexadecimal to denary/Denary to hexadecimal:
Just remember the pattern bellow
Hex Den
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
1 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
Binary addition:
Rule 1 is 0 + 0 = 0
Rule 2 is 1 + 0 = 1
Rule 3 is 1 + 1 = 10 (the 1 is carried over)
Rule 4 is 1 + 1 + 1 = 11 (the 1 is carried over)
e.g.
Q = what is 10010100 + 00011110
1 0 0 1 0 1 0 0
+
0 0 0 1 1 1 1 0
1 0 1 1 0 0 1 0
A = 10110010
Overflow error – A type of error that occurs when a number larger that a resister can store
is generated
1 0 0 1 0 1 0 0
+
1 0 0 1 1 1 1 0
1 0 0 1 1 0 0 1 0
Overflow error
Logical binary shifts:
Another process that can occur with binary numbers that are stored in a register is called a
logical binary shift. This kind of shift can move the binary values in the number to the left or
to the right.
Consider this number
0 0 1 0 1 1 0 0
For a left shift you must move all of the binary values one to the left
0 1 0 1 1 0 0
In the open position place a 0
0 1 0 1 1 0 0 0
This same logic is used in a right shift
Just move all the values to the right and fill in the open position with a 0
Each left shift doubles the value of the number.
Each right shift halves the value of the number.
Negative denary numbers to binary:
You will convert the negative denary value the same as if it was positive but then invert each
value
e.g.
Q = what is the binary value of -150?
150 into binary is 10010110
1 0 0 1 0 1 1 0
inverted
0 1 1 0 1 0 0 1
A = 01101001
Converting text into binary:
When a computer converts text into binary it uses a character set. There are two main types
of character sets that a computer can use, ASCII and Unicode:
ASCII represents characters using 8-bit binary numbers (256 different characters)
Unicode represents characters using 16-bit binary numbers (Approximately 6500
different characters)
Each character has a set binary value
Character set – It contains all the characters that are in that character set and that is
assigned to each character
Converting images to binary:
Pixel – A very small dot of colour that is displayed with many others to create an image.
If the image was black and white it could just be represented by 1’s and 0’s. The 1’s
represent black pixels and 0’s represent white pixels.
0 0 0 0 0 0
0 1 0 0 1 0
0 0 0 0 0 0
0 1 0 0 1 0
0 0 1 1 0 0
0 0 0 0 0 0
Resolution – The dimensions of an image
Metadata – Additional data that is stored with an image that can provide information such
as the dimensions of the image and the time and data the image was taken.
Most images use a lot more colours than black and white. Each colour has its own binary
values. Colours are created by computer screens using the Red Green Blue (RGB) colour
system. This system mixes the colour red, green and blue in different amounts to achieve
each colour.
Colour depth – The number of bits that are used to create each colour in an image.
Converting sound to binary:
Sound is made up of sound waves. When sound is recorded, this is done at set time
intervals. This process is knows as sound sampling.
Sound sampling – A little piece of sound that is recorded at regular time intervals.
Each value is converted to binary to be processed by the computer. Each sound value is then
used to playback the sound, when the recording is played.
Sample rate – The number of samples recorded each second. (Measured in hertz)
1 hertz is equal to 1 sample per second. A common sample rate is 44.1 kHz (kilohertz), this
would require 44100 samples to be taken each second.
Further data is required to represent sound, and this is sample resolution.
Sample resolution – The number of bits that are used to recode each sound sample.
Measuring data storage
Data is measured in different units as shown below.
Unit Description
Bit This is the smallest measurement for data
Nibble There are 4 bits in a nibble
Byte There are 8 bits in a byte
Kilibyte (KiB) There are 1024 bytes in a Kibibyte
Mebibyte (MiB) There are 1024 Kibibytes in a Mebibyte
Gigibyte (GiB) There are 1024 Mebibytes in a Gibibyte
Tebibyte (TiB) There are 1024 Gibibytes in a Tebibyte
Pebibyte (PiB) There are 1024 Tebibytes in a Pebibyte
Exbibyte (EiB) There are 1024 Pebibytes in an Exbibyte
Most computers will do this for you but you must prove that you can do it manually in the
exam for things like an image file and a sound file.
Data compression
Compression – A method that uses an algorithm to reduce the size of the file.
Compressing a file will reduce the size of the file that can have several benefits, such as:
Not as much storage space is need to store the file.
It will take less time to transmit the file from one device to another.
It will be quicker to upload and download the file.
Not as much bandwidth is needed to transmit the file over the internet.
There are 2 types of compression:
Lossy – A compression method that reduces the size of the file by permanently
removing data.
Lossless – A compression method that reduces the size of the file by temporarily
altering the data.
Perceptual music shaping – A process that is used in lossy compression that removes
sounds that are not normally heard by the human ear.
Run length encoding – An algorithm that groups together repeating patterns and indexes
them.