








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









University of Michigan EECS 373 Fall 2001
a. 2 15 – 1 b. 216 – 1 c. 215 d. 216 e. None of the above
a. 2 b. 4 c. 6 d. Depends on the value in the register r4. e. Depends on the value stored at the effective address.
I. lwzu r3, 4(r4) II. and. r3, r2, r III. cmpwi r3, 100 IV. bdnzt eq, target
a. I b. I and II c. III and IV d. IV e. None
Questions 6—9 refer to the following simple program.
.data .align 2 .equ size, 4 .equ max, 42 stuff: .word 9, 1, 4, 27, 42, 2, 6, 78, 11, 28, 19, 22 iter: .skip 1 .text .align 2 _start: lis r2, stuff@h ori r2, r2, stuff@l li r3, size li r4, max loop: lwz r5, 0(r2) # Loop while value read cmp r4, r5 # from memory <= max blt exit add r2, r2, r b loop exit: b exit
a. before the text section (i.e., at a lower address). b. after the text section. c. at the same address as the text section. d. There is not enough information given to answer this question.
a. loading the least-significant byte of the array into r2. b. loading the least-significant word of the array into r2. c. loading the address of the array into r2. d. loading the most-significant byte of the array into r2. e. loading the most-significant word of the array into r2.
stuff: .byte 9, -1, 4, 27, -42, 2, 6, 78, 11, 28, 19, 22
Indicate which of the following changes are absolutely necessary for the program to work correctly:
I. Change the first .align 2 to .align 0 so the array elements will be byte-aligned. II. Change size from 4 to 1. III. Change lwz to lba to sign-extend the bytes. IV. Change lwz to lbz and add code to sign-extend the bytes. V. Change cmp to cmpl so that the program performs a signed comparison.
a. I, II, and IV b. II and III c. II and IV d. II, III, and V e. II, IV, and V
cmp 4, r4, r
Indicate which of the following branch instructions could replace the existing blt instruction and allow the program to function correctly:
I. bc 12, 4, exit II. bc 12, 16, exit III. bc 4, 4, exit IV. bc 4, 17, exit
a. I b. II c. III d. II or IV e. IV
I. lha r3, 0(r4) addi r3, r3, 1 sth r3, 0(r4)
II. lhz r3, 0(r4) addi r3, r3, 1 sth r3, 0(r4)
III. lhax r3, r4, r addi r3, r3, 1 sthx r3, r4, r
IV. lhzx r3, r4, r addi r3, r3, 1 sthx r3, r4, r
a. I b. II c. I and III d. II and IV e. All of the above
a. Address bus, TSIZE[0:1], read/write* (logic low), TS* _b. Address bus, TSIZE[0:1], read/write (logic high), TS_** c. Address bus, data bus, read/write* (logic high), TS* d. Address bus, TSIZE[0:1], data bus, read/write* (logic high), TS* e. None of the above
_a. TA_* b. TA, read/write (logic low), c. TA, read/write (logic low), data bus d. read/write* (logic low), data bus e. None of the above
a. TS* and the rising edge of the bus clock b. TA* and the falling edge of the bus clock _c. TA and the rising edge of the bus clock_* d. TA* e. None of the above
a. Address bus, TSIZE[0:1] b. Address bus, data bus, TSIZE[0:1] c. Address bus, data bus d. Address bus, TA* e. None of the above
For Questions 19—21, assume you are using an MPC823 hooked up to the memory hardware you designed in Lab 4. The memory will function as in the macros in the lab assignment. These macros are given in Figures 1 and 2 below.
32 x 8 bit
32 x 8 bit
32 x 8 bit
32 x 8 bit
Din[24:31]
Din[16:23]
Din[8:15]
Din[0:7] Din[0:31]
8 bit tri state buffer (BUFE8)
8 bit tri state buffer (BUFE8)
8 bit tri state buffer (BUFE8)
8 bit tri state buffer (BUFE8)
Dout[24:31] A[0:4]
Dout[16:23]
Dout[8:15]
Dout[0:7] Dout[0:31]
enable logic
enable logic
enable logic
enable logic
wr_byte
wr_byte
wr_byte
wr_byte Module Enable (^) enable logic
128 Byte Mac ro
Mem_Read
Figure 1: 128-byte macro
128 byte m acro
128 byte macro
size control logic
Din[0:31] Dout[0:31]
A[6:31]
A[?:?]
A[?:?]
A[?:?] wr_byte0-
wr_byte0-
TSIZ TSIZ MEM_W RITE
MEM_READ
A? (^) Enable
Enable
A[0-4]
A[0-4]
25 6 Byte Me m o ry
Figure 2: 256-byte macro.
Register Contents Memory location Contents
r3 0x3000004 0x300000 0x r4 0xDEAD 0x300004 0x0059FF 0x300008 0x00ADBEEF
If you perform the instruction sth r4, 3 (r3) , which of the following will appear on the Logic Analyzer for the instruction?
Transaction 1 Transaction 2
Address Data TSIZE Address Data TSIZE
a. 0x300007 0x0000DEAD 10 No Second Transaction b. 0x300007 0xAD0000DE 10 No Second Transaction c. 0x300007 0x0000000DE 01 0x300008 0xAD000000 01 d. 0x300007 0xDEDE00DE 01 0x300008 0xAD000000 01 e. 0x300007 0x0059FFDE 01 0x300008 0xADADBEEF 01
For Questions 22—25, assume your are still using a hardware design like the one in Figures 1 and 2, but now with a new processor that is exactly like the MPC823 except for one modification: We have added the ability for triple-byte transactions. To do this, we modified the functionality of TSIZE. The new tables are given below:
Read Cycle Data Bus Table
Size TSIZE [0:1] A30 A31 D0-D7 D8-D15 D16-D23 D24-D 0 1 0 0 OP0 - - - 0 1 0 1 - OP1 - - Byte 0 1 1 0 - - OP2 - 0 1 1 1 - - - OP Half- 1 0 0 0 OP0 OP1 - - Word 1 0 1 0 - - OP2 OP Triple- 1 1 0 0 OP0 OP1 OP2 - Byte 1 1 0 1 - OP1 OP2 OP Word 0 0 0 0 OP0 OP1 OP2 OP
Write Cycle Data Bus Table
Size TSIZE [0:1] A30 A31 D0-D7 D8-D15 D16-D23 D24-D 0 1 0 0 OP0 - - - 0 1 0 1 OP1 OP1 - - Byte 0 1 1 0 OP2 - OP2 -
0 1 1 1 OP3 OP3 - OP Half- 1 0 0 0 OP0 OP1 - - Word 1 0 1 0 OP2 OP3 OP2 OP Triple- 1 1 0 0 OP0 OP1 OP2 - Byte (^1 1 0 1) - OP1 OP2 OP Word 0 0 0 0 OP0 OP1 OP2 OP
a. 1 b. 2 c. 3 d. 4 e. None of the above
a. 1 b. 2 c. 3 d. 4 e. None of the above
a. 0 b. 1 c. 2 d. 3 e. None of the above
a. Only the write decode hardware. b. Only the read decode hardware. c. Both the write and read control hardware. d. Nothing needs to be changed.