Monday, August 3rd - PowerPoint PPT Presentation

1 / 30
About This Presentation
Title:

Monday, August 3rd

Description:

Calculator and one 4x6 notecard permitted. No sharing. Quiz #3. 25% MASM ... Give a Java statement that could have produced the following IJVM code: ILOAD j. ILOAD k ... – PowerPoint PPT presentation

Number of Views:145
Avg rating:3.0/5.0
Slides: 31
Provided by: paul313
Category:

less

Transcript and Presenter's Notes

Title: Monday, August 3rd


1
Monday, August 3rd
  • Program 4
  • Due Friday, August 15th

2
Quiz 3
  • Thursday, February 28, in class
  • Multiple-choice and short-answer
  • Covers
  • Tanenbaum
  • chapters 3.1 3.4, 4.1 4.2
  • Lectures 12 - 15
  • Homework 2
  • Program 3
  • Calculator and one 4x6 notecard permitted
  • No sharing

3
Quiz 3
  • 25 MASM
  • system stack, parameter passing
  • boolean instructions
  • 75 circuits and micro-architecture (diagrams and
    instruction sets will be given)
  • Gates, circuits
  • Boolean functions/identities, truth tables
  • Buses
  • Memory hierarchy
  • Peripheral devices
  • Mic-1, IJVM
  • Micro-instructions

4
Today's topics
  • IJVM
  • Homework 2 (solutions will be posted)

5
(No Transcript)
6
IJVM
  • "Integer" Java Virtual Machine
  • Forms basis for an assembly language
  • Add directives, labels, etc., to make a
    "complete" language
  • Implements the Mic-1 Instruction Set Architecture
    (ISA)

7
IJVM instruction set
8
Mic-1 architecture
The data path
9
Complete block diagram for Mic-1
10
Components of example MIR
  • Addr address of next micro-instruction
  • JAM jump address "management"
  • JMPC conditional jump
  • JMPN "negative"
  • JMPZ "zero"
  • Note N Z P ("positive")
  • ALU ALU and Shifter function selector
  • C selects registers to write from C bus
  • Mem selects memory function
  • read, write, fetch
  • B selects register to read onto B bus

11
  • Complete instruction set for the Mic-1
    architecture.
  • Any of these may be extended by appending
  • ltlt8 (SLL8) to shift the result left by one byte.
  • e.g., H MBR ltlt 8
  • gt1 (SRA1) to shift the result right by one bit.
  • e.g., H MBR gt1
  • rd or wr or fetch
  • e.g., DESTSOURCErd
  • goto label
  • e.g., DESTSOURCEgoto iadd2

12
Mic-1 ISA
  • Each "mnemonic" is a subprogram made of
    micro-instructions i.e., a micro-program
  • Each micro-program is hard-wired as a circuit
  • Note that all microprograms end with
  • goto Main1
  • which fetches the next instruction.
  • Here is the complete set of IJVM micro-programs

13
(No Transcript)
14
(No Transcript)
15
(No Transcript)
16
(No Transcript)
17
(No Transcript)
18
Addenda
  • rd means to copy the contents of the memory
    location whose address is in MAR destination is
    MDR
  • wr means to copy the contents of MDR
    destination is the memory location whose address
    is in MAR
  • goto means set the micro-program counter (MPC)
    to the specified address in the control store.

19
Virtual registers
  • Z and N
  • virtual registers status bits that get set by
    the ALU.
  • Any operation that uses the ALU will set / clear
    the Z bit and the N bit
  • Examples
  • N OPC if (N) goto T else goto F
  • Z OPC if (Z) goto T else goto F

20
Virtual registers
  • Z ltsourcegt means
  • test the value in source
  • set the Z status to 1 if the test result is zero
  • set the Z status to 0 if the test result is not
    zero
  • IF (Z) ltcommandgt means
  • do the command if the Z status is 1.
  • N ltsourcegt means
  • test the value in source
  • set the N status to 1 if the test result is
    negative
  • set the N status to 0 if the test result is not
    negative
  • IF (N) ltcommandgt means
  • do the command if the N status is 1.

21
  • Questions on IJVM / Mic-1 ?
  • Look at Homework 2

22
Problem 2
  • In the Mic-1, it takes 1 ns to set up the MIR, 1
    ns to gate a register onto the B bus, 3 ns to run
    the ALU and shifter, and 1 ns for the results to
    propagate back to the registers. The clock pulse
    width is 2 ns.
  • a) Can this machine run at 100 MHz?
  • b) Can this machine run at 150 MHz?

23
Problem 3
  • In the Mic-1, the B bus register is encoded in a
    4-bit field, but the C bus is represented as a
    bit-map. Why?

24
Problem 7
  • Do one IJVM translation of the following Java
    statement i j k 4

25
Problem 8
  • Give a Java statement that could have produced
    the following IJVM code
  • ILOAD j
  • ILOAD k
  • ISUB
  • BIPUSH 6
  • ISUB
  • DUP
  • IADD
  • ISTORE i

26
Problem 10
  • In if_cmpeq3 of the microprogram for the
    Mic-1, MDR is copied to H, and then TOS is
    subtracted from it in the next line if_cmpeq3 HM
    DRrd if_cmpeq4 OPCTOS
  • Surely it is better to have just one statement
    here
  • if_cmpeq3 ZMDR-TOSrd
  • Why is this not done?

27
Problems 14, 15
  • 14 a) What is the arithmetic operation
    equivalent to shifting right with a count of 2?
  • 15 a) What is the arithmetic operation
    equivalent to shifting left with a count of 2?

28
  • In the following Mic-1 microprogram, N and Z are
    virtual registers, i.e., they arent really
    registers, but they provide a notation for test
    instructions.
  • mys1 MAR SP SP-1 rd
  • mys2 Z TOS if(Z) goto mys5
  • mys3 Z MDR if(Z)) goto mys5
  • mys4 N TOS if(N) goto mys6 else goto mys8
  • mys5 MDR TOS 0 wr goto main1
  • mys6 MDR -MDR
  • mys7 TOS -TOS
  • mys8 H MDR
  • mys9 TOS TOS-1 if(Z) goto mys11
  • mys10 MDR MDRH goto mys9
  • mys11 TOS MDR wr goto main1
  • a) Assuming that a, and then b have been pushed
    onto the stack. a contains 5, and b contains -3.
    Fill in the instruction number at the top of the
    table, and show all of the changes in the
    specified registers and memory during the
    execution of each instruction.
  • _at_ signifies "memory address of". _at_S means
    memory address of top of stack. ( ) indicate a
    "virtual" register (actually a status bit). ?
    means "undefined" or "doesn't matter".

29
  • What new instruction does the microprogram
    implement? (Its called mys for now, and
    comments are omitted so the problem won't be too
    easy.) Give the instruction an appropriate name
    and description as in figure 4.11 in the
    Tanenbaum textbook.

30
Questions?
  • Program 3 is due Thursday before midnight
  • Quiz 3 Thursday in class
Write a Comment
User Comments (0)
About PowerShow.com