last updated 11/25/01
loop forever fetch instruction whose address is in PC update the PC decode the instruction fetch operand(s) execute instruction store result end loop
Note the early timing of the PC update
. The PC is always pointing to the next instruction, even at this level of analysis.
Much of the execution of the instruction cycle is accomplished by transferring data between registers and activating ALU or memory circuits.
Two approaches of implementation commonly used are "hard-wiring" and "micro-programming".
The instruction format encodes
The instruction format is specific to each machine. This is why you cannot take program binaries for one machine and run them on different platforms.
Complex machines ("CISC" , e.g., VAX) have a variety of instruction formats for a large number of instructions and instruction groups. This makes decoding more difficult and possibly more time intensive.
RISC's greatly simplify the instruction format for easy and fast decoding, hence the name "reduced instruction set computers"
32 bit words
fixed fields
assume at most one memory reference per instruction as in GAL

0000 - |
halt |
1000 |
- add |
0001 - |
copy |
1001 |
- sub |
0010 - |
load_address |
1010 |
- mult |
0011 - |
trap |
1011 |
- divide |
0100 - |
jump |
1100 |
- and |
0101 - |
compare |
1101 |
- or |
0110 - |
jump.sub |
1110 |
- not |
0111 - |
Return |
1111 |
- rotate |

Size (bits 27-24) 0000 - byte |
Mode codes bit 23 : 0=direct, 1=indirect |
Register codes (bits 19-16) 24 = 16 registers |
RAM address (bits 15-0) Typically displacement offsets, rather than a hard ram addresses, are stored here. |
add.int r4,total copy.int #2,r5 copy.char (r2),r6 divide.int r3,r5 jump label return