Preview

07 - Practice Test

 1. Machine code is used in which generation of a programming language?

  1st Generation

  4th Generation

  3rd Generation

  2nd Generation

 2. Which language translator is needed for the 1st generation?

  No Translator

  A basic translator (IBM)

  An assembler

  An interpreter

 3. Which generation would create the fastest code to execute?

  4th Generation

  3rd Generation

  2nd Generation

  1st Generation

 4. An advantage of low level languages is that:

  it produces complex large files that are robust and useful for the programmer

  it produces programs of a relatively smaller file size

  None of the above

  it produces great big programs that are complex and difficult to manage

 5. An advantage of a high level language is that:

  It is closer to the machine and machine code

  It is easier to understand (by a programmer)

  It is useful for device drivers

  None of the above

 6. Low level languages are said to have a one to many relationship with high level languages

  TRUE

  FALSE

 7. The Little Man Computer is a very simple yet powerful ….
This is a great introductory video to LMC - have a watch if you are able.

  model of a printer

   model of a computer!

  model of a spacecraft of the future

  model of the monitor of a computer

 8. Read the excerpt on LMC and fill in the blanks
LMC is a simulator which has many of the basic features of a 
modern computer that uses the __________________________ (a central 
processing unit consisting of an arithmetic logic unit and
registers, a control unit containing an instruction register 
and program counter, input and output mechanisms and RAM to 
store both data and instructions).

  spatial awareness meter

  Cartal model of computers

  None of the above

  Von Neumann architecture

 9. The LMC is based on the idea of a 'Little Man' acting like the control unit of a CPU, _________________ them as well as managing the input and output mechanisms.

  None of the above

  riding through metaphorical hills and valleys and enjoying

  catching 1s and 0s as they pass through the computery ether and making

  fetching instructions from RAM, decoding and executing

 10. The 100 memory addresses in the computer memory are numbered 0 to 99 and can each contain a________________ instruction or data.

  machine code

  python code

  gentrified code

  C code

 11. Each assembly language instruction is made up of a 3 letter mnemonic usually followed by the memory address of the data the CPU is to act on

  FALSE

  TRUE

 12. One disadvantage or issue with assembly language is that the code only works on a specific CPU family. If you use a different CPU you would

  None of the above

  need to make a copy of your old CPU

  not need to rewrite the code at all

  need to re-write the code using a different version of assembly language

 13. The main advantage of assembly language is that it :

  runs slow compared to high level languages which makes it easy to follow

  is soft and cuddly, and therefore programmer's favourite

  is robust and hardy and cannot ever make a mistake (hence it's popular use in spacecraft)

  runs fast compared to programs written in a high level language as there is less code overall

 14. An example of a program that is typically written in assembly language is:

  an online shop

  a device driver

  a personal fitness app for Android

  a website for a government

 15. Device drivers need to be as ______________ as possible which is why assembly language is perfect

  fast and efficient

  easily understandable in terms of the code

  slow and careful

  None of the above

 16. Which of the following is NOT a typical assembly language command.
add
lock
subtract
load
compare
branch
store

  load

  add

  subtract

   lock

 17. An example of an assembly code mneumonic is LDA 50 which…

  None of the above

  adds the value 50 to the loaded value before it

  stores (loads) the value 50 into a register in the CPU

  stores the value 50, fifty times into fifty registers in the CPU

 18. In this example: LOAD 0004, it can be said that 'LOAD' is the opcode and the second part 0004 is the memory address

  TRUE

  FALSE

 19. In the command MOV AL 34h…the opcode is the __________ instruction and the other parts are called OPERANDS.

  AL instruction

  34h part of the code

  MOV instruction

  None of the above

 20. Operands are…

  manipulated directly by a high level language command

  little bits of beauty

  manipulated by the opcode

  tiny bits that are used to code in assembly language

 21. What does this LMC program do?
INP 
STA A 
INP 
STA B 
LDA A 
ADD B 
OUT 
HLT
A    DAT
b    DAT 
lmc_q1.gif

  take in two numbers and stores them, displaying the first number

  None of the above

  takes in three numbers and stores them

  adds two numbers and displays the sum

 22. This LMC program doesn't add or subtract. What does it do?
INP 
STA A 
INP 
STA B 
LDA A 
SUB B 
BRP isPositive
LDA B
OUT
HLT 
isPositive
LDA A 
HLT
A    DAT
B    DAT 

  finds out if an input number is positive or negative

  sorts three numbers from smallest to largest

  determines the bigger of two numbers by using loops

  loads two letters 'A' and 'B' and determines which one comes first

 23. The LMC can add or subtract numbers, but it can neither multiply nor divide. The multiplication can be carried out with the aid of ……..

  subtraction!

  addition!

  stubborn and persistent hard coding

  nothing - this cannot be done!

 24. Assembly language is written using:

  ASCII code

  Hex code

  None of the above

  Mneumonics

 25. Assembly language instructions like MOV or ADD are called operands

  TRUE

  FALSE