Processors, Parallel Processing and Virtual Machines

Computer Science A2 · Hardware and Virtual Machines. The idea in plain words, the rules to remember, the mistake to avoid and a worked example, written and checked by Mega Lecture.

Test this topic freeAll Computer Science A2 topics

The idea

RISC processors have a small set of simple, fixed-length instructions, few addressing modes and many registers. CISC processors have a large set of complex instructions of different lengths, so a program needs fewer instructions but each can take several clock cycles.

Simple, equal instructions make pipelining easy: while one instruction is executed, the next is decoded and a third is fetched. When an interrupt comes, several instructions are part-way through, so the pipeline must be dealt with before the routine runs.

Parallel computers are classed by how many instruction streams and data streams they have: SISD, SIMD, MISD, MIMD. A virtual machine is software that behaves like a separate computer on a host.

Rules to remember

Common mistake

Students work out pipelined time as stages × instructions. Only the first instruction needs all the stages; after that one instruction finishes every clock cycle, so add 1 cycle for each further instruction.

Worked example

A processor has a four-stage pipeline and each stage takes one clock cycle. There are no stalls or branches. How many clock cycles are needed to complete 12 instructions, and how many are saved compared with no pipelining?

  1. The first instruction finishes after 4 cycles.
  2. Each of the other 11 instructions finishes one cycle later: 4 + 11 = 15 cycles.
  3. Without a pipeline: 4 × 12 = 48 cycles.
  4. Saving: 48 − 15 = 33 cycles.

Answer: 15 clock cycles, which is 33 fewer than without pipelining.

Ask about this

Type what you are stuck on. The helper finds the explanation, worked examples and the notes to read, free and instant.

Keep going

← Circuit switching, packet switchingBoolean Algebra and Logic Circuits →Take a Computer Science A2 test