Edexcel International Advanced Level Computer Science, point 11.1.2
An instruction set architecture (ISA) is the set of instructions a processor can carry out. CISC and RISC are two design philosophies for it.
a. Architecture
CISC: complex instruction set computer
- A large set of instructions, many complex: a single instruction can do several things (for example load two values from memory, add them and store the result).
- Instructions vary in length and take a variable number of clock cycles.
- Many addressing modes.
- Aim: fewer instructions per program (shorter programs, less memory in the days when memory was costly), and make life easier for assembly programmers and compilers.
- Complex control unit, often microcoded (each complex instruction is run as a sequence of simpler micro-operations).
- Fewer registers.
- Example: Intel x86 (most PCs and servers).
RISC: reduced instruction set computer
- A small set of simple instructions, each doing one basic job, usually in one clock cycle.
- Instructions are a fixed length, which makes them easy to decode.
- Load/store architecture: only load and store instructions access memory. All calculations use registers.
- Many registers, to keep data in the CPU.
- Aim: make each instruction very fast, and let the compiler combine simple instructions.
- Hardwired control unit (simple and fast), and very suitable for pipelining (11.1.3).
- Examples: ARM (phones, tablets, many embedded systems, now laptops), MIPS, RISC-V.
Example: adding two numbers in memory
CISC (one complex instruction):
ADD [result], [x], [y] ; reads memory, adds, writes memory
RISC (several simple instructions), in ARMlite style (Appendix 3):
LDR R0, x ; load x into a register
LDR R1, y ; load y into a register
ADD R2, R0, R1 ; add the registers
STR R2, result ; store the result in memory
The RISC program has more instructions, but each is simple and quick, and they pipeline well.
b. Differences between RISC and CISC
| CISC | RISC | |
|---|---|---|
| Number of instructions | Many (hundreds) | Few (tens) |
| Complexity of instructions | Complex, multi-step | Simple, single-step |
| Instruction length | Variable | Fixed |
| Clock cycles per instruction | Variable, often several | Usually one |
| Memory access | Many instructions can access memory directly | Only LOAD and STORE |
| Registers | Fewer | Many |
| Addressing modes | Many | Few |
| Control unit | Complex (microcoded) | Simple (hardwired) |
| Pipelining | Harder (variable length and time) | Easier and more effective |
| Program size | Smaller (fewer instructions) | Larger (more instructions) |
| Compiler work | Less | More (must plan the simple instructions) |
| Power use and heat | Higher | Lower |
| Typical use | Desktop PCs and servers (x86) | Mobile devices, embedded systems (ARM) |
Benefits and drawbacks
CISC
- Benefits: compact programs, less memory used for code, and easier to write assembly.
- Drawbacks: complex and costly hardware, instructions that take many cycles, harder to pipeline, more power, and many complex instructions are rarely used.
RISC
- Benefits: simple, fast, low-power hardware, efficient pipelining, cheaper to design, and good for battery-powered devices.
- Drawbacks: larger programs (more memory and more instruction fetches), and compilers must be more sophisticated.
The blurred line today
Modern x86 processors convert complex instructions into simple internal micro-operations that run on RISC-like cores, and RISC designs have added more instructions. The distinction is mainly historical and in the instruction set, but it still explains the difference in power use and typical uses.
Worked example
Task: a company is choosing a processor for (a) an electric bike's motor controller and (b) a file server. Which design suits each?
(a) Electric bike motor controller → RISC (for example ARM). It runs from the bike's battery, so low power matters, and it does one fixed job (reading the pedal sensor and setting the motor power) that needs fast, predictable responses. Simple, fixed-length instructions that pipeline well give that, and the small program fits easily in the controller's memory.
(b) File server → CISC (x86) is a common choice. Software compatibility with huge amounts of existing code, high peak performance, and plenty of power available make it suitable. (RISC processors are also now used in servers: the choice depends on cost, power and software.)
Key point to explain: RISC does less per instruction but each instruction is faster, and its simple, fixed-length instructions suit pipelining. CISC does more per instruction, giving smaller programs but more complex hardware.
Exam tip: give at least three differences (instruction number, complexity, cycles, memory access, registers, pipelining) and link them to a use (RISC: mobile, low power; CISC: PCs). Be careful: RISC programs are longer but not slower, as each instruction is quicker.
Check yourself
What is a RISC processor?
One with a small set of simple, fixed-length instructions, each normally completed in one clock cycle, with load/store memory access and many registers.
Give two differences between CISC and RISC
Any two of: CISC has many complex variable-length instructions, RISC has few simple fixed-length ones; CISC instructions take several cycles, RISC usually one; CISC can access memory in many instructions, RISC only with load/store; RISC has more registers.
Why does RISC suit pipelining?
Its instructions are simple, fixed in length and take one cycle, so the stages are regular and easy to overlap.
What is a load/store architecture?
Only the LOAD and STORE instructions can access memory; every calculation works on values held in registers.
Give one drawback of RISC
Programs need more instructions, so they are larger, and compilers must work harder to produce efficient code.