03 - Instruction Set Architecture Design
03 - Instruction Set Architecture Design
Francesco Menichelli
francesco.menichelli@uniroma1.it
Instruction Set Architecture (ISA)
The instruction set architecture is concerned
with:
– Organization of programmable storage (memory &
registers):
Includes the amount of addressable memory and number of available
registers.
– Data Types & Data Structures: Encodings &
representations.
– Instruction Set: What operations are specified.
– Instruction formats and encoding.
– Modes of addressing and accessing data items and
instructions
– Exception conditions.
Computer Instruction Sets
• Regardless of computer type, CPU structure, or
hardware organization, every machine instruction
must specify the following:
– Opcode: Which operation to perform. Example: add, load,
and branch.
– Where to find the operand or operands, if any: Operands
may be contained in CPU registers, main memory, or I/O
ports.
– Where to put the result, if there is a result: May be
explicitly mentioned or implicit in the opcode.
– Where to find the next instruction: Without any explicit
branches, the instruction to execute is the next instruction
in the sequence or a specified address in case of jump or
branch instructions.
Operation Types in The Instruction Set
Operator Type Examples
Fixed Length Encoding: MIPS, PowerPC, SPARC (all instructions are 4 bytes each)
• Memory‐To‐Memory Machines:
– Operands obtained from memory and results stored back
in memory by any instruction that requires operands.
– No local CPU registers are used in the CPU datapath.
– Include:
• The 4-Address ISA.
• The 3‐Address ISA.
• The 2‐Address ISA.
• Memory Indirect
– Memory cell pointed to by address field contains the
address of (pointer to) the operand
EA = (A) ; Look in A, find address (A) and look there for operand
e.g. ADD (A)
Add contents of cell pointed to by contents of A to accumulator
– May be nested, multilevel, cascaded
e.g. EA = (((A)))
– Multiple memory accesses to find operand
– Very slow
Addressing Modes for Branch Instructions
• How to specify target address of branch
instructions/procedure calls?
– Direct addressing: unconditional branches (gotos).
• Generated from conditionals and loops.
– Register indirect addressing or indexed mode.
• Program may compute target address (computed goto, switch).
– PC‐relative addressing: indexed mode where PC acts as
register.
• Target address is specified as offset to current instruction.
• Harvard architecture
• data SRAM (1-4Kbyte)
• Two stage pipeline (fetch,
execute)
• 16-bit instruction set (16-bit
instruction memory)
• 16-bit memory addressing
(linear)
• 8-bit integer ALU (two
independent operands)
• 32 data registers (8-bit)
• RAM Stack (stack pointer)
ATMEL AVR8 architecture
• AVR CPU general purpose working registers
Microchip PIC32 architecture
• MIPS32 M4K (MIPS Technologies)
• Harvard architecture (cache
level)
• data SRAM (128-256Kbyte)
• five stage pipeline
• 32-bit instruction set (32-bit
wide data memory)
• 128-bit wide program
memory+prefetch
• 32-bit memory addressing
(linear)
• 32-bit integer ALU (two
independent operands+result)
• 32 data registers (32-bit)
• RAM Stack (stack pointer)
STM32 architecture
• ARM Cortex-M4 (ARM Holdings plc): ARMv7E-M architecture