CAPE Computer Science Unit 1 · 2011 · Paper 2
31 questions and parts from this paper. Open one to see it in full, then practise it on Quelpr and get it marked against the mark scheme.
- 1(a)6 marksUsing only primary logic gates, design and draw the circuit for the given truth table.
- 1(b)4 marksWrite down the truth table (listing all input bit patterns and corresponding outputs) for the logic circuit shown in Figure 1.
- 1(c)(i)2 marksExplain what is meant by the term 'Flip-flop'.
- 1(c)(ii)2 marksExplain what is meant by the term 'Multiplexor'.
- 1(d)(i)3 marksDraw a clearly labelled block diagram of a 2-to-4 line decoder.
- 1(d)(ii)3 marksA circuit controls four light bulbs B1, B2, B3, and B4 such that only one is on at any time. State how a 2-to-4 line decoder can be used in this circuit and explain how the bulbs are switched on.
- 1(e)2 marksFind the 4-bit two's complement of -6.
- 1(f)3 marksGiven a floating point representation of 1-bit sign, 3-bit exponent, and 5-bit mantissa, calculate the decimal representation of 001000101, showing all working.
- 2(a)6 marksName and state the function of THREE registers found in the Central Processing Unit (CPU).
- 2(b)6 marksCompare main memory and TWO storage devices in terms of capacity and access speed.
- 2(c)4 marksBesides registers, name TWO other components in the CPU and state the function of EACH.
- 2(d)4 marksDefine the term 'cache memory' and explain how it increases the efficiency of data retrieval.
- 2(e)(i)1 markState what is an 'instruction format'.
- 2(e)(ii)4 marksName and describe TWO addressing modes.
- 3(a)6 marksDescribe any THREE stages in the problem solving process.
- 3(b)11 marksConstruct a flowchart to represent the given algorithm that finds the average age of a set of students.
- 3(c)8 marksBy referring to the specific line number, identify and correct the errors in the given algorithm designed to print a table of squares of all even numbers between 1 and 100 inclusive.
- 4(a)3 marksState THREE properties of a well-designed algorithm.
- 4(b)11 marksTrace through the execution of the given algorithm and draw the exact output generated, using a dash '-' to represent spaces printed by printSpaces(n).
- 4(c)(i)8 marksWrite an algorithm that uses iteration to print the sum of ALL multiples of 11 (integers) between 0 and 5 000, inclusive.
- 4(c)(ii)3 marksIndicate whether 'bounded' or 'unbounded' iteration was used in your response for 4(c)(i) and state ONE reason for its use.
- 5(a)2 marksApart from intermediate code generation, list TWO other stages of the translation process.
- 5(b)2 marksGive TWO advantages of using a modular approach in programming.
- 5(c)6 marksWrite a C function which accepts an integer array and an integer variable indicating the size of the array, and returns the sum of all numbers in the array that are NOT greater than 100.
- 5(d)15 marksWrite a C program that reads the jellybean contest data from 'contest.txt' and outputs to 'winner.txt' the winning guess and member ID code (without using arrays).
- 6(a)2 marksExplain the term 'white space'.
- 6(b)2 marksDefine the term 'debugging'.
- 6(c)2 marksExplain why programmers should practise proper indentation.
- 6(d)11 marksWrite a C program that prompts the user for THREE integers, determines the type of triangle represented according to the given rules, and prints the result or 'No triangle is represented.'
- 6(e)(i)4 marksShow the output generated by the given nested for-loop code segment.
- 6(e)(ii)4 marksModify the code in 6(e)(i) so that the specified triangular number pattern output is generated.