COA Notes
Reduced Instruction Set Computer architecture, design principles, and performance advantages.
Introduction
RISC (Reduced Instruction Set Computer) emerged in the 1980s as a revolutionary idea: instead of making individual instructions more powerful, make them simpler and execute them faster. The insight was that 80% of program execution used only 20% of available CISC instructions — so why spend transistors on complex instructions that compilers rarely generate? RISC processors achieve high performance through simplicity: fixed-length instructions, load/store architecture, and many registers that enable efficient pipelining. Today, RISC principles dominate mobile computing (ARM), and RISC-V is emerging as the open-source future of processor design.
RISC Design Principles
The Five Key Principles
- Simple instructions, single cycle: Each instruction completes in one clock cycle (in the pipeline), enabling predictable timing and efficient pipelining.
- Fixed-length instruction format: All instructions are exactly 32 bits (4 bytes). This eliminates the complex decode logic needed for variable-length instructions — the CPU always knows where the next instruction starts.
- Load/Store architecture: Only LOAD and STORE instructions access memory. All computation happens between registers. This simplifies the pipeline because only one stage (MEM) needs memory access logic.
- Large register file: 32 or more general-purpose registers reduce the need for memory accesses. More registers mean more operands available without loading from memory.
- Hardwired control unit: Simple instructions do not need microcode — pure combinational logic generates control signals, which is faster than microprogrammed approaches.
Architecture Comparison
Three simple instructions versus one complex instruction. But the RISC versions pipeline perfectly — you can start a new instruction every cycle.
The MIPS Architecture (Classic RISC Example)
Register File
| $zero ($0) | Always zero $t0-$t9: Temporaries |
| $at ($1) | Assembler temp $s0-$s7: Saved registers |
| $v0-$v1 | Return values $k0-$k1: OS kernel |
| $a0-$a3 | Arguments $gp: Global pointer |
| $sp | Stack pointer $fp: Frame pointer |
| $ra | Return address |
| Total | 32 registers × 32 bits |
Three Instruction Formats (All 32-bit)
| R-type (Register) | [opcode:6][rs:5][rt:5][rd:5][shamt:5][funct:6] |
| Used for | ADD, SUB, AND, OR, SLT, etc. |
| I-type (Immediate) | [opcode:6][rs:5][rt:5][immediate:16] |
| Used for | ADDI, LW, SW, BEQ, BNE, etc. |
| J-type (Jump) | [opcode:6][address:26] |
| Used for | J, JAL |
This uniform format means the hardware always knows: bits 31-26 are the opcode, bits 25-21 are the first register, etc. Decode is trivial compared to x86's variable-length chaos.
Pipeline-Friendly Design
Why RISC Pipelines Efficiently
| Stage | IF ID EX MEM WB |
| Clock 1 | I1 |
| Clock 2 | I2 I1 |
| Clock 3 | I3 I2 I1 |
| Clock 4 | I4 I3 I2 I1 |
| Clock 5 | I5 I4 I3 I2 I1 |
| Throughput | 1 instruction per cycle (steady state) |
RISC enables this because:
- Fixed-length instructions → IF stage always fetches exactly 4 bytes
- Regular format → ID stage always reads the same register fields
- Load/store separation → Only MEM stage accesses data memory
- Simple operations → EX stage completes in one cycle
- No complex instructions → No multi-cycle operations blocking the pipeline
CISC Pipeline Problems (Solved by RISC)
| Problem in CISC | RISC Solution |
|---|---|
| Variable decode time | Fixed 32-bit format |
| Memory in any instruction | Only LW/SW use MEM stage |
| Multi-cycle instructions | All instructions single-cycle |
| Complex control signals | Simple hardwired decode |
| Few registers (spill to memory) | 32+ registers |
Register Windows (SPARC Innovation)
The SPARC processor introduced register windows for fast function calls:
| │ Globals (shared) | g0-g7 │ |
| │ Window for Function A | │ |
| │ ins | i0-i7 (parameters from caller) │ |
| │ locals | l0-l7 (private to this function) │ |
| │ outs | o0-o7 (parameters to callee) │ |
| │ Window for Function B | (overlaps with A) │ |
| │ ins | i0-i7 = A's outs (parameter passing!)│ |
| │ locals | l0-l7 │ |
| │ outs | o0-o7 │ |
When calling a function, the hardware rotates the register window — the caller's "out" registers become the callee's "in" registers automatically. No memory access needed for parameter passing! This eliminates stack operations for most function calls.
RISC-V: The Modern Open RISC
RISC-V (2010, UC Berkeley) is a free, open-source ISA gaining massive traction:
- Clean design without legacy baggage
- Modular: base integer ISA (RV32I/RV64I) + optional extensions (M=multiply, A=atomic, F=float, D=double, V=vector)
- No patents or licensing fees
- Used in: education, embedded systems, and increasingly in commercial chips
Why RISC-V Matters
| Proprietary ISAs | Open ISA: |
| ARM | License fee RISC-V → Free |
| x86 | Intel/AMD only RISC-V → Anyone can implement |
| MIPS | Declining RISC-V → Growing rapidly |
Performance Analysis: RISC vs CISC
The performance equation: Time = IC × CPI × Clock_period
| Factor | RISC | CISC |
|---|---|---|
| IC (Instruction Count) | Higher (more instructions needed) | Lower (fewer, complex instructions) |
| CPI | Lower (~1.0 with pipelining) | Higher (2-5 typical) |
| Clock Period | Shorter (simple logic) | Longer (complex decode) |
RISC wins because CPI × Clock improvements more than compensate for higher IC. A RISC processor executing 1.3× more instructions at 1.0 CPI and 1.5× faster clock outperforms a CISC processor with fewer instructions at 3.0 CPI.
Real-World RISC Processors
| Processor | Architecture | Use |
|---|---|---|
| ARM Cortex-A78 | ARMv8 RISC | Smartphones, laptops |
| Apple M3 | ARM-based custom | Mac laptops/desktops |
| MIPS R4000 | MIPS64 | Routers, embedded (legacy) |
| RISC-V (SiFive) | RISC-V | IoT, custom silicon |
| IBM POWER10 | POWER ISA | Servers, supercomputers |
Key Takeaways
- RISC achieves high performance through simplicity — simple instructions that pipeline efficiently, not powerful individual instructions
- Load/store architecture isolates memory access to one pipeline stage, avoiding structural hazards
- Fixed-length instructions make fetch and decode trivial — no variable-length parsing needed
- Large register files reduce memory traffic — keeping data in registers avoids slow memory accesses
- Hardwired control is faster than microcode because there is no extra interpretation layer
- Modern RISC (ARM, RISC-V) dominates mobile and is expanding into servers/desktops, proving that energy efficiency is increasingly more important than raw instruction complexity
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for RISC Architecture.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Computer Organization & Architecture topic.
Search Terms
computer-organization, computer organization & architecture, computer, organization, advanced, architecture, risc, risc architecture
Related Computer Organization & Architecture Topics