Sei sulla pagina 1di 2

CS-212 Quiz-4 - Solution Computer Organization & A.L.

CS-212 - Computer Organization & A.L

Quiz 4 - SOLUTION, 9th October, 2018 (Fall Semester 2018-19)

Total Marks: 10 Time Allowed: 20 min Roll No. ______________________

Question 1: Convert the following MIPS Assembly Language Instructions into Binary Machine Language
instructions and then express them in Hex format. Label various fields of the binary instructions.
(2.5+2.5 = 5 marks)
Note:
 Constants of immediate instructions are in Hex format (0x00..)
 Shift amount is in Decimal Format
 Offset of Data Transfer Instructions is in Decimal Format

a) lbu $a2, 26172($t6)

Instruction in Binary Format with Labels: (I-Type)

Op-Code Rs Rt Immediate
100100 01110 00110 0110 0110 0011 1100

Instruction represented in Hex: 0x91c6663c

b) sltu $v0, $s7, $a3


Instruction in Binary Format with Labels: (R-Type)

Op-Code Rs Rt Rd shamt funct


000000 10111 00111 00010 00000 101011

Instruction represented in Hex: 0x02e7102b

GCWUS CS Fall Semester 2018-19 Page 1 of 2


CS-212 Quiz-4 - Solution Computer Organization & A.L.

Question 2: Convert the following instructions given in Hex format into Binary Machine Language
instructions and then into MIPS Assembly Language instructions. Label various fields of the binary version.
(2.5+2.5 = 5 marks)
Note:
 Mention constants of immediate instructions in Hex format (0x00..)
 Mention Shift amount in Decimal Format
 Mention Offset of Data Transfer Instructions in Decimal Format

a) 0xa2837ffc
Instruction in Binary Format with Labels: (I-Type)

Op-Code Rs Rt Immediate
101000 10100 00011 0111 1111 1111 1100

Instruction represented in MIPS Assembly Language: sb $v1, 32764($s4)

b) 0x03200008
Instruction in Binary Format with Labels: (R-Type)

Op-Code Rs Rt Rd shamt funct


000000 11001 00000 00000 00000 001000

Instruction represented in MIPS Assembly Language: jr $t9

GCWUS CS Fall Semester 2018-19 Page 2 of 2

Potrebbero piacerti anche