Home

Suggestion Box

CPSC 418: Midterm Solution


Problem 1 (5 Points)

List 3 of the 5 highest performance microprocessors currently being sold. Be sure to list both the company and the model. (For example Zilog Z80, Motorola 68010, and Inmos T90)
  1. MIPS R10000
  2. DEC AXP-21164
  3. Intel P6
  4. DEC AXP-21064
  5. Sun UltraSparc

Problem 2 (10 Points)

Subproblem 2(a) (5 Points)

Briefly support or refute the statement that `the number of instructions is one of the most important differences between CISC and RISC architectures'.

Refute: The complexity of instructions is the most important difference. The number of instructions in the ISA is a side-affect of this. Similarly, number of instructions in a program trace is also an effect of the complexity of the instructions in the ISA.

Subproblem 2(b) (5 Points)

List two of the most important differences between CISC and RISC architectures.
  1. RISC
    load/store style of architecture
    CISC
    architectures allow arithmetic instructions to have operands in memory or registers.
  2. RISC
    fixed length instructions
    CISC
    variable length instructions

Problem 3 (10 Points)

Subproblem 3(a) (7 Points)

Given a computer with four interrupt levels (IL0 -- IL3), assign interrupt/trap levels to the following devices/routines:
Keyboard IL1
Reset/Reboot Button IL3
Disk Drive IL2
Network Interface IL2
Mouse IL1
Memory Allocation IL2
Note: IL0 is for user processes, all interrupts happen at at least IL1.

Subproblem 3(b) (3 Points)

Is there any device or O/S routine that should be at a higher interrupt level than the highest level you used above? Justify your answer.

No, the reboot button should shut the machine down regardless of what it is currently doing.

However, several students gave suggestions, such as putting a routine to save state at a higher level of interrupt so that a dump could be made when the system crashes. This reasoning is correct, but if your system is really screwed up, it may not be capable of running even this sort of program, so this may not be a useful feature.


Problem 4 (10 Points)

To keep up with the market (\ie other companies), system performance needs to double every two years. You are considering a design improvement that will increase performance by 19% but delay the release date of a system by six months.

In terms of the performance of the system with respect to other machines that will be on the market when it will be released, is it better to release the system on its current schedule, or to add the improvement and move back the release by six months?

A 19% improvement means performance will be 1.19 times current performance.

If 2^(6/24) > 1.19, then performance improvement will not keep up with the average improvements in the market.

2^(6/24) = 1.189, or roughly the same as what the market will have.

Those who said that the decision doesn't matter received 14 out of 15 points. But a number of students gave additional reasons, such as economic advantages in getting a product to market early, that led them to conclude that releasing the product early was a better choice. Valid reasons along these lines received 15 points.


Problem 5 (10 Points)

The function f has the following parameters, where `constant or variable' says whether assignments to the parameter within f also effect the parameter in main (e.g. variable = var in Pascal or & in C).

Using the Feldman and Retter (F&R) conventions, say whether a copy of the parameter must be made before calling f, specify what exactly is passed and where it is passed.

inputs
name const/var type copy? how pass location
AS const array of strings Y Address R0
I1 const integer N Value R1
F1 const float N Value F0
I2 var integer N Address R2
AI var array of integers N Address R3
F2 var float N Address R4
result
R array of integers N Address R0


Problem 6 (15 Points)

List the events, in the order that they happen, that occur when a user hits a key on the keyboard. Your list should contain at least ten items.
  1. Key pressed
  2. Keyboard sets Intr[1] high
  3. CPU flushes pipeline, saves state (PC, SP, Status, etc)
  4. CPU sets IL[1] hi
  5. CPU sets Intr_Ack[1] hi
  6. Keyboard puts interrupt vector on address bus
  7. CPU sets PC to M[intr_vec + intr_table_base]
  8. Keyboard routine saves all registers it modifies
  9. Keyboard routine executes
  10. gets key from keyboard using memory-mapped I/O: ASCII value of key put on databus
  11. Keyboard routine executes
  12. Keyboard routine restores registers
  13. RFI
  14. Restore state (PC, SP, Status, etc)
At any time the above process could be interrupted by a higher level interrupt, at which time it would stop, the higher-interrupt would proceed, and the keyboard-handling code would resume when the higher-interrupt was finished.

Problem 7 (20 Points)

Given two microprocessors, Rabbit and Turtle, and the following data:
CPU Rabbit Turtle
Clock speed 300MHz 100MHz
ICache size 16Kb 8Kb
DCache size 16Kb 8Kb
Number of inst issue units 2 4
Avg number of instructions issued per cycle 1.17 3.25
Number of instructions per trace 1.1*(#Inst_T) (#Inst_T)
Number of transistors 9.3*(10^6) 7.5*(10^6)

Subproblem 7(a) (5 Points)

What are the CPIs of Rabbit and Turtle?

CPI = cycles per instruction
IPC = instructions per cycle
CPI = 1/IPC

CPI_Rabbit
= 1/1.17
= 0.855

CPI_Turtle
= 1/3.25
= 0.308

Subproblem 7(b) (15 Points)

Which CPU is faster and how much faster is it?

Time = (#Inst)*(CPI)*(Clock)

Time_Rabbit
= 1.1*(#Inst_T)*(0.855)*(1/(300E+6))
= 3.14*(10^-9)

Time_Turtle
= (#Inst_T)*(0.308)*(1/(100E+6))
= 3.08*(10^-9)

Turtle is faster.

%Faster:
= (Time_Rabbit - Time_Turtle)/Time_Turtle
= (3.14*(10^-9) - 3.08*(10^-9) ) / 3.08*(10^-9)
= 1.8%


Problem 8 (20 Points)

One of the differences between Feldman and Retter's instruction set architecture and more conventional ones is that F&R use word addressing and not byte addressing.

In C, if p is a pointer to an element in some array, p++ increments p so that its value is the address of the next element in the array.

Subproblem 8(a) (6 Points)

Write the F&R assembly code for p++ when p points to a 32-bit integer. Document your code.

; assume that R3 holds address of p
LADDx R3, 1, R3

Subproblem 8(b) (6 Points)

Write the F&R assembly code for p++ when p points to an 8-bit byte. Document your code.

; p is a *byte
; byte addressing uses indexed addressing mode
; assume that (R3,R4) is address of p
; so, access *p using (R3,R4)
LADDx R4, 1, R4

Subproblem 8(c) (4 Points)

List two advantages and two disadvantages of word addressing.
Advantage
Guarantees alignment of data
Advantage
Larger address space
Disadvantage
Byte pointer operations require two registers and are more complex
Disadvantage
Pointer arithmetic, comparison more difficult
Disadvantage
Very different from other architectures, makes software porting more difficult
Note: Doing a byte load/store is just as easy with word addressing as with byte addressing. Also, pointer arithmetic with words is just as easy.

Subproblem 8(d) (4 Points)

Do you think word addressing is better than byte addressing? Justify your answer.

Note: This question was marked based on how well you defended your point in terms of the issues you raised in the previous question. In particular I was looking for something like: `X is better than Y, because the advantage A of X is more important than the disadvantage B.'

My opinion:

Byte addressing is better than word addressing because, as was demonstrated in homework and in this test, some very common operations are more difficult to do with word addressing than with byte addressing. In particular, the nasty pointer arithmetic that is possible in C becomes very difficult to implement safely word addressing. While the lack of alignment problems is a nice feature, the difficulty in porting code to this architecture will probably prevent many programs from embracing it.

Home

Suggestion Box
Last modified: 27 Feb 96