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.

In simpler words

RISC processors use a small set of simple instructions that are all the same length. CISC processors use many complex instructions of different lengths. Simple instructions make pipelining easy. In a pipeline, the processor fetches one instruction while decoding another and running a third. Parallel computers are grouped by how many instruction streams and data streams they have. A virtual machine is software that acts like a separate computer.

An everyday comparison

A pipeline is like a car wash with three bays: soap, rinse, dry. While one car is dried, the next is rinsed and a third is soaped. Once full, a clean car leaves every step. The comparison stops working because an interrupt or a jump in the program can force the pipeline to be cleared, which does not happen to cars in a queue.

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.

In the exam

For RISC against CISC, give matched contrasts: fixed against variable length instructions, few against many addressing modes, many against fewer registers, hard-wired against microprogrammed control unit. For pipeline timing, write k + (n − 1) clock cycles, substitute the stages and instructions, and give the answer in cycles. Compare with k × n without a pipeline. For parallel systems, expand the name, such as SIMD: single instruction, multiple data, and give an example use, such as graphics. For virtual machines, give one benefit and one drawback.

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