Teachers' Portal  /  IGCSE Computer Science 0478  /  Hardware  /  Instruction sets and embedded systems
Lesson pack · IGCSE Computer Science 0478 · 3.1 · IGCSE

Instruction sets and embedded systems

One job, done well. A CPU only understands a fixed list of machine code commands: its instruction set.

Student lesson Lab, full screen
At a glance

The shape of the lesson

Topic
Hardware
Syllabus reference
Cambridge IGCSE Computer Science 0478, 3.1
Level
IGCSE
Duration
45 minutes, lab-led; stretches to a 60 minute block (see the contingency notes)
Position in topic
Lesson 4 of 10 in Hardware; follows Cores, cache and clock speed; leads into Input and output devices
Central model
Fig. 1: a machine code instruction, and an embedded system compared with a general purpose computer
Cooperative structure
Assessment
Stage 1 check and the exam-style plenary from the student lesson, plus the worksheet as the exit task
Learning objectives

By the end of the lesson, learners can

Section by section
  • The instruction set: In the lab, pick an opcode and see how the instruction is built from binary.
  • Embedded systems: An embedded system is a computer system inside another device.
  • Where they are used: Exam questions often give a list of devices and ask which contain an embedded system, or ask you to explain why a device is embedded rather than general purpose.
Key points to leave on the board
  • Instruction set: all the machine code commands a CPU can process.
  • Instruction: opcode (what to do) and operand (data or address).
  • Embedded: dedicated function, built into a device, small, cheap, low power, fixed program.
  • General purpose: PC or laptop, many functions, user installs software.
The core visual model

One picture every idea returns to

An instruction set is the list of all the commands that a CPU can process. The commands are machine code (binary), each usually made of an opcode (the operation) and an operand (the data or address to use). An embedded system is a microprocessor-based system built into a larger device to perform a dedicated function, for example in a washing machine, car, security system, lighting system or vending machine. A general purpose computer, such as a PC or laptop, performs many different functions.

one machine code instruction (8 bits in this simple CPU) 0 0 1 1 1 0 0 1 opcode: what to dooperand: data or address embedded system one dedicated function washing machine, car ABS, vending machine, alarm general purpose many different functions PC or laptop: install and run any software
Fig. 1: a machine code instruction, and an embedded system compared with a general purpose computer
Lesson sequence

Forty-five minutes, phase by phase

TimePhaseWhat happens in the roomGrouping
0 to 5 minHook: predictOpen with the question in the title, One job, done well.. A CPU only understands a fixed list of machine code commands: its instruction set. 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 minTeach and check: The instruction setIn the lab, pick an opcode and see how the instruction is built from binary. Project tab 4 of the lab (Instruction sets and embedded systems) and let a student drive it while the class predicts.Whole class, then pairs
13 to 21 minTeach and check: Embedded systemsAn embedded system is a computer system inside another device. Your turn: Give two characteristics of an embedded system.Pairs
21 to 30 minTeach and check: Where they are usedExam questions often give a list of devices and ask which contain an embedded system, or ask you to explain why a device is embedded rather than general purpose. Model the worked example Embedded or not? on the board, one line at a time.Rally Robin
30 to 36 minCheckThe 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 minPlenaryThe 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 minExit and homeworkSet the worksheet below (6 questions, 14 marks). Learners self-assess against the objectives before they leave.Individual
Timing and contingency

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 Where they are used, 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.

Running the cooperative task

Rally Robin

Pairs take turns to say one item each, back and forth: a definition, a unit, a step of the method. Keep it fast and oral; the point is retrieval, not writing.

The full structure, with its variations and the other twelve, is on the cooperative-learning page.

Examiner traps to pre-empt

What to head off, and how

Trap learners fall intoTeaching move that pre-empts it
Different types of CPU can have different instruction sets, so machine code written for one type of processor may not run on another.Return to The instruction set: ask a pair to state the correct version and show it on the lab before moving on.
A laptop is not an embedded system even though it contains a microprocessor.Being general purpose, able to run many different programs, is what makes it different.
Worksheet

Instruction sets and embedded systems: worksheet

6 questions, 14 marks. Written in the style of the papers; no past paper question is reproduced.

NameClassDate
Q1 · recall[2 marks]

State what is meant by an instruction set and give the form its commands are in.

Q2 · explain[2 marks]

An instruction is made of an opcode and an operand. Describe each part.

Q3 · recall[2 marks]

Describe what is meant by an embedded system.

Q4 · recall[3 marks]

Identify three devices that commonly contain an embedded system.

Q5 · explain[3 marks]

Explain three differences between an embedded system and a general purpose computer such as a laptop.

Q6 · apply[2 marks]

A smart thermostat controls the heating in a house. Explain why it is an example of an embedded system.

Answer key and marking notes
Q1 · 2 marks
  • A list of all the commands that can be processed by a CPU.
  • The commands are machine code (binary).
Q2 · 2 marks
  • Opcode: the operation to be carried out (for example ADD or LOAD).
  • Operand: the data, or the address of the data, the operation uses.
Q3 · 2 marks
  • A computer system (microprocessor) built into a larger device.
  • That performs a dedicated function.
Q4 · 3 marks
  • Any three, e.g. washing machine / microwave / fridge.
  • Car (engine management, ABS, airbags) / security system.
  • Lighting system / vending machine / traffic lights.
Q5 · 3 marks
  • Embedded performs one dedicated function; a laptop performs many different functions.
  • Embedded usually has a fixed program in ROM; a laptop user can install and run different software.
  • Embedded is usually smaller, cheaper and uses less power than a laptop.
Q6 · 2 marks
  • It is a microprocessor built into the heating system/device.
  • It performs one dedicated function: reading the temperature and switching the heating on or off.
Quiz

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.

Q11 mark

What is an instruction set?

  • Athe list of all the machine code commands that a particular CPU can process
  • Bthe set of programs that are installed on a computer
  • Cthe order in which the fetch, decode and execute stages happen
  • Dthe rules for writing a program in a high-level language
Q21 mark

In the instruction ADD 26, what is 26?

  • Athe operand: the address of the data to use
  • Bthe opcode: the operation to carry out
  • Cthe instruction set: the list of commands
  • Dthe program counter: the next address
Q31 mark

Which device contains an embedded system?

  • Aa microwave oven
  • Ba laptop
  • Ca desktop PC
  • Da tablet that runs apps
Q41 mark

A machine code program runs on one computer but will not run on another computer that has a different type of processor. What is the most likely reason?

  • AThe two processors have different instruction sets
  • BThe second computer does not have enough secondary storage
  • CMachine code can only ever run once before it must be translated again
  • DThe second processor has a lower clock speed
Q51 mark

A simple CPU uses 8-bit instructions. The first 3 bits are the opcode and the remaining 5 bits are the operand. What is the greatest number of different commands its instruction set can contain?

  • A8
  • B32
  • C256
  • D6
Q61 mark

Which set of characteristics best describes a typical embedded system, such as the controller in a car's anti-lock brakes?

  • Adedicated function, low power, program held in ROM, responds quickly to sensor inputs
  • Bgeneral purpose, high power, user installs new programs, large touch screen interface
  • Cdedicated function, high cost, program loaded from a hard disk each time it starts
  • Dgeneral purpose, low power, program stored in RAM so the driver can change it
Quiz key
Q1: A

An instruction set is the complete list of commands (in machine code) that a CPU is designed to decode and execute, such as load, add, store, compare and jump. The installed programs are software, not the instruction set. The FDE order is the cycle, and the rules of a high-level language are its syntax: such programs must be translated into the instruction set before they run.

Q2: A

An instruction is made of an opcode (here ADD, the operation) and an operand (here 26, the data or the address of the data to use). 26 is not the operation, so it is not the opcode. The instruction set is the whole list of commands the CPU knows, and the PC is a register, not part of the instruction.

Q3: A

The microprocessor in a microwave oven is built into the appliance and performs one dedicated function (controlling the cooking), so it is an embedded system. A laptop, desktop PC and app-running tablet all contain microprocessors, but they are general purpose computers able to run many different programs.

Q4: A

Machine code uses commands from one CPU's instruction set. A different type of processor may have a different instruction set, so it cannot decode those commands. A small program does not need much storage; machine code can be run again and again without retranslation; and a slower clock would make the program run more slowly, not stop it running.

Q5: A

Each opcode pattern is a different command, and 3 bits give 23 = 8 patterns. 32 is 25, the number of different operands (addresses 0 to 31), not commands. 256 is 28, using the whole instruction as if it were all opcode, and 6 doubles 3 instead of raising 2 to the power 3.

Q6: A

An embedded system performs one dedicated task, uses little power, keeps a fixed program in ROM (firmware) and often reacts in real time to sensors, as brakes must. 'General purpose' with user-installed programs describes a PC or laptop. Embedded systems are low cost and do not normally boot from a hard disk, and their program is not in RAM where it would be lost without power.

Lab and demo

What to project

The student lesson embeds these tabs. Open them full screen on the projector; every slider has a drag handle on the stage.

Slides

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.

Also for this topic

Everything else you can use

Original work by the TheLucidSTEM team. The worksheet items are written in the style of the papers; no past paper question is reproduced.
Previous lessonCores, cache and clock speed