Docsity

Example Implementation - Principles of Computer Architecture - Lecture Slides, Slides of Advanced Computer Architecture

Toggle sidebar
bg1
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
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36

Partial preview of the text

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)
  • Has the new MBR2 16-bit register
  • Allows any register to be used as either operand

(this simplifies the microprogram as well)

Instruction Fetch Unit