Data Representation - Worksheet
Data Representation - Worksheet
Binary Numbers
You know from the software development topic that an integer is a whole number - e.g. 11, 34, 118.
The computer stores these numbers using binary. Binary numbers only use the digits 1 and 0.
For National 5, you need to be able to convert whole numbers from denary (‘normal’ numbers with
10 digits, what we use) to binary. You also need to convert binary numbers back to denary.
The binary numbers you work with use eight place values/columns, starting (right) at 1, and doubling
each time:
By placing 1s and 0s in these columns, we can write out the binary number 10011101.
10011101
To convert this number to denary, we add up all the columns with a 1 in them.
These are 128 + 16 + 8 + 4 + 1, so the total is = 157.
128 64 32 16 8 4 2 1
0 1 0 1 1 1 0 0
First, write out the table with the eight place values (from right: 1 to 128).
128 64 32 16 8 4 2 1
We know that 128 doesn’t go into 87, so there must be a 0 in that column.
64 does go into 87, so we can write a 1 in the 64 column.
128 64 32 16 8 4 2 1
0 1
128 64 32 16 8 4 2 1
0 1 1 1 1 1
128 64 32 16 8 4 2 1
0 1 0 1 0 1 1 1
We can check our working by adding all the columns with a 1 in them: 64 + 16 + 4 + 2 + 1 = 87.
11010011
128 64 32 16 8 4 2 1
Answer:
00111001
128 64 32 16 8 4 2 1
Answer:
10101010
128 64 32 16 8 4 2 1
Answer:
01010101
128 64 32 16 8 4 2 1
Answer:
11000011
128 64 32 16 8 4 2 1
Answer:
25
128 64 32 16 8 4 2 1
84
128 64 32 16 8 4 2 1
133
128 64 32 16 8 4 2 1
94
128 64 32 16 8 4 2 1
76
128 64 32 16 8 4 2 1
119
128 64 32 16 8 4 2 1
Task 3 - Binary Numbers
This task has a mix of binary-to-denary and denary-to-binary.
In these questions, like in the exam, you will have to write out the place values (from right: 1 to 128)
yourself.
Answer: ____
Answer: ____
You know from the software development topic that a floating point number is one with a decimal
point.
0.5571257
Inside the computer, floating point numbers are stored with a mantissa and an exponent.
If you are asked how floating point numbers are stored, you would say that it is with a mantissa and
an exponent.
You need to be able to identify which part is the mantissa, and which part is the exponent.
The floating point number is stored in something that looks a bit like scientific notation.
Exponent
0.58125 x 104
Mantissa
Mantissa 58125
Exponent 4
This question has come up in the same way in every N5 exam. You have to be able to pick out the
two parts.
Tasks - Floating Point NUmbers
Describe how a floating point number is stored in two parts.
For each of these floating point numbers, identify the mantissa and the exponent.
Mantissa
Exponent
Mantissa
Exponent
Mantissa
Exponent
Mantissa
Exponent
Mantissa
Exponent
Extended ASCII
For National 5, you need to know that text is represented using extended ASCII. Extended ASCII uses
8 bits to store each character. Each character has a unique number associated with it.
Extended ASCII is made up of printable characters and control characters. Printable characters are
the letters, numbers and symbols that you see on the screen. Control characters are signals that do
not appear as printed symbols in the text (messages like “escape” and “delete”).
A z # Escape
4 ? Y Delete
Because extended ASCII uses 8 bits for each character, we can calculate how much space is needed
to store a particular message:
For example:
= 5 x 8 bits
= 40 bits
We could also convert this to bytes (dividing by 8), meaning 40 bits is 40 ÷ 8 bytes, which is 5 bytes.
2. State one example of a printable character and one of a control character in extended ASCII.
Printable character
Control character
4. Calculate the space needed to store the message “welcome to computing” in bits, in
extended ASCII.
5. Calculate the space needed to store the message “have fun with ascii” in extended ASCII.
Convert your answer into bytes.
Images - Bitmaps and Vectors
You need to know how images are stored as bitmaps and vectors.
A bitmap is a grid of pixels. Each pixel has a colour associated with it.
Bitmaps can be black and white, or have lots of colours. The important
point is that it is made up of a grid of individual squares called pixels.
Bitmap made up of
pixels
You learn more about bitmaps during the web topic, later in the course.
You need to know about four types of objects. Each type of object has attributes:
The SQA have also accepted answers that name the length of a line, line/border thickness,
or rotation/angle of an object.
These questions ask how a bitmap image would be stored. You would answer that it is a grid of
pixels (1 mark), and each pixel has a colour (1 mark).
3. The image below is a vector graphic. State the name of the object, and two attributes it has.
Attribute 1
Attribute 2
4. The image below is a vector graphic. State the name of one of the objects, and two
attributes it has.
Attribute 1
Attribute 2
5. The image below is a vector graphic. State the name of one of the objects, and two
attributes it has.
Attribute 1
Attribute 2