Instruction Set Architecture (ISA)
The Instruction Set Architecture (ISA) is the crucial interface between hardware and software. Think of it as the "language" that a processor understands - it defines what operations the hardware can perform and how software communicates with the processor.
What an ISA Defines
An ISA specifies:
- Instruction Set: All the operations the CPU can perform (add, subtract, load, store, etc.)
- Data Types: What kinds of data can be processed (integers, floating-point, etc.)
- Registers: The programmer-visible storage locations inside the CPU
- Addressing Modes: How memory addresses are calculated
- Memory Architecture: How memory is organized and accessed
ISA as the Hardware-Software Interface
+---------------------------------------------+
| |
| +-------------+ +-------------+ |
| | Software | | Hardware | |
| | (Programs) | | (Circuit) | |
| +------+------+ +------+------+ |
| | | |
| v v |
| +-------------+ +-------------+ |
| | ISA |<-->| ISA | |
| | (Software | | (Hardware | |
| | View) | | View) | |
| +-------------+ +-------------+ |
| |
+---------------------------------------------+
Types of ISAs
There are two main categories of instruction set architectures:
- CISC (Complex Instruction Set Computer): Many complex instructions, variable length
- RISC (Reduced Instruction Set Computer): Few simple instructions, fixed length
We'll explore the RISC vs CISC debate in detail later in this tutorial!
Instruction Format
Instructions are binary patterns that the CPU decodes. A typical instruction format might look like:
Instruction Format Example
+---------------------------------------------+
| Opcode | Register 1 | Register 2 | Immediate |
| (6 bits)| (5 bits) | (5 bits) | (16 bits) |
+---------------------------------------------+
Example: ADD R1, R2, #5
Opcode: 000001 (ADD operation)
R1: 00001 (destination register)
R2: 00010 (first source register)
Immediate: 0000000000000101 (value 5)
Why ISA Matters
The ISA is what allows different implementations of the same architecture. For example, Intel and AMD both implement the x86 ISA but with different microarchitectures. Software compiled for x86 runs on both! This separation of interface from implementation is what makes computer architecture so powerful and flexible.