1. Processors, Parallel Processing and Virtual Machines
15.1
RISC, CISC, pipelining, Flynn, VMs
A CISC (Complex Instruction Set Computer) processor has a large set of instructions, some of which do several low-level operations at once (for example load from memory, add and store in one instruction). A RISC (Reduced Instruction Set Computer) processor has a small set of simple instructions that each do one thing, and builds complex operations from several of them.
| RISC | CISC |
|---|
| fewer, simpler instructions | many, more complex instructions |
| fixed-length instructions, simple formats | variable-length instructions, many formats |
| most instructions take one clock cycle | instructions take several clock cycles |
| few addressing modes; only load and store access memory | many addressing modes; many instructions access memory |
| many general-purpose registers | fewer registers |
| well suited to pipelining | harder to pipeline |
| hard-wired control unit; more work for the compiler, longer programs | microprogrammed control unit; shorter programs, simpler compiler |
Pipelining splits instruction execution into stages and works on a different instruction in each stage at the same time, like a production line. A five-stage pipeline uses instruction fetch (IF), instruction decode (ID), operand fetch (OF), instruction execute (IE) and write back (WB). Registers matter because each stage must hold its intermediate results, and RISC's many registers let operands stay in the processor rather than in slower memory.
| Stage | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|
| IF | I1 | I2 | I3 | I4 | I5 | I6 | | | | |
| ID | | I1 | I2 | I3 | I4 | I5 | I6 | | | |
| OF | | | I1 | I2 | I3 | I4 | I5 | I6 | | |
| IE | | | | I1 | I2 | I3 | I4 | I5 | I6 | |
| WB | | | | | I1 | I2 | I3 | I4 | I5 | I6 |
Cycles for n instructions in a k-stage pipeline
k + (n − 1) cycles, compared with k × n without pipelining. 6 instructions, 5 stages: 5 + 5 = 10 cycles instead of 30.
Interrupts.
Flynn's four architectures
| Architecture | Meaning | Example |
| SISD | Single Instruction, Single Data: one processor, one instruction on one data item at a time | early single-core computers |
| SIMD |
Single Instruction, Multiple Data: many processing elements carry out the same instruction on different data at once |
| MISD |
| MIMD |
massively parallel computer
Virtual machines
virtual machine (VM)