CS计算机代考程序代写 algorithm mips CS 352 Final Exam Name:_______________________

CS 352 Final Exam Name:_______________________

SHOW ALL WORK. Otherwise no points will be awarded.

1. For the MIPS datapath shown below, several lines are marked with “X”. Consider only cut#1 and #3.

For cut#1:
(i) Describe in words the negative consequence of cutting this line relative to the working, unmodified processor.

(ii) MIPS code snippet that will fail:

(iii) Provide a snippet of code that will still work.

For cut#3:

(i) Describe in words the negative consequence of cutting this line relative to the working, unmodified processor.

(ii) MIPS code snippet that will fail:

(iii) Provide a snippet of code that will still work.

An array of 100 integers, with a base address stored in $t0. Describe in a sentence what the following code does:

Answer: ____________________________________________________________________

3. a) Optimize the following K-map (show all minterm groupings):

Identify all EPIs with an asterisk on the K-map shown above.

What is the equivalent sum of minterms (optimized).

F =

Multiply the following binary values using Booth’s algorithm. Assume that the numbers are in 8-biy chunks. 8-bit multiplication (show all bit arithmetic work):

10100010
x 00101110

Show the effects on memory and registers of the following instructions. Suppose a portion of memory contains the following data:

Register $t0 contains 0x10000000 and $s0 contains 0x01234567. Assume each of the following instructions is executed independently of the others, starting with the values given above. Hint: Don’t forget that the MIPS architecture is Big-Endian.

Memory: Address Data

0x10000000 0x12
0x10000001 0x34
0x10000002 0x56
0x10000003 0x78
0x10000004 0x9a
0x10000005 0xbc
0x10000006 0xde
0x10000007 0xf0

(i) lw $t1, 0($t0)

$t1 = 0x

(ii) lw $t2, 4($t0)

$t2 = 0x

(iii) sw $s0, 0($t0) (fill in contents below for your answer)

0x10000000 0x
0x10000001 0x
0x10000002 0x
0x10000003 0x
0x10000004 0x
0x10000005 0x

Question Score

/5
/5
/5
/4
/6

Total
25