Question 5

OCR Computer Science Specimen Paper 1A level11 marks

On the specification

(a)
1.2 Software and software development
(b)
1.2 Software and software development
(c)
1.2 Software and software development
(d)
2.2 Problem solving and programming
(e)(i)
1.1 The characteristics of contemporary processors, input, output and storage devices1.2 Software and software development
(e)(ii)
1.1 The characteristics of contemporary processors, input, output and storage devices
Question text

5 The program, as shown in Fig.2 below, is written in assembly code using the Little Man Computer instruction set. It is supposed to take in two numbers and output the higher. INP STA NUMA INP STA NUMB SUB NUMA BRP NOTA LDA NUMB BRA QUIT NOTA LDA NUMA QUIT OUT HLT NUMA DAT NUMB DAT Fig.2 (a) State what type of translator program would be needed to convert the code above into machine code. [1] (b) The program does not work correctly. Describe what the program actually does, using the numbers 4 and 9 being entered as an example. [2] (c) Explain how you would correct the program so it outputs the higher of the two numbers entered. [2] (d) Programs can also be written in high level languages. In pseudocode write a procedural program that takes in two numbers and outputs the higher of them. [4] A processor executes this program following the Fetch-Decode-Execute cycle. To do this it needs to make use of registers. One of the registers used is the Program Counter (PC). Ordinarily it would be incremented by one each cycle. (e) (i) Identify an instruction in the Little Man Computer program shown in Fig.2 that would cause the PC to change in a different way. [1] (ii) State which register the contents of the PC would be copied to in order for the processor to access the next instruction. [1]