A Instruction Set Architecture A.1 Instruction set We present a list of instructions typical of a RISC (reduced instruction set computer) machine. In data-movement and control instructions, the addresses may be immediate #X, direct (memory) M, indirect (memory) [M], register r, or register indirect [r] addresses. Data-processing instructions use immediate or register addressing. PC is the programme counter and a <- b indicates that the value of b is placed in a. LOAD a, b a <- b STOR a, b a <- b ADD a, b, c a <- b + c ASH a, b, c a <- (b >>[s] c) LSH a, b, c a <- (b >>[u] c) BR a PC <- a
A Instruction Set Architecture
A.1 Instruction set
We present a list of instructions typical of a RISC (reduced instruction set computer) machine. In data-movement and control instructions, the addresses may be immediate #X, direct (memory) M, indirect (memory) [M], register r, or register indirect [r] addresses. Data-processing instructions use immediate or register addressing. PC is the programme counter and a <- b indicates that the value of b is placed in a.
LOAD a, b a <- b
STOR a, b a <- b
ADD a, b, c a <- b + c
ASH a, b, c a <- (b >>[s] c)
LSH a, b, c a <- (b >>[u] c) BR a PC <- a
SUB |
a, |
b, |
c |
a |
<- |
b |
- c |
BEQ |
a, |
b, |
c |
PC |
<- |
a |
if |
b = |
c |
MUL |
a, |
b, |
c |
a |
<- |
b |
* c |
BNE |
a, |
b, |
c |
PC |
<- |
a |
if |
not |
b = c |
DIV |
a, |
b, |
c |
a |
<- |
b |
/ c |
BLT |
a, |
b, |
c |
PC |
<- |
a |
if |
b < |
c |
AND |
a, |
b, |
c |
a |
<- |
b |
& c |
BGT |
a, |
b, |
c |
PC |
<- |
a |
if |
b > |
c |
OR a, b, c a <- b | c
NOT a, b a <- !b
BLE a, b, c PC <- a if b <= c BGE a, b, c PC <- a if b >= c
Note: Here b >>[s] c denotes the arithmetical shift of b to the right by c positions, and
b >>[u] c denotes the logical shift of b to the right by c positions.
A.2 The pipeline
We will use a five-stage pipeline:
- IF (instruction fetch),
- ID (instruction decode),
- RR (register read),
- EX (execute instruction),
- WB (write back result into register).
- Note that for some instructions (e.g., LOAD r, #X) some of the pipeline stages (e.g., RR) are not
Step by step
Solved in 2 steps