CS 304: Computer Organization

Fall 2010

 


Fall 2010  CSCI 304: Computer Organization


(:Course Banner term='Fall 2010' num='Computer Science 304' title='Computer Organization':)

(:Course Header term='Fall 2010' num='Computer Science 304' title='Computer Organization' :)

Homework #4 Solutions

1. Encode each of the following MIPS assembly language instructions and indicate the corresponding MIPS machine code instruction given as a hexadecimal value.

(a) and $t3, $s1, $s2

0x02325824

(b) srlv $a0, $t2, $t3

0x014B2006

(c) slti $v0, $t1, 0x4ECA

0x29224ECA

2. Consider the following MIPS assembly language code segment and provide the MIPS machine code for the branch instruction (bleq).

while:
blez $t0, endwhile
addi $t0, $t0, 1
srl $t3, $t3, 1
mul $t2, $t2, $t0
# This is a count controlled loop.
endwhile:
sw $t2, y
0x19000003

3. Decode each of the following MIPS machine code instructions and indicate the corresponding MIPS assembly language instruction.

(a) 0x02538821

addu $s1, $s2, $s3

(b) 0x0441FF04

bgez $v0, -252
Print -- Recent Changes
Page last modified on September 28, 2010, at 04:20 PM