Question 1 Report
(a) Convert the denary number 347 to hexadecimal. Show your working.
[3]
(b) Verify your answer by converting it back to denary. Show your working.
[2]
(c) Explain one situation where a programmer would need to convert between denary and hexadecimal.
[1]
(d) State how many bytes are needed to store the denary value 347.
[2]
(a) To convert denary 347 to hexadecimal, use repeated division by 16:
Read the remainders from bottom to top: 347 in hexadecimal = 15B. [3]
(b) Convert 15B hex back to denary to verify:
256 + 80 + 11 = 347. Verified. [2]
(c) A programmer would need this conversion when defining colours for web design (e.g. converting RGB values from denary to hex colour codes) or when reading hexadecimal memory addresses during debugging and needing to understand the denary value stored at that location. [1]
(d) A single byte can store values from 0 to 255. Since 347 > 255, it cannot fit in 1 byte. [1] Two bytes (16 bits) can store values from 0 to 65535, which is more than enough for 347. Therefore 2 bytes are needed. [1]
Everything you need to excel in your exams