The shape of the lesson
By the end of the lesson, learners can
- High-level languages: High-level languages are designed for people.
- Low-level: machine code and assembly: The processor only executes machine code: binary instructions, each made of an opcode and an operand.
- Which level, and why?: Exam questions give a scenario and ask which type of language to use.
- Reading and writing: high-level is English-like; low-level is mnemonics or binary.
- Debugging: easier in high-level.
- Machine independence: high-level is portable; low-level is for one processor type.
- Hardware: only low-level allows direct manipulation of hardware. Assembly needs an assembler.
One picture every idea returns to
A high-level language (such as Python, Java or Visual Basic) uses English-like statements, so it is easy to read, write and debug and is machine independent: the same program can run on different types of processor once translated. A low-level language is close to the processor's own instructions: machine code (binary) and assembly language, which uses short mnemonics such as LDD and ADD. Low-level code is hard to read and debug and is machine dependent, but allows direct manipulation of the hardware. Assembly language needs an assembler to translate it into machine code.
Forty-five minutes, phase by phase
| Time | Phase | What happens in the room | Grouping |
|---|---|---|---|
| 0 to 5 min | Hook: predict | Open with the question in the title, Close to people, or close to hardware.. Programmers can write in languages that read almost like English, or in codes that match the processor's own instructions one for one. Put the figure on the board: it is the one picture every idea in the lesson returns to. | Whole class, then pairs |
| 5 to 13 min | Teach and check: High-level languages | High-level languages are designed for people. | Whole class, then pairs |
| 13 to 21 min | Teach and check: Low-level: machine code and assembly | The processor only executes machine code: binary instructions, each made of an opcode and an operand. | Pairs |
| 21 to 30 min | Teach and check: Which level, and why? | Exam questions give a scenario and ask which type of language to use. Model the worked example Choose a language on the board, one line at a time. Your turn: Give one reason a programmer might write part of a program for an embedded system in assembly language. | Cooperative Concept Mapping |
| 30 to 36 min | Check | The four Stage 1 questions from the student lesson, answered on mini whiteboards or by show of fingers. Re-teach the one most get wrong. | Individual, then whole class |
| 36 to 43 min | Plenary | The exam-style questions from Stage 2, one at a time: thirty seconds alone, then a random call. The feedback lines in the key give the examiner's wording. | Individual, random call |
| 43 to 45 min | Exit and homework | Set the worksheet below (6 questions, 15 marks). Learners self-assess against the objectives before they leave. | Individual |
Protect the parts that carry the learning
The sequence carries about fifty minutes of material, so the lab is driven by one student while the class predicts rather than explored freely. Times are a guide.
Protected: the check at 30 minutes. It is the only individual read on whether the key idea landed, and it is not cut.
Cut first if the build overruns: the last check in Which level, and why?, never the check or the plenary.
In a 60 minute block: run worksheet questions 1 to 3 in class as a Rally Coach set and model both the hardest worked example and its check live.
Cooperative Concept Mapping
Teams receive the key terms on cards and arrange them on a large sheet, drawing and labelling the links. Compare maps between teams before showing the model map.
The full structure, with its variations and the other twelve, is on the cooperative-learning page.
What to head off, and how
| Trap learners fall into | Teaching move that pre-empts it |
|---|---|
| "High-level is easier" is too vague for a mark. | Say why: it uses English-like statements, so it is easier to read, write and debug. |
| Assembly language is low-level, even though it uses letters. | It still matches the processor's instructions one for one, and it still needs an assembler. |
High-level and low-level languages: worksheet
6 questions, 15 marks. Written in the style of the papers; no past paper question is reproduced.
Explain what is meant by a high-level language.
Give two advantages and two disadvantages of writing a program in a low-level language.
Assembly language is a form of low-level language. State what is used to write the instructions, and what is needed before an assembly language program can be executed.
A company is writing a program to control the motor in a washing machine and needs to access specific memory locations. State which type of language should be used and give a reason.
A team of programmers is writing a large online shop that will be updated by different people over many years. Explain why a high-level language is more suitable than a low-level language.
A student says: "Assembly language is a high-level language because it uses letters, not binary." Explain why the student is wrong.
Answer key and marking notes
- A programming language that uses English-like statements / is close to human language.
- It is machine independent and must be translated (by a compiler or interpreter) before it can be executed.
- Advantage: allows direct manipulation of the hardware.
- Advantage: code can be more efficient: faster and using less memory.
- Disadvantage: hard to read, write and debug.
- Disadvantage: machine dependent, so it only runs on one type of processor.
- Instructions are written using mnemonics (short codes such as LDD, ADD).
- An assembler is needed.
- It translates the assembly language program into machine code.
- A low-level language (assembly language).
- It allows direct manipulation of the hardware / specific memory locations (and gives efficient code).
- High-level code is English-like, so it is easier for different programmers to read, write and understand.
- It is easier to debug and maintain (and is machine independent, so it can run on different servers).
- Assembly language is low-level: each mnemonic matches a machine code instruction for a particular processor.
- Using letters (mnemonics) does not make it high-level; it is still machine dependent and needs an assembler.
6 multiple-choice questions on this lesson
From the topic question bank. Assign them in the app for a marked score in your gradebook, or run the topic as a class game.
Which is an advantage of writing a program in a high-level language?
- AIt is machine independent, so it can be translated to run on different processors
- BIt allows direct manipulation of the processor's registers
- CIt can be executed by the processor without being translated
- DIt always produces smaller and faster code than assembly language
Memory address 200 holds the value 12 and address 201 holds the value 30. This assembly language program is run:
LDD 200 ADD 201 STO 202What value is stored at address 202?
- A42
- B401
- C30
- D12
Which statement about assembly language is correct?
- AIt is a low-level language that uses mnemonics and needs an assembler
- BIt is a high-level language because it uses letters instead of binary
- CIt is executed directly by the processor without translation
- DIt is machine independent, so it runs on any type of processor
A company is writing the control program for a microwave oven. It must access specific memory locations and registers in the oven's processor. Which type of language should be used?
- AA low-level language, because it allows direct manipulation of the hardware
- BA high-level language, because it is machine independent
- CA low-level language, because it is easy to read and debug
- DA high-level language, because it can access any memory address directly
A student compares machine code and assembly language. Which pair of statements is correct?
- AMachine code needs no translation; assembly language must be translated by an assembler
- BMachine code must be compiled; assembly language needs no translation
- CBoth must be translated by an interpreter before they can run
- DMachine code is machine independent; assembly language is machine dependent
Address 50 holds 7, address 51 holds 5 and address 52 holds 0. This program is run:
LDD 50 ADD 51 ADD 51 STO 52 LDD 52 ADD 50 STO 50What value is held at address 50 when the program ends?
- A24
- B17
- C14
- D19
Quiz key
High-level code is machine independent: the same source can be translated for different processors, and it is easier to read, write and debug. Direct manipulation of hardware is an advantage of low-level languages. High-level code must be translated by a compiler or interpreter, and the translated code is often less efficient than well-written low-level code.
LDD 200 loads the value 12 into the accumulator, ADD 201 adds the value 30 to give 42, and STO 202 stores 42 at address 202. 401 comes from adding the address numbers 200 and 201 instead of their contents. 30 and 12 are the original values, which would only be stored if one instruction were ignored.
Assembly language is low-level: each mnemonic (such as LDD or ADD) matches a machine code instruction for one type of processor, and an assembler translates it into machine code. Letters do not make it high-level. Only machine code runs without translation, and assembly is machine dependent.
Accessing specific registers and memory locations needs a low-level language such as assembly, which gives direct manipulation of the hardware. Machine independence is a real advantage of high-level languages but is not what this task needs. Low-level code is hard, not easy, to read and debug, and high-level languages do not give direct hardware access.
Machine code is the binary the processor executes, so it needs no translator; assembly language uses mnemonics and must be converted by an assembler. Compilers and interpreters translate high-level languages, not low-level ones. Both machine code and assembly are machine dependent: they are written for one type of processor.
LDD 50 loads 7; ADD 51 gives 12; ADD 51 gives 17; STO 52 stores 17 at address 52; LDD 52 loads 17; ADD 50 adds 7 to give 24; STO 50 stores 24 at address 50. 17 is the value at address 52, not 50. 14 comes from adding 7 to itself, and 19 from adding 51 only once (7 + 5 + 7).
Slides for this lesson
A projectable deck for every pack is on the way. Until then, present the student lesson full screen: its sections, figure and lab tabs follow the same order as the plan above.