• No results found

1 Complete the following by writing either compiler, interpreter or assembler in the spaces provided. ... translates source code into object code.

N/A
N/A
Protected

Academic year: 2021

Share "1 Complete the following by writing either compiler, interpreter or assembler in the spaces provided. ... translates source code into object code."

Copied!
8
0
0

Loading.... (view fulltext now)

Full text

(1)

2

0478/12/M/J/16 © UCLES 2016

1 Complete the following by writing either compiler, interpreter or assembler in the spaces provided.

... – translates source code into object code.

... – translates low-level language into machine code. ... – stops the execution of a program as soon as it

encounters an error.

[3]

2 Motion sensors are used in a security system to detect intruders.

Name three other sensors that could be used in the following applications. Give a different type of sensor for each application.

Application Sensor

controlling street lights

monitoring a river for pollution controlling traffic lights

[3]

(2)

0478/13/M/J/18

© UCLES 2018 [Turn over

(b) Draw a logic circuit corresponding to this logic statement:

X = 1 if (A is NOT 1) OR ((B is 1 OR C is 1) AND (B is NOT 1 OR A is NOT 1))

A

B

C

X

[6]

9 Three types of translators are assemblers, compilers and interpreters.

Tick (

) the appropriate boxes to show which statements apply to each type of translator.

Statement Assembler(

) Compiler(

) Interpreter(

)

Translates high-level language into machine code Provides error diagnostics Translates whole program to object code in one operation Translates and executes one line of code at a time

(3)

2

0478/12/M/J/20 © UCLES 2020

1 A Von Neumann model for a computer system has a central processing unit (CPU) that makes

use of registers.

(a) Identify three registers that may be used.

Register 1 ... Register 2 ... Register 3 ... [3]

(b) The CPU is responsible for processing instructions.

One stage of processing instructions is the decode stage. (i) Identify the two other stages of processing instructions.

Stage 1 ... Stage 2 ... [2]

(ii) Identify the component of the CPU that is responsible for decoding instructions.

... [1]

2 Both an interpreter and a compiler can be used when writing a program in a high-level language. (a) Explain why a programmer would make use of both an interpreter and a compiler.

... ... ... ... ... ... ... ... [4]

Buy O / A Level & IGCSE Original Books, Solved Past Papers & Notes Online at Discounted Prices.

Home Delivery all over Pakistan Call / WhatsApp: (0331-9977798) Visit: www.TeachifyMe.com/Shop

(4)

0478/12/M/J/20

© UCLES 2020 [Turn over

(b) Give three reasons why a programmer would choose to write a program in a high-level

language, instead of a low-level language.

Reason 1 ... ... Reason 2 ... ... Reason 3 ... ... [3]

3 A company collects and stores data about its customers. The data is stored on a server in the

company’s office.

The data is transmitted to cloud storage to create a back-up.

The data is encrypted using symmetric encryption before it is sent to the cloud storage.

(a) Describe how the data is encrypted.

... ... ... ... ... ... ... ... [4]

(b) Give three other methods that can be used to secure the data in the office.

Method 1 ... ... Method 2 ... ... Method 3 ... ... [3]

Buy O / A Level & IGCSE Original Books, Solved Past Papers & Notes Online at Discounted Prices.

Home Delivery all over Pakistan Call / WhatsApp: (0331-9977798) Visit: www.TeachifyMe.com/Shop

(5)

10

0478/11/O/N/16 © UCLES 2016

8 Four descriptions about compilers and interpreters are shown below.

Draw lines to indicate which descriptions refer to a compiler and which descriptions refer to an interpreter.

It is more difficult to debug the code since one error can produce many other associated

errors.

Compiler

Description

The speed of execution of program loops is slower.

It produces fast, executable code that runs directly on the

processor.

It is easier to debug the code since an error is displayed as

soon as it is found.

Interpreter

[4]

QUESTION 4.

(6)

0478/12/O/N/16 © UCLES 2016

1 (a) Give two reasons why a programmer would choose to write code in a low-level language.

1 ... ... ... 2 ... ... ... [2]

(b) High-level languages require either an interpreter or a compiler to translate the program. The table below lists a number of statements about language translators.

Tick (3) to show which statements refer to interpreters and which refer to compilers.

Statements Interpreter (3) Compiler (3)

Translates the source code into machine code all at once

Produces an executable file in machine code Executes a high-level language program one instruction at a time

Once translated, the translator does not need to be present for the program to run

An executable file is produced

[5]

2 State four functions of an operating system.

1 ... 2 ... 3 ... 4 ... [4]

(7)

11

0478/11/O/N/17 © UCLES 2017

10 Six statements about assembly language are shown.

Tick (3) whether the statement is true or false.

Statement true

(3) false(3) Assembly language uses mnemonic codes.

Assembly language programs do not need a translator to be executed.

Assembly language is a low-level programming language.

Assembly language is specific to the computer hardware.

Assembly language is machine code. Assembly language is often used to create drivers for hardware.

[6]

QUESTION 6.

(8)

0478/12/O/N/18

© UCLES 2018 [Turn over

6 (a) Many programmers write computer programs in high-level languages. The programs need to

be translated into machine code to be read by the computer.

State two types of translator that can be used.

Translator 1 ... Translator 2 ... [2]

(b) Explain two reasons why a computer programmer may choose to write a program in a high-level language, rather than a low-high-level language.

Reason 1 ... ... ... ... Reason 2 ... ... ... ... [4]

(c) Three examples of computer code are given in the table.

Tick (✓) to show whether each example of computer code is High-level language, Assembly language or Machine code.

Computer code High-level language (✓) Assembly language (✓) Machine code (✓) 10110111 11001100 01011100 FOR X = 1 TO 10 PRINT X NEXT X INP X STA X LDA Y [3]

References

Related documents

Before Now Handwriting Signature Digital Signed PDF Party A’s Digital Signature Party B’s Digital Signature PDF417 Original Document with Digest Digital signed QR

To determine the goodness of the metaheuristics considered in this work, this section presents a comparison of the results from the best performing algorithm (SA) with

Strategy 1: Cloud for Development and Test Environments ArcGIS 19 • Expanded data storage quickly • Achieved 100% reliability over 18 months • Saved costs Oracle

1. First, ensure that MARS is configured to start the text segment at address 0x00000000. If you do not do this, MARS will use default values for the start addresses for the text

Abiotic (drought, heat, and cold stress) and biotic (pod borers – Helicoverpa armigera and Spodoptera exigua, aphids – Aphis crac- civora, leaf miner – Liriomyza cicerina, and

Paralelno sa razvojem metodologije merenja vibracija od saobraćaja, razvijani su i različiti empirijski i numerički modeli za proračun vibracija od saobraćaja,

There are many augmented reality (AR) applications avail- able that can be used to create educational contents for these mobile devices. This paper surveys the most popular

There are different ways of translating a programming language Lecture 0 11 Compiler Source Code Binary/Assembly Interpreter Source Code Compiler Source Code Bytecode VM.. Ex.: C,