Question bank › IB Computer Science › A1 Computer fundamentals

Data representation (binary, hex, storing data)

Answer on paper first, then reveal the mark scheme one mark at a time.

1Core4 marks

(a) Convert the decimal number 45 into an 8-bit binary number. [1]

(b) Convert your answer to part (a) into hexadecimal. [1]

(c) Convert the hexadecimal number 9F into decimal. Show your working. [2]

2Standard3 marks

A bitmap image is 1920 pixels wide and 1080 pixels high. Each pixel is stored using 24 bits (a colour depth of 24 bits). Calculate the uncompressed file size, in megabytes (MB), ignoring metadata. (Use 1 MB = 1 000 000 bytes.) [3]

3Standard4 marks

A 3-minute stereo (2-channel) recording is made using a sample rate of 44.1 kHz (44 100 samples per second for each channel) and a sample resolution of 16 bits per sample. Calculate the uncompressed file size in MB (use 1 MB = 1 000 000 bytes). Show your working. [4]

Stuck on Data representation (binary, hex, storing data)?

Get it sorted in a free 30-minute session

We work through your weakest questions on this topic on Zoom. I reply the same day.

4Core3 marks

A web designer sets the colour of a button using the hexadecimal colour code #2E8B57. The first pair of hex digits gives the red value, the second pair the green value and the third pair the blue value.

(a) Convert the green value, 8B, into 8-bit binary. [1]

(b) Convert the green value, 8B, into denary. [1]

(c) Outline one reason why colour codes are written in hexadecimal rather than in binary. [1]

5Core3 marks

A school stores each student's locker number as an unsigned binary integer.

(a) State the largest denary number that can be stored using 6 bits. [1]

(b) The school has 300 lockers, each needing a different code. Calculate the minimum number of bits needed for each locker code. Justify your answer. [2]

6Standard4 marks

A car park display stores the text Gate B12 as a string. The string contains 8 characters, including the space.

(a) In ASCII the character A has the code 65 and the letters are coded in alphabetical order. Write the 8-bit binary code for the character D. [1]

(b) Calculate the number of bits needed to store the string Gate B12 using 8 bits per character. [1]

(c) The display is upgraded so that it can show place names in Arabic, Greek and Chinese. Explain why the system would need to use Unicode rather than ASCII. [2]

7Standard4 marks

A memory location holds the 16-bit pattern 1011 0110 0011 1101.

(a) Convert this bit pattern into hexadecimal. [2]

(b) Convert the hexadecimal value 7A0F into 16-bit binary. [1]

(c) Explain why binary can be converted to hexadecimal by splitting the bit pattern into groups of four bits. [1]

8Hard5 marks

The graph shows an analogue sound wave that has been sampled 8 times (samples 0 to 7). Each sample is stored using a sample resolution of 3 bits, so the value of each sample is rounded to one of the quantisation levels 0 to 7. The dots show the stored sample values.

(a) State the 3-bit binary values stored for samples 1, 2 and 5. [2]

(b) Calculate the total number of bits needed to store all 8 samples, ignoring any file header. [1]

(c) The sample resolution is increased from 3 bits to 8 bits. Explain how this would affect the quality of the recording and the size of the file. [2]

0123456701234567Sample numberQuantisation level
9Hard6 marks

A security camera records uncompressed video. Each frame is an image 1280 pixels wide and 720 pixels high with a colour depth of 24 bits. The camera records 25 frames per second. Sound is not recorded.

(a) Calculate the size, in gigabytes (GB), of a 30-second clip. Use 1 GB = 1 000 000 000 bytes and give your answer to 2 decimal places. Show your working. [4]

(b) To save storage, the colour depth is reduced from 24 bits to 16 bits. Describe the effect of this change on the stored video. [2]

10Stretch6 marks

A small embedded controller has a memory in which every location stores one byte. Memory addresses are written in hexadecimal and run from 0000 to FFFF.

(a) State the number of bits needed to store one memory address. [1]

(b) Calculate the total memory size in kibibytes (KiB). Use 1 KiB = 1024 bytes. Show your working. [2]

(c) A program is loaded into the addresses 4000 to 4FFF inclusive. Calculate how much memory, in KiB, the program uses. Show your working. [2]

(d) State, in hexadecimal, the first address after the end of the program. [1]

Stuck on this topic?

Book a free 30-minute session on WhatsApp and we'll find exactly which step is costing you the marks. Or build a timed paper on it.

Free 30-minute session