CS232 Lecture Notes Instruction Set Architecture Fall 2020
CS232 Lecture Notes Instruction Set Architecture Fall 2020
Overview
- An Instruction Set Architecture (ISA) defines the interface between software and hardware.
Software is converted to machine instructions using software (compiler/interpreter). Then the
instructions are executed using hardware.
- An ISA contains
• the functional definition of storage locations (registers, memory) & operations (add, multiply,
branch, load, store, etc)
• precise description of how to invoke & access them
- ISA does not contain: non-functional aspects
• How operations are implemented
• Which operations are fast and which are slow
• Which operations take more power and which take less
- Instructions are bit-patterns. Hardware interprets as commands.
Stack Architecture
- The operands are put into the stack. Operations take place at the top two locations on the
stack, destroying the operands, and leaving the result on the top of the stack.
- Stack is a block of memory in RAM, but CPU keeps a stack pointer register points to the top
of the stack. Data in stack are first-in last out.
- Two operations, push and pop, have one operand. Push a value at the top of the stack, or
pop the top element of the stack to a destination. Other operations have implicit operands,
which are the top element(s) of the stack. To perform an operation, the operands are pushed
into the stack first. Once performed an operation, its operand(s) are deleted from the stack,
and its result is stored at the top of the stack. Then, it can use pop command to store the
result back to the memory.
- This architecture was used in computers in 1960s.
1
CS232 Lecture Notes Instruction Set Architecture Fall 2020
Accumulator Architecture
- It places one operand in the accumulator and one in memory. The one in the accumulator is
implicit, and the one in the memory is an explicit memory address. The result of ALU is written
back to the accumulator.
- The operand in the accumulator is loaded from memory using the command LOAD, and the
result is stored in memory from accumulator using the command STORE.
- This architecture was used by early computers like IBM 7090. Today, it’s used by some
microprocessor chips, such as some digital signal processors.
- Suppose we want to ask an accumulator architecture machine to
conduct the same operation C = A + B as above.
- Then, to implement the operation in an accumulator architecture,
we need the following steps:
LOAD A # load value at location A from main
memory to ACC
ADD B # fetch the value at location B, add it
with the value at ACC (which is the value A), and
save the result back to ACC
STORE C # store the value at ACC (which is the
result of A + B) to location C
Register-set Architecture
- It’s the dominant architecture used by modern computers.
- Modern CPUs have a number of general-purpose registers (GPRs) for internal storage, at
least 8 and as many as 32.
2
CS232 Lecture Notes Instruction Set Architecture Fall 2020
- This architecture allows fast access to temporary values, permits clever compiler optimization,
but the instructions are longer than the accumulator designs.
- Operations need to specify all the operands explicitly.
- Depending on whether the operands are available in memory or registers, it can be further
classified as register-register, register-memory, and memory-memory.
Register-Register
- The registers are used for storing operands. It’s also called load-store
architecture, as only load and store instructions can have memory
operands.
- Most RISCs (reduced instruction set computers) adopt this architecture.