In this short course we study the basic concept of the principle of computer architecture. In these lecture slides the key points are:Example Implementation, Symbolic Language, Legal Combinations, Memory Operations, Actual Microprogram, Meanings of Registers, Loop of Interpreter, Instruction Interpreter, Increasing Speed, Speed of Execution
Download Example Implementation - Principles of Computer Architecture - Lecture Slides and more Slides Advanced Computer Architecture in PDF only on Docsity!
An Example Implementation
In principle, we could describe the control store in
binary, 36 bits per word.
We will use a simple symbolic language to make it
easier to understand.
The language will describe what happens at each clock cycle, rather than being a higher level language.
To copy something from one register to another, we will use an assignment statement: MDR = SP
To indicate a more complicated operation than passing through the B bus: MDR = H + SP
An Example Implementation
We must use only legal combinations in the assignment statement (e.g. no H = H - MDR).
We can assign the result to multiple registers, so we can also write: SP = MDR = SP + 1
To indicate memory reads and writes of 4-byte data words, we will just put rd and wr in the microinstruction.
Fetching a byte through the 1-byte port is indicated by fetch.
Assignments and memory operations can occur in the same cycle. This is indicated by writing them on the same line.
An Example Implementation
Remember that each microinstruction must
explicitly supply the address of the next
microinstruction.
To ease the programmer’s job, the microassembler normally assigns an address to each microinstruction (not necessarily consecutive in the control store) and fills in the NEXT_ADDRESS field so that microinstructions written on consecutive lines are executed consecutively.
Sometimes, however, the programmer wants to branch away unconditionally: goto label.
An Example Implementation
To do a conditional branch, we can use the Z and N flip- flops: Z = TOS tests the TOS register to see if it is zero.
We can then do: Z = TOS; if (Z) goto L1; else goto L
Note that L2 must be exactly 256 more than L1 (the previous instruction causes Z to be ORed into the high- order bit of MPC).
To use the JMPC bit: goto (MBR OR value). This tells the microassembler to use value for NEXT_ADDRESS and set the JMPC bit so that MBR is ORed into MPC with NEXT_ADDRESS.
An Example Implementation
MBR is a 1-byte register that holds the bytes of the instruction stream as they come in to be executed.
At the beginning and end of each instruction, TOS contains the value of SP. For some instructions, POP for example, more work is necessary.
The OPC register is a temporary register.
The main loop of the interpreter begins on the
line labeled MAIN1 and is a single
microinstruction.
An Example Implementation
Control store addresses corresponding to opcodes
must be reserved for the first word of the
corresponding instruction interpreter.
Assume that MBR contains 0x60 (IADD). The main
loop must:
Increment the PC, leaving it containing the address of the first byte after the opcode.
Initiate a fetch of the next byte into MBR.
Perform a multiway branch to the address contained in MBR at the start of Main1. This address is the opcode currently being executed.
The Microprogram
The Microprogram
The Microprogram
Increasing the Speed
In general, we trade off speed versus cost. A faster
implementation requires more hardware
complexity.
There are three basic approaches for increasing
the speed of execution:
Reduce the number of clock cycles needed to execute an instruction.
Simplify the organization so that the clock cycle can be shorter.
Overlap the execution of instructions.
Increasing the Speed
Increasing the Speed
As another speed increase, notice that for every
instruction the following operations may occur:
The PC is passed through the ALU and incremented
The PC is used to fetch the next byte in the instruction stream.
Operands are read from memory.
Operands are written to memory.
The ALU does a computation and the results are stored back.
We can free up the ALU by introducing an IFU
( Instruction Fetch Unit ).
The Mic-
• The Mic-2, shown on the next slide
Incorporates the Instruction Fetch Unit (IFU)
This results in changed (smaller) microprogram to implement IJVM (at the expense of more hardware) for the IFU (which is implemented in hardware)