Midterm Exam
Part of
material for 22C:122/55:132, Spring 2003

Note: This is an openbook, opennotes exam. Please write your answers in the exam booklet supplied. Leave blank lines between your answers to different questions, and leave a margin down the side of each page. Please write your name in the form it appears on your university ID card; write your name in the blank provided on the front cover. This exam is worth 20 points and has 10 parts! Allocate about 5 minutes per part.
General Background: Several problems on this exam refer to the proposed alternative to the VAX instruction set that was distributed as a source of study questions. You should have a copy of the exam study questions handy during this exam!
___ ________ ___ _________ _________ _________ _________ __________________________________________________  r  rmux  c  next0  next1  next2  next3 
Part a) What aspects of this microinstruction format resemble horizontal microcode? (2.0 points)
Part b) What aspects of this microinstruction format resemble vertical microcode? (2.0 points)
Part c) Is the microengine that executes this microcode closer to the Moore or Mealy formalism? (2.0 points)
_ A B B  _______ Bsel __________________\ 0 1 / Bdis ___________________\disab/ SN74157 _________ \___/  _____  ______ ____ _________  nand   adder ____ Cin ______ ___________ SN7400 ___ ___ SN7483 _______ Rsel _________\ 0 1 / 0__\disab/ SN74157 \___/  R
Problem: This ALU has 4 function select inputs; therefore, it supports up to 16 possible operations; some are useless. Complete the 16row table of operations, listing the headings on the operation select columns in the order Rsel Bdis Bsel Cin. (3.0 points).
Assume that the program counter is one of the machine's 15 general purpose registers, so that the RMA PC loads any computed branch address to the program counter.
In addition, assume that the COND c instruction causes the next 8bit instruction to be skipped if the condition c holds, where c is a 4bit field specifying one of 16 tests on the condition codes.
Part a) What sequence of instructions for this fictional machine comes close to the equivalent of a PCrelative branch with an 8bit displacement? (Hint: it takes something like 3 or 4 primitive instructions to do this.) (2.0 points)
Part b) If you wanted to take your sequence of instructions from part a and modify it to become a conditional branch, where would you insert the COND instruction? (2.0 points)
Part a) Give a sequence of instructions for our proposed machine that does a postincrement autoincrement load of an operand relative to some register R. (2.0 points)
Part b) Explain why your answer to part a will not work when R is the program counter. (2.0 points)
Question: Criticize the above provocative statement! (As written, the statement is not intended to be either true or false, but rather, to be sufficiently problematic to inspire an answer that might resemble a short essay.) (3.0 points)