GCSE Computer Science Essentials includes Systems Architecture (Paper 1: Computer Systems); Memory and Primary Storage (Paper 1: Computer Systems); Secondary Storage (Paper 1: Computer Systems); System Software (Paper 1: Computer Systems); Networks and Topologies (Paper 1: Computer Systems); Network Security (Paper 1: Computer Systems); Ethical, Legal, Cultural and Environmental Impact (Paper 1: Computer Systems); Network Protocols and Layers (Paper 1: Computer Systems); Algorithms (Paper 2: Computational Thinking, Algorithms and Programming); Programming Fundamentals (Paper 2: Computational Thinking, Algorithms and Programming); Producing Robust Programs (Paper 2: Computational Thinking, Algorithms and Programming); Boolean Logic (Paper 2: Computational Thinking, Algorithms and Programming); Data Representation: Number Systems (Paper 2: Computational Thinking, Algorithms and Programming); Data Representation: Images, Sound and Compression (Paper 2: Computational Thinking, Algorithms and Programming); Programming Practice: Writing and Refining Programs (Paper 2: Computational Thinking, Algorithms and Programming); SQL and Data Handling (Paper 2: Computational Thinking, Algorithms and Programming); Trace Tables and Binary/Hex Conversions (Paper 2: Computational Thinking, Algorithms and Programming); Translators and Integrated Development Environments (IDEs) (Paper 2: Computational Thinking, Algorithms and Programming); 1D and 2D Array Processing: Writing and Tracing Programs (Paper 2: Computational Thinking, Algorithms and Programming).
Method recap - Data Representation: Number Systems
- Learn the binary place values (128, 64, 32, 16, 8, 4, 2, 1 for 8 bits) and add together the place values where there is a 1 to convert binary to denary.
- To convert denary to binary, repeatedly find the largest place value that fits, place a 1 there, subtract it, and place 0s everywhere else.
- To convert denary to hexadecimal, divide repeatedly by 16, recording each remainder (using A-F for 10-15) and reading the remainders from last to first.
- To convert between binary and hexadecimal directly, split the binary number into 4-bit nibbles and convert each nibble to one hex digit, or expand each hex digit into its 4-bit binary equivalent.
Worked example - Data Representation: Number Systems
Convert the denary number 214 to an 8-bit binary number, showing your working.
- List the 8-bit place values: 128, 64, 32, 16, 8, 4, 2, 1.
- Compare 214 to 128: 214 is greater than or equal to 128, so place a 1 there and subtract: 214 - 128 = 86.
- Compare 86 to 64: 86 is greater than or equal to 64, so place a 1 there and subtract: 86 - 64 = 22.
- Compare 22 to 32: it is less than 32, so place a 0. Compare 22 to 16: it is greater than or equal, so place a 1 and subtract: 22 - 16 = 6.
- Compare 6 to 8: less than 8, place a 0. Compare 6 to 4: greater than or equal, place a 1 and subtract: 6 - 4 = 2. Compare 2 to 2: place a 1, leaving 0, so place a 0 in the final column.
- Final answer: 214 = 11010110
Question 8 - Data Representation: Number Systems
4 marks
An 8-bit register stores the unsigned binary value 11101000 (denary 232). Add the binary number 00100000 (denary 32) to this value, showing your carries, and explain why the result causes an overflow error.
Answer and mark scheme
Mark scheme for Question 8 [4 marks]| Question 8[4 marks] |
|---|
| Answer or working | Marks |
|---|
| binary addition attempted with carries correctly shown/propagated | 1 |
| correct 9-bit result found: 100001000 | 1 |
| identifies that only the lower 8 bits, 00001000 (denary 8), can be stored in the 8-bit register | 1 |
| final answer: the true result 264 exceeds the maximum 8-bit value of 255, so the leading (9th) bit is lost, causing an overflow error and an incorrect stored value of 8 | 1 |
Question 9 - Data Representation: Number Systems
2 marks
State one reason why programmers commonly use hexadecimal, rather than binary, when writing MAC addresses or colour codes.
Answer and mark scheme
Mark scheme for Question 9 [2 marks]| Question 9[2 marks] |
|---|
| Answer or working | Marks |
|---|
| hexadecimal is much shorter/more compact to write than the equivalent binary value | 1 |
| final answer: this makes it quicker to read and write and less prone to transcription errors than a long string of binary digits | 1 |
Method recap - Data Representation: Images, Sound and Compression
- For bitmap images, multiply the image's width in pixels by its height in pixels to find the total number of pixels (the resolution).
- Find the colour depth in bits per pixel, then multiply the total number of pixels by the colour depth to get the file size in bits (divide by 8 for bytes, then by 1000 for kilobytes).
- For sound, multiply the sample rate (samples per second) by the duration in seconds to find the total number of samples taken.
- Multiply the number of samples by the bit depth to get the file size in bits, converting to bytes and kilobytes in the same way as for images.
Question 9 - Data Representation: Images, Sound and Compression
4 marks
A text file contains the phrase BBBBBAACCC, which is to be compressed using Huffman coding. State how many times each of the characters A, B and C appears in the phrase, and explain why the character that appears most often is given the shortest binary code.
Answer and mark scheme
Mark scheme for Question 9 [4 marks]| Question 9[4 marks] |
|---|
| Answer or working | Marks |
|---|
| B correctly counted as appearing 5 times | 1 |
| A correctly counted as appearing 2 times and C as appearing 3 times | 1 |
| explains that Huffman coding assigns shorter binary codes to more frequently occurring characters and longer codes to rarer characters | 1 |
| final answer: B is given the shortest code because it occurs most often, which minimises the total number of bits needed to encode the whole phrase | 1 |
Question 7 - Data Representation: Images, Sound and Compression
5 marks
A mono sound clip is recorded with a sample rate of 6000 Hz and a bit depth of 16 bits. The clip lasts 4 seconds. Calculate the file size of the recording in kilobytes (KB). Use 1 byte = 8 bits and 1 KB = 1000 bytes. Show your working.
Answer and mark scheme
Mark scheme for Question 7 [5 marks]| Question 7[5 marks] |
|---|
| Answer or working | Marks |
|---|
| total number of samples correctly calculated: 6000 x 4 = 24000 | 1 |
| samples correctly identified as needing to be multiplied by the bit depth | 1 |
| file size in bits correctly calculated: 24000 x 16 = 384000 bits | 1 |
| bits correctly converted to bytes: 384000 / 8 = 48000 bytes | 1 |
| final answer: bytes correctly converted to kilobytes, 48000 / 1000 = 48 KB | 1 |
Method recap - Programming Practice: Writing and Refining Programs
- Learn the difference between a procedure, which carries out a task but does not return a value, and a function, which returns exactly one value to the code that called it, and how to pass parameters into each.
- Practice declaring and using a 2D array with nested loops: the outer loop moves through each row index, and the inner loop moves through each column index within that row.
- Learn core string-handling operations: LENGTH returns the number of characters in a string, SUBSTRING extracts part of a string, the '+' operator joins (concatenates) two strings (some languages use '&'), and ASC/CHR convert between a character and its ASCII code.
- Learn the standard sequence for handling a text file: OPEN the file, READ or WRITE the data needed, then CLOSE the file, and why forgetting to close a file risks losing unsaved data or leaving the file locked.
Question 9 - Programming Practice: Writing and Refining Programs
4 marks
A program includes a subroutine called validateAge that checks whether an integer parameter is between 0 and 120 inclusive, and returns a Boolean value. (a) State whether validateAge should be written as a procedure or a function, giving one reason. (b) Write the pseudocode header and body for validateAge.
Answer and mark scheme
Mark scheme for Question 9 [4 marks]| Question 9[4 marks] |
|---|
| Answer or working | Marks |
|---|
| (a) function, because a value (True or False) must be returned to whatever called it | 1 |
| (b) correct pseudocode header with the parameter named, e.g. FUNCTION validateAge(age) | 1 |
| (b) condition correctly tests the inclusive range using AND, e.g. RETURN age ≥ 0 AND age ≤ 120(b) condition correctly tests the inclusive range using AND, e.g. RETURN age >= 0 AND age <= 120 | 1 |
| (b) final answer: subroutine correctly closed, cao, e.g. FUNCTION validateAge(age) RETURN age ≥ 0 AND age ≤ 120 ENDFUNCTION(b) final answer: subroutine correctly closed, cao, e.g. FUNCTION validateAge(age) RETURN age >= 0 AND age <= 120 ENDFUNCTION | 1 |
Question 10 - Programming Practice: Writing and Refining Programs
5 marks
A 2D array called seating stores the number of empty seats in a small theatre, with 3 rows (0-2) and 4 columns (0-3): seating = [[2,0,1,3],[0,0,2,0],[1,4,0,2]]. Write an algorithm, using pseudocode, that uses a nested loop to add up and output the total number of empty seats in the whole theatre.
Answer and mark scheme
Mark scheme for Question 10 [5 marks]| Question 10[5 marks] |
|---|
| Answer or working | Marks |
|---|
| total initialised before the loops, e.g. total = 0 | 1 |
| outer FOR loop correctly iterates over the rows, e.g. FOR row = 0 TO 2 | 1 |
| inner FOR loop correctly iterates over the columns, e.g. FOR col = 0 TO 3 | 1 |
| total correctly updated inside the inner loop, e.g. total = total + seating[row][col] | 1 |
| final answer: correctly structured algorithm with both NEXT statements and OUTPUT total placed after both loops end, e.g. total = 0, FOR row = 0 TO 2, FOR col = 0 TO 3, total = total + seating[row][col], NEXT col, NEXT row, OUTPUT total | 1 |