The CPU execute assembler instructions in the following manner:
|
These steps are called the instruction execution cycle -- I wrote them out in greater details, but the steps are essentially the same as what you learned in CS255
The CPU perform these steps over and over and over again.... These steps are called the "instruction execution cycle".
Here is the CS255 material on the instruction execution cycle in case you forgot: click here
|
|
Address Micro instruction at this address
======= ==================================
0 00000000110000000000000000000000
1 00000001010100000110000000000000
2 ... and so on ...
Needless to say that I will drive many students crazy if I am gonna explain this micro-program in "bit" form to you.
And yet, I have to present the micro-program to you to complete your understanding of the computer.
Fortunately, you knows assembler programming from CS255 and in CS255, you have learned to use mnemonic to represent binary computer instructions.
We will use the same technique to make the discussion of the micro-program easier to follow.
As you know, a micro-instruction instruct the datapath to perform some operation.
We have seen for example, that the micro-instruction:
00000000 00010101 00100001 00000000
instructs to simple datapath to add R1 and R2 together and
store the sum in register R5:
If you don't see it, here is the break down of the instruction:
0 00 00 00 0 0 0 0 1 0101 0010 0001 00000000
AMux Cond ALU Shf MBR MAR RD WR ENC C B A next addr
The net effect of this micro-instruction is:
R5 := R1 + R2;
and this notation is a lot
"easier" to comprehend.
We will use the following nmemonic to denote micro-instructions:
[dest := src1 [OP src2];] ... [lshift;|rshift;] [rd|wr;] [MAR;] [MBR;]
[[if COND] goto ADDRESS;]
|
Explaination:
|
Note:
|
Binary: (32 bits)
00000000 00010101 00100001 00000000
or: (tagged by its function name)
0 00 00 00 0 0 0 0 1 0101 0010 0001 00000000
AMux Cond ALU Shf MBR MAR RD WR ENC C B A next addr
|
is transcribed to the micro assembler instruction:
R5 := R1 + R2
|
Binary:
00010001 10100000 00100001 00000000
or:
0 00 10 00 1 1 0 1 0 0000 0010 0001 00000000
AMux Cond ALU Shf MBR MAR RD WR ENC C B A next addr
|
is transcribed to the micro assembler instruction:
mar := r2; mbr := r1; wr;
|
In plain English: it instructs the datapath to copy register R2 to MAR, copy register R1 to MBR and start a memory WRITE operation.
BTW: You have seen this instruction before and in case you don't recall this instruction: click here .