OCR A-Level Computer Science Computer systems (01), June 2025: Question 4
19 marks · Hard difficulty · Extended Response
Identify Little Man Computer (LMC) instructions, write an LMC program to output the larger of two inputs, and discuss the suitability of high-level versus low-level languages for various software projects.
Practise this questionQuestion
Question text
4 Kofi is a software engineer and has been asked to write some code using the Little Man
Computer (LMC) instruction set.
(a) State the LMC command that would be used for each description given in the table.
Description LMC Command
Load the value stored in the memory address
into the accumulator
Branch without checking the value in the
accumulator
Store the value from the accumulator into a
memory address
Branch if zero is in the accumulator
Branch if zero or a positive number is in the
accumulator
[3]
(b) Kofi has been asked to write a program that inputs two numbers and then outputs the largest of
the two numbers.
Write the code for this program using the LMC instruction set.
You can assume that the two numbers will always be different.
… [4]
(c)* Kofi is working on a number of projects. These include:
• project 1 – Writing a mobile phone app to look at the news
• project 2 – Writing software to send temperature readings from an embedded heat sensor
to other devices
• project 3 – Writing an image editing application for a desktop computer
• project 4 – Writing software to calculate the results of a physics experiment that produces
terabytes of data
• project 5 – Writing a new device driver for a new piece of hardware.
Discuss which of these projects should be written in a high level programming language and
which should be written in a low level language.
You should include the following in your answer:
• what is meant by high level programming language and low level language
• which projects are suitable for high level and which are suitable for low level languages
• a conclusion that justifies why these different languages are needed. [12]
Mark scheme
Show the mark scheme
Question Answer Mark Guidance
4 (a) 1 correct answer = 1 mark 3
2 correct answers = 2 marks
5 correct answers = 3 marks
Description Command
Load the value stored in LDA / LOAD
the memory address into
the accumulator.
Branch without checking BRA / BR
the value in the
accumulator.
Store the value from the STA / STO
accumulator into the
memory address.
Branch if zero is in the BRZ / BZ
accumulator.
Branch if zero or a BRP / BP
positive number is in the
accumulator.
4 (b) 1 mark for each to max 4: 18 4 Accept alternative mnemonics from the spec: STO,
● Correctly inputting two values and storing at LOAD, BR, BZ, BP, IN, INPUT, COB, END.
least one value
● Correctly subtracting one number from the other If labels used must be a corresponding DAT location for
● Correct use of branch MP1.
● Correct output for each path
POSSIBLE SOLUTION:
INP
STA FIRST
INP
STA SECOND
SUB FIRST
BRP OUTPUTSECOND
LDA FIRST
OUT
HLT
OUTPUTSECOND LDA SECOND
OUT
HLT
FIRST DAT 0
SECOND DAT 0
4 (c) Mark Band 3 – High level (9-12 marks) 19
12 Answers may include, but are not limited to, some of
the points below:
The candidate demonstrates a thorough knowledge and
understanding of high/low level languages. The material AO1 Knowledge
is generally accurate and detailed. High Level Languages:
● Uses English-like syntax/words.
The candidate is able to apply their knowledge and ● Easier for humans to read, create and debug
understanding directly and consistently to the context ● Is problem orientated
provided. Evidence/examples will be explicitly relevant ● Not locked to any particular architecture (but needs
to the explanation. a translator for the given architecture)
● Programmer is not in control of what machine code
The candidate provides a thorough discussion which is instructions are generated by the translator.
well balanced. Evaluative comments are consistently
relevant and well-considered. Low level languages:
● Written in binary / 1s and 0s.
There is a well-developed line of reasoning which is ● Processor specific.
clear and logically structured. The information ● Programs are based around the instructions
presented is relevant and substantiated. available.
● Programmer has direct control over what
Mark Band 2 – Mid level (5-8 marks) instructions are being run and what memory is
being used.
The candidate demonstrates reasonable knowledge
● Provides an interface between programmer and
and understanding of high/low level languages. The
hardware.
material is generally accurate but at times
underdeveloped.
AO2 Application
The candidate is able to apply their knowledge and 1) This program could be written in a high level
understanding directly to the context provided although language. This is because it will most likely
one or two opportunities are missed. contain a user interface that makes various
Evidence/examples are for the most part implicitly network requests to fetch the news and then
present this to the user.
relevant to the explanation.
2) This program could be written in a low level
The candidate provides a sound discussion, the language as it is for an embedded system it
may have a novel architecture and have no
majority of which is focused. Evaluative comments are
translator. It would also need direct access to
the hardware and memory management.
for the most part appropriate, although one or two 3) This program could be written in a high level
opportunities for development are missed. language. This is because it will contain a user
interface that will most likely require a lot of
There is a line of reasoning presented with some functionality which can be simplified in a high
structure. The information presented is in the most part level language.
relevant and supported by some evidence. 4) This program could be written in either. Low
level would give direct access to the memory
Mark Band 1 – Low Level (1-4 marks) management to better handle large amounts of
data being processed. Higher level may have
The candidate demonstrates a basic knowledge of libraries for the data manipulation required.
some aspects of high/low level languages. The material 5) This program could be written in a low level
is basic and contains some inaccuracies. language. This is because it will need to have
direct access to the computer hardware to deal
The candidate makes a limited attempt to apply with memory allocation/deallocation, buffers,
acquired knowledge and understanding to the context data structures, registers, interrupts etc.
provided.
AO3 Evaluation
The candidate provides a limited discussion which is ● Low level languages allow you to direct access the
narrow in focus. Judgments if made are weak and devices resources such as the memory to allow you
unsubstantiated. The information is basic and to optimise the devices performance.
communicated in an unstructured way. ● Low level languages are commonly used in
embedded systems as they have limited resources
The information is supported by limited evidence and available.
the relationship to the evidence may not be clear. ● Low level languages are commonly used in real-
time systems when speed is a crucial factor
0 marks o Direct control of instructions means the
No attempt to answer the question or response is not ability to control the speed
worthy of credit. o Direct control over the memory addresses
used allows control of the memory footprint
● High level languages allow for faster development.
They contain built-in functions to write code quicker.
● High level languages are work across different
platforms so they can be run on different operating
systems.
How to answer it
Assembly (LMC) & Generation of Programming Languages
This question evaluates your foundational knowledge of low-level assembly language operations, algorithm implementation using Little Man Computer (LMC), and the comparative strengths and use cases of high-level vs. low-level programming paradigms.
- LMC Instruction Set: Recognising standard mnemonics for memory access and accumulator branching.
- Assembly Programming Logic: Implementing comparison logic using arithmetic subtraction, conditional branching ( BRP ), and input/output handling.
- Comparative Language Architecture (12-marker): Evaluating hardware abstraction, memory control, execution speed, portability, and libraries across diverse real-world software engineering scenarios.
LMC Instruction Mnemonics
Identify the correct Little Man Computer assembly mnemonics
✅ Model Answers
| Description | Accepted LMC Command(s) |
|---|---|
| Load the value stored in the memory address into the accumulator | LDA or LOAD |
| Branch without checking the value in the accumulator | BRA or BR |
| Store the value from the accumulator into a memory address | STA or STO |
| Branch if zero is in the accumulator | BRZ or BZ |
| Branch if zero or a positive number is in the accumulator | BRP or BP |
💡 Key Knowledge: Accumulator Mechanics
LMC operates on a single accumulator register architecture. All branching decisions rely directly on the current numerical state of the accumulator:
- BRA : Unconditional jump.
- BRZ : Jumps only when Accumulator = 0.
- BRP : Jumps when Accumulator ≥ 0 (crucial for comparisons).
❌ Common Misconceptions
- Confusing LDA and STA: Remember, LDA copies from RAM to the Accumulator; STA copies from Accumulator to RAM.
- Mixing up BRP and BRZ: Note that BRP branches on both positive numbers and zero.
LMC Program: Find the Maximum of Two Numbers
Input two distinct numbers and output the larger value
✅ Annotated Full-Mark Solution
INP // Input first number STA FIRST // Store first number in mailbox 'FIRST' INP // Input second number (remains in Accumulator) STA SECOND // Store second number in mailbox 'SECOND' SUB FIRST // Calculate: Accumulator = SECOND - FIRST BRP SECONDBIG // If SECOND - FIRST >= 0, jump to SECONDBIG LDA FIRST // Else FIRST is larger: reload FIRST OUT // Output largest value HLT // Terminate program SECONDBIG LDA SECOND // SECOND is larger: reload SECOND OUT // Output largest value HLT // Terminate program FIRST DAT 0 // Reserve storage for first number SECOND DAT 0 // Reserve storage for second number 📐 Step-by-Step Logic Breakdown
- Step 1 (Inputs): Take both inputs. You must store at least one so it can be referenced later.
- Step 2 (Comparison via Subtraction): Execute SUB FIRST while SECOND is in the accumulator.
• If SECOND > FIRST , result > 0.
• If SECOND < FIRST , result < 0. - Step 3 (Branching): Use BRP to diverge execution paths depending on the sign flag.
- Step 4 (Output): Load the original value of the larger variable before executing OUT , because subtraction overwrote the accumulator!
🧠 Exam Technique: Securing 4/4 Marks
- Mark 1: Correctly inputting two values and storing at least one.
- Mark 2: Correctly subtracting one number from the other.
- Mark 3: Correct conditional branch based on the calculation result.
- Mark 4: Correct output path for both possible outcomes.
- Crucial Tip: Whenever labels are used as data storage (e.g. FIRST , SECOND ), you must declare them with a DAT directive at the bottom.
❌ Critical Trap: Outputting the Difference Instead of the Value
A frequent student error is immediately calling OUT after the branch. Remember that after SUB , the accumulator holds the difference between the numbers, not the original number itself! You must reload the chosen number with LDA before calling OUT .
High-Level vs. Low-Level Programming Paradigms
Extended response: Evaluating suitability across 5 real-world engineering projects
🧠 How Level-of-Response (LoR) Marks Are Awarded
To reach Band 3 (9–12 marks), your essay must demonstrate a balanced tripartite structure:
- AO1 (Knowledge): Accurate definitions of high-level vs low-level languages with clear distinctions.
- AO2 (Application): Explicit analysis classifying all 5 listed projects with rigorous technical justification.
- AO3 (Evaluation & Conclusion): A well-developed final synthesis justifying why both paradigms remain indispensable in modern computing.
💡 AO1: Theoretical Foundations
High-Level Languages (e.g., Python, Java, C#):
- Problem-oriented; use English-like syntax and mathematical notation.
- Abstract away machine architecture; highly portable across different CPUs via compilers/interpreters.
- Faster development cycles with extensive built-in libraries and automated memory management (garbage collection).
- Programmer has minimal direct control over specific CPU registers and memory addresses.
Low-Level Languages (Assembly / Machine Code):
- Machine/processor-oriented, directly tied to specific instruction set architectures (ISA).
- One-to-one (assembly) or direct binary (machine code) relationship with hardware.
- Provides absolute control over registers, memory addresses, interrupts, and I/O ports.
- Code is platform-dependent, harder to read, debug, and maintain.
✅ AO2: Contextual Project Analysis
| Project | Recommended Choice | Technical Justification |
|---|---|---|
| Project 1: Mobile news app | High-Level | Requires rich graphical UI, web APIs, and networking libraries. Portability across iOS/Android OS layers is essential. |
| Project 2: Embedded heat sensor | Low-Level | Microcontrollers have strict RAM/ROM limitations; low-level code ensures a tiny memory footprint and direct sensor register access. |
| Project 3: Desktop image editor | High-Level | Complex GUI controls, event listeners, file management, and existing image-processing frameworks simplify large-scale desktop development. |
| Project 4: Terabyte physics calculation | High-Level or Low-Level | High-level: Rich scientific/matrix libraries (e.g., NumPy). Low-level: Direct hardware optimisation, SIMD vector instructions, and manual cache management for extreme throughput. |
| Project 5: Hardware device driver | Low-Level | Requires direct manipulation of physical addresses, buffer registers, bitmasks, interrupts, and hardware timing signals. |
⚖️ AO3: High-Scoring Conclusion (Justifying Co-existence)
A top-tier answer must conclude by explaining why both language types are vital:
"Neither language paradigm is obsolete because they solve fundamentally different computing problems. High-level languages prioritise developer productivity, safety, and rapid delivery across complex systems where hardware abstraction is beneficial. Conversely, low-level languages remain essential where computing resources are constrained (embedded systems), where hardware must be directly commanded (drivers), or where execution speed and determinism cannot tolerate the overhead of runtime environments or generic compiler translations."
❌ What Distinguishes Band 2 from Band 3
- Vague Explanations: Stating "Low level is faster" without explaining why (e.g., direct 1-to-1 translation, no runtime overhead, manual register control) limits you to Band 2 (5–8 marks).
- Skipping Project 4 Nuance: Top candidates recognise Project 4 can be argued either way (or as a hybrid: high-level wrapper calling optimised low-level C/Assembly routines).
- No Justification in Conclusion: Simply summarising your choices is not an evaluation; you must synthesise why software engineering inherently demands both tiers of languages.
Topics
1.2 Software and software development · 1.2.4 Types of Programming Language
Question and mark scheme from the OCR A-Level Computer Science examination, Computer systems (01), June 2025. QuestionVault is an independent revision resource; questions remain the copyright of the awarding body.