Lab 4
MIC-1 SIMULATOR - MICROPROGRAM LEVEL INTERPRETER
Write an object-oriented program in C++ or Java that will properly
simulate the microprogram and assembly language operation of the
hypothetical Mic-1 computer as defined in chapter #4 of the Tanenbaum
text (3rd Edition). See Xerox copies and online help)
The program will be graded in several phases:
- Part a: decode microinstruction
- Part b: implement scratch pad register
- Part c: (final version).
Check out www.tjhsst.edu/~dhyatt/arch for more information about:
- Description of the Mic-1 hardware and control store
("The MIC-1 Computer").
- The hexadecimal code for the complete control store
("Microcode for the Mic-1 Control Store")
PART A: Decode a 32-bit control store microinstruction. Read a line
from the file of the control store's 32-bit microinstructions
and parse the instruction into the 13 fields of Fig. 4-9.
- Example 1: Line 17 (a := inv(mbr))would output:
AMUX = 1
COND = 0
ALU =3
SH = 0 YOU
MBR = 0 should
MAR = 0 be using
RD = 0 CLASSES
WR = 0 so you can fit all the
ENC = 1 Mic-1 parts together
C = 10
A, B, Address don't matter
- Example 2: Line 19 (tir = lshift(tir); if n goto 25) would output:
AMUX = 0
COND = 1
ALU = 2
SH = 2
MBR =0
MAR = 0
RD = 0
WR = 0
ENC = 1
C = 4
B = xx
A = 4
ADDRESS = 25
PART B: Set up the 16 scratch pad registers, Fig. 4-8 in your packet,
so that a microcode instruction (32-bit) "runs through" the
registers. Print out the contents of the registers "before"
and "after".
For example:
Hard code these registers: pc = 4
ac = 5
sp = 2
ir = 0
tir = 8
amask = 4095
a = 10
mar = 0
mbr = 15
Accept the line number of the microcode you are checking and put this in
a loop so the effect of register changes is cumulative.
Microcode lines to check are
#16 ac = 6
#18 ac = 16
#4 tir = 16
#17 a = -16
#56 mar = 2
sp = 3
#61 mar = 3
mbr = 16
The registers will contain the values as shown if you check the lines
in the order shown.
PART C: Interpret an entire Mac-1 Assembly language program (a program
of 16-bit macroinstructions) by the Mic-1 control store (32-bits).
|