Lab Activity - 1 - Number Bases
Lab Activity - 1 - Number Bases
Learning Objectives: By the end of this lab session you should be able to
• Convert binary and hexadecimal numbers to decimal using the “position method”
• Convert decimal numbers to binary and hexadecimal using the “division method”
This worksheet should take around 2-3 hours to complete. There are many questions (and
therefore plenty of practice!). The aim is that by completing this worksheet, you should be
proficient at quickly and accurately converting between different base number systems.
x2 1 0 1 0 0 1 1 1
n 7 6 5 4 3 2 1 0
n
2 128 64 32 16 8 4 2 1
n
x2 × 2 128 0 32 0 0 4 2 1
TOTAL 128+0+ 32+ 0+0+ 4+2+1=167
Declare 3 variables:
n: a number which is initially the total number of digits
b: the base of the number
s: the running total sum, with an initial value of 0
Question 1. Convert the following binary numbers into decimal. Show your working. [12
1
MOD002580 Computer Systems Lab Activity - 1
marks]
1) 101100112 2) 101011002
3) 11011012 4) 11110102
5) 10100102 6) 101111012
7) 111000012 8) 11000102
9) 10000112 10)110101012
2
MOD002580 Computer Systems Lab Activity - 1
Quotient Remainder
2 167
2 83 1
2 41 1
2 20 1
2 10 0
2 5 0
2 2 1
2 1 0
0 1
We have reached 0, and so we stop here. Reading from bottom to top, we have:
16710 = 101001112
Question 2. Convert the following decimal numbers into binary. Show your working. [12
marks]
1) 6810 2) 9710
3) 14110 4) 9610
3
MOD002580 Computer Systems Lab Activity - 1
5) 17510 6) 16310
7) 24410 8) 11110
9) 10410 10)25210
x 16 3 D 9 1
n 3 2 1 0
n
16 4096 256 16 1
n
x 16 × 16 12288 3328 144 1
TOTAL 12288+3328+144 +1=15761
4
MOD002580 Computer Systems Lab Activity - 1
Question 3. Convert the following hexadecimal numbers to decimal. Show your working.
[12 marks]
1) 87FA16 2) 5E0016
3) 4E9416 4) 79BA16
5) 1A7116 6) 764A16
7) 41616 8) BA8C16
9) F60B16 10)21DA16
5
MOD002580 Computer Systems Lab Activity - 1
Question 4. Convert the following decimal numbers to hexadecimal. Show your working.
[12 marks]
1) 2980610 2) 1181110
3) 5047410 4) 2978610
5) 4395510 6) 6434810
6
MOD002580 Computer Systems Lab Activity - 1
7) 4994910 8) 4788410
9) 1379610 10)3279610
Value-added work.
For each question part (48 in total), an additional 1 mark is available if working is shown
(even if the answer is incorrect). There are therefore an additional [48 marks] available for
showing working.
Need more practice? You can find more questions here (useful for revision):
https://www.math-aids.com/Number_Systems/
Self-reflection and feedback. After completing the lab, please answer the following
questions in your logbook. [An automatic 4 marks is awarded for full completion of this
section.]
1. Roughly how long did it take you to complete this lab and write up the logbook?
2. On a scale of 1 (very easy) to 5 (very hard), how difficult did you find this lab?
7
MOD002580 Computer Systems Lab Activity - 1
5. On a scale of 1 (not very confident at all) to 5 (very confident), how confident are
you now with converting between different number systems?
6. Please list any external resources (textbooks, websites, other people, etc.) used
when completing this lab or the logbook.