Question 5 of 6: Memory-Hierarchy Access Time, RPN-to-Infix, and Control-Unit Styles
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Notes on this paper
98-Comp-A3, Computer Architecture — National Exams, May 2016. Closed-book, 3 hours; six questions of equal value (20 marks each); FIVE constitute a complete exam (all six answered below as a complete study resource).
Reference texts: Patterson & Hennessy, Computer Organization and Design, 6th ed. — memory hierarchy & cache design (Q1a, Q2a, Q3a, Q5a), bus/data-transfer performance (Q1c), instruction-level parallelism (Q2c), instruction encoding & RISC/CISC tradeoffs (Q3b, Q4c), IEEE-754 floating point and memory technology (Q4a–b), branch prediction and addressing modes (Q6a–b); Mano & Ciletti, Digital Design, 6th ed. — control-unit design (Q1b, Q5c–d), unsigned binary division hardware (Q3c), reverse-Polish/stack notation (Q5b), and shift operations (Q6c); Stallings, Data and Computer Communications — programmed vs. interrupt-driven I/O (Q2b).
Question 5: Memory-Hierarchy Access Time, RPN-to-Infix, and Control-Unit Styles (20 marks)
Check: the top-level access time in Q5(a) is ambiguous; the only reading consistent with a clean numeric answer is 5 ns, adopted here.
Check: the operator between E and F in Q5(b)(2) is a plain "$+$" (identical to the "+" in Q5(b)(1)), so the string is read here as ABCDE+F/+G-H/*+.
Given. (a) A two-level hierarchy with overall average access time 12 ns, top-level hit rate 90%, top-level access time 5 ns. (b) Two postfix (RPN) expressions over operands $A$–$H$. (c) The two families of control-unit implementation. (d) The general concept of microprogramming.
Find. (a) The lower level's access time. (b) The equivalent infix expression for each RPN string. (c) Pros/cons of hardwired vs. micro-programmed control. (d) Three applications of microprogramming.
Approach. (a) apply the average-memory-access-time (AMAT) model, $\text{AMAT}=T_{hit}+(1-H)\times T_{\text{lower}}$, and solve for the unknown; (b) evaluate each postfix string with a stack, popping the two most-recently-pushed values as (left, right) operands for each operator encountered; (c)–(d) contrast the two control-unit design philosophies and their use cases.
Part (a) — lower-level access time. The standard two-level AMAT model charges the top-level access time on every reference, plus the lower level's access time only on the fraction of references that miss the top level:
$$\text{AMAT}=T_{\text{top}}+(1-H)\times T_{\text{lower}}$$
Substituting $\text{AMAT}=12$ ns, $T_{\text{top}}=5$ ns, $H=0.90$:
$$12=5+(1-0.90)\times T_{\text{lower}}\ \Rightarrow\ 7=0.10\times T_{\text{lower}}\ \Rightarrow\ T_{\text{lower}}=\boxed{70\ \text{ns}}$$
Part (b) — reverse Polish to infix. Reading each postfix string left to right with a stack, each operator pops its two most-recent operands (the more recently pushed value is the RIGHT operand) and pushes the resulting sub-expression back onto the stack.
Part (c) — hardwired vs. micro-programmed control unit.Hardwired control implements the control-signal sequencing directly in combinational/sequential logic (state machines, PLAs). Advantages: very fast (no memory-fetch step to retrieve each control word) and no extra control-store hardware. Disadvantages: the logic is fixed at fabrication time — adding, changing, or fixing an instruction's control sequence requires a hardware redesign, and the design/verification effort grows quickly with instruction-set complexity. Micro-programmed control stores each instruction's control-signal sequence as a series of micro-instructions in a control store (ROM/writable control store), fetched and stepped through by a micro-sequencer. Advantages: far easier to design, debug, and modify (changing behaviour is a control-store rewrite, not a re-fabrication) and naturally supports a large, complex, or even user-extensible instruction set. Disadvantages: slower, since every control word must first be fetched from the control store before it can drive the datapath, and the control store itself adds cost/area. Hardwired trades design flexibility for raw speed; micro-programmed trades some speed for flexibility, easier design, and support for complex ISAs.
Part (d) — three applications of microprogramming.
Emulation: microprogramming lets one hardware platform implement the instruction set of a DIFFERENT machine, by writing microcode that interprets the target ISA's instructions in terms of the host's native micro-operations — used historically to let new machines run software written for an older, discontinued line.
Instruction-set extension / customization: new or specialized instructions (e.g. complex string, decimal-arithmetic, or application-specific operations) can be added by writing new microcode routines rather than redesigning hardware, letting a single hardware base support several ISA variants or be patched after fabrication.
Bug fixes and errata correction (microcode patching): a design flaw or incorrect control sequence discovered after a CPU ships can often be corrected by loading a revised microcode image (e.g. via a writable/reloadable control store or firmware update) instead of a costly silicon respin — the mechanism behind many modern CPU "microcode updates."
All three exploit the same property: because micro-programmed control is DATA (a stored sequence of micro-instructions) rather than fixed logic, it can be authored, extended, or corrected in software long after the hardware is built.
Final results — Question 5
Part
Result
(a) lower-level access time
$\boxed{70\ \text{ns}}$
(b)(1) infix
$A \div (B\times C\times(D+E))$
(b)(2) infix
$A+B\times\dfrac{(C+(D+E)/F)-G}{H}$
(c) hardwired vs. micro-programmed
Hardwired: fast, inflexible. Micro-programmed: slower (control-store fetch), flexible/easy to modify
(d) microprogramming uses
Emulation, ISA extension/customization, microcode bug-fix patching