Data Representation
Data Representation
Computer Science
Data Representation
Contents
Binary Prefixes
Number Systems
Binary Arithmetic
Uses of Number Systems
Character Encoding
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 1
Binary Prefixes
Your notes
Binary prefixes
What is a binary prefix?
A binary prefix is a unit prefix used to indicate multiples of bytes in binary
Consider the word kilobyte, "kilo" is the prefix
Bytes are the smallest unit of data that can be stored in a computer so there needs to be
a way of expressing bytes in larger multiples
Denary prefixes
A common way of expressing multiples of bytes is to use denary prefixes:
Binary prefixes
However, computers use the binary (base 2) number system so the denary system is
technically inaccurate when describing storage
To be precise, expressing multiples of bytes is done using binary prefixes:
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 2
1 gibibyte (1 GiB) 230 1 073 741 824
Your notes
1 tebibyte (1 TiB) 240 1 099 511 627 776
Notice the prefixes change depending on the system being used, e.g. kilo (denary) vs
kibi (binary)
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 3
Number Systems
Your notes
Number bases
What is a number base?
A number base is the number of different digits or symbols a number system uses to
represent values
Each place in a number represents a power of the base, starting from the right
Denary
Denary is a number system that is made up of 10 digits (0-9)
Denary is referred to as a base-10 number system
Each digit has a weight factor of 10 raised to a power, the rightmost digit is 1s (100), the
next digit to the left 10s (101) and so on
Humans use the denary system for counting, measuring and performing maths
calculations
Using combinations of the 10 digits we can represent any number
Binary
Binary is a number system that is made up of two digits (1 and 0)
Binary is referred to as a base-2 number system
Each digit has a weight factor of 2 raised to a power, the rightmost digit is 1s (20), the
next digit to the left 2s (21) and so on
Each time a new digit is added, the column value is multiplied by 2
Using combinations of the 2 digits we can represent any number
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 4
Your notes
Hexadecimal
Hexadecimal is a number system that is made up of 16 digits, 10 numbers (0-9) and 6
letters (A-F)
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0 1 2 3 4 5 6 7 8 9 A B C D E F
16s 1s
1 3
1 x16 3x1 = 19
0 0000 0
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 5
1 0001 1
Your notes
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 6
Your notes
128 64 32 16 8 4 2 1
Then we start at the left and look for the highest number that is less than or equal to 101
and if so, place a 1 in that column
Otherwise, place a 0 in the column
128 is bigger than 101 and therefore we place a 0 in that column
64 is smaller than 101 so we place a 1 in that column
101 - 64 = 37
This now means we have 37 left to find
32 is smaller than 37 so we place a 1 in that column
37 - 32 = 5
This now means we have 5 left to find
16 is bigger than 5 and therefore we place a 0 in that column
8 is bigger than 5 and therefore we place a 0 in that column
4 is smaller than 5 so we place a 1 in that column
5-1=1
This now means we have 1 left to find
2 is bigger than 1 and therefore we place a 0 in that column
1 is equal to the number we have left so we place a 1 in that column
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 7
64 + 32 + 4 + 1 = 101
Therefore the denary number 101 in binary is 01100101 Your notes
128 64 32 16 8 4 2 1
0 1 1 0 0 1 0 1
8 4 2 1 8 4 2 1
1 0 1 1 0 1 1 1
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 8
8 4 2 1
Your notes
0 1 0 1 =5
8 4 2 1
1 1 1 1 = 15 (F)
128 64 32 16 8 4 2 1
0 1 0 1 1 1 1 1
Worked Example
Convert the positive binary integer 1010 0010 into hexadecimal. [1]
Answer
A2 [1 mark]
0000 0
0001 1
0010 2
0011 3
0100 4
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 9
0101 5
Your notes
0110 6
0111 7
1000 8
1001 9
0 0 0 0 0 1 0 1 =5
0 0 0 0 0 0 0 0 =0
0 0 0 0 0 0 0 0 =0
Two bytes
0 0 1 0 0 1 0 1 = 2, 5
0 0 0 0 0 0 0 0 = 0, 0
0 1 0 0 1 0 0 0 = 72
1 0 1 1 0 1 1 1 = -72
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 10
The issue with one's complement is that it can have two representations for 0 (positive
and negative)
Your notes
What is two's complement?
Two's complement is another method of representing both positive and negative
numbers
To turn a positive binary number into a negative:
Positive binary number is inverted
'1' is added to the right most bit
Using two's complement the leftmost bit is designated the most significant bit (MSB)
To represent negative numbers this bit must equal 1, turning the column value into a
negative
Working with 8 bits, the 128 column becomes -128
-128 64 32 16 8 4 2 1
0 1 0 0 1 0 0 0 = 72
invert
1 0 1 1 0 1 1 1
add 1
1 +
result
1 0 1 1 1 0 0 0 = -72
8 bit two's complement can represent values between 0111 1111 (+127) and 1000 0000
(-128)
An alternative way of thinking about this is:
Starting from the right, keep all the bits the same up to and including the first 1
Flip the rest of the digits
0101 1000 becomes...
1010 1000
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 11
Consistency
You don’t need different rules for signed and unsigned numbers Your notes
Whether you're adding +37 and +58, or −37 and +58, or −37 and −58, the binary
addition process is the same
Two’s complement works for any combination of positive and negative values
Hardware simplicity
CPUs are built to do simple binary addition
Two’s complement means:
The same adder circuit can handle everything
No special logic is needed to detect signs or subtract manually
It still works, up to a point
As long as the sum doesn't exceed the max value (+127 in 8-bit), you can add two
positive numbers with two’s complement without any issues
Worked Example
Convert the denary number 649 into Binary Coded Decimal (BCD) [1]
Answer
0110 0100 1001 [1 mark]
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 12
Binary Arithmetic
Your notes
Binary addition
What is binary addition?
Binary addition involves summing numbers in base-2, which uses only the digits 0 and 1
Like denary addition, start from the rightmost digit and move towards the left
Carrying over occurs when the sum of a column is greater than 1, passing the excess to
the next left column
Example addition
Worked Example
Add the following two binary integers using binary addition. Show your working. [2]
10011010+00101111
Answer
carry 1 1 1 1 1
1 0 0 1 1 0 1 0
+ 0 0 1 0 1 1 1 1
1 1 0 0 1 0 0 1
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 13
1 mark for working [1 mark]
1 mark for answer [1 mark]
Your notes
Overflow
What is an overflow?
Overflow occurs when the sum of two binary numbers exceeds the given number of bits
In signed number representations, the leftmost bit often serves as the sign bit; overflow
can flip this, incorrectly changing the sign of the result
Overflow generally leads to incorrect or unpredictable results as the extra bits are
truncated or wrapped around
Binary subtraction
To carry out subtraction, the number being subtracted is converted into its negative
equivalent using two's complement
The two numbers are then added together
Example
48 - 12
-128 64 32 16 8 4 2 1
0 0 1 1 0 0 0 0 = 48
0 0 0 0 1 1 0 0 = 12
0 0 0 0 1 1 0 0 = 12
invert
1 1 1 1 0 0 1 1
add 1
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 14
1
Your notes
result
1 1 1 1 0 1 0 0 = -12
-128 64 32 16 8 4 2 1
0 0 1 1 0 0 0 0 = 48
1 1 1 1 0 1 0 0 = -12
carries
1 1 1 1
result
0 0 1 0 0 1 0 0 = 36
48 - 12 = 36
The additional overflow bit is ignored leaving a result of 0010 0100, denary equivalent
of 36, which is the correct answer
In two's complement arithmetic, the overflow bit does not contribute to the actual
value of the operation but is more of a by-product of the method
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 15
Uses of Number Systems
Your notes
Applications of Binary Coded Decimal (BCD)
What are the uses of binary-coded decimal (BCD)?
Use Case Why BCD is used
Electronic calculators Keeps numbers in decimal format for easier display and
accuracy
Digital clocks and watches Time is naturally decimal (e.g. 12:45), so BCD makes
display logic simpler
Banking and financial systems Avoids rounding errors when doing decimal
calculations, especially with money
Old digital systems / Simpler to implement with hardware that displays digits
embedded systems individually
Binary coded decimal is commonly used in systems that need to display decimal
numbers clearly and accurately
BCD is ideal for applications like digital clocks, calculators, and financial systems where
decimal precision matters
Using BCD avoids rounding errors that can occur in binary-based arithmetic, especially
with money and time
It’s still found in older or embedded systems where simple hardware-based decimal
output is needed
Applications of hexadecimal
Why is hexadecimal used?
In Computer Science hexadecimal is often preferred when working with large values
It takes fewer digits to represent a given value in hexadecimal than in binary
1 hexadecimal digit corresponds 4 bits and can represent 16 unique values (0-F)
It is beneficial to use hexadecimal over binary because:
The more bits there are in a binary number, the harder it makes for a human to read
Numbers with more bits are more prone to errors when being copied
Examples of where hexadecimal can be seen:
MAC addresses
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 16
Colour codes
URLs Your notes
MAC addresses
A typical MAC address consists of 12 hexadecimal digits, equivalent to 48 digits in in
binary
AA:BB:CC:DD:EE:FF
10101010:10111011:11001100:11011101:11101110:11111111
Writing down or performing calculations with 48 binary digits makes it very easy to
make a mistake
Colour codes
A typical hexadecimal colour code consists of 6 hexadecimal digits, equivalent to 24
digits in binary
#66FF33 (green)
01000010:11111111:00110011
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 17
Your notes
URL's
A URL can only contain standard characters (a-z and A-Z), numbers (0-9) and some
special symbols which is enough for basic web browsing
If a URL needs to include a character outside of this set, they are converted into a
hexadecimal code
Hexadecimal codes included in a URL are prefixed with a % sign
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 18
Character Encoding
Your notes
Character sets
What is a character set?
A character set is all the characters and symbols that can be represented by a
computer system
Each character is given a unique binary code
Character sets are ordered logically, the code for ‘B’ is one more than the code for ‘A’
A character set provides a standard for computers to communicate and send/receive
information
Without a character set, one system might interpret 01000001 differently from another
The number of characters that can be represented is determined by the number of bits
used by the character set
Two common character sets are:
American Standard Code for Information Interchange (ASCII)
Universal Character Encoding (UNICODE)
ASCII
What is ASCII?
ASCII is a character set and was an accepted standard for information interchange
ASCII uses 7 bits, providing 27 unique codes (128) or a maximum of 128 characters it can
represent
This is enough to represent the letters, numbers, and symbols from a standard keyboard
The sixth bit changes from 1 to 0 when comparing uppercase and lowercase
characters
a 0110 0001
A 0100 0001
b 0110 0010
B 0100 0010
This made conversion between the two much easier
This speeds up the overall usability of the character set
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 19
Your notes
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 20
ASCII only represents basic characters needed for English, limiting its use for other
languages
Your notes
Extended ASCII
What is extended ASCII?
Extended ASCII uses an 8th bit, providing 256 unique codes (28 = 256) or a maximum of
256 characters it can represent
Extended ASCII provides essential characters such as mathematical operators and
more recent symbols such as ©
This allows for non-English characters and for drawing characters to be included
UNICODE
What is UNICODE?
UNICODE is a character set and was created as a solution to the limitations of ASCII
UNICODE uses a minimum of 16 bits, providing 216 unique codes (65,536) or a minimum
of 65,536 characters it can represent
UNICODE can represent characters from all the major languages around the world
UNICODE was designed to create a universal standard that covered all languages and
all writing systems
The first 128 characters in the UNICODE character set are the same as ASCII
ASCII vs UNICODE
ASCII UNICODE
Benefits It uses a lot less storage space It can represent more characters
than UNICODE. than ASCII.
It can support all common
characters across the world.
It can represent special
characters such as emoji's.
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 21
Drawbacks It can only represent 128 It uses a lot more storage space
characters. than ASCII.
Your notes
It cannot store special characters
such as emoji's.
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 22