cs2214exam1ans

cs2214exam1ans - CS2214 COMPUTER ARCHITECTURE &...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS2214 COMPUTER ARCHITECTURE & ORGANIZATION SPRING 2010 EXAM I ANSWERS Polytechnic Institute of NYU Page 1 of 2 Handout No: 11 March 22, 2010 1) a) The table showing the values of registers and memory locations used by the code is as follows : This code sign extends 2-byte data elements stored in memory starting at 10000000. b) The machine language instructions in locations 400304 - 400310 are as follows : 400304 001100 01001 01010 1000 0000 0000 0000 400308 000100 01010 00000 0000 0000 0000 0011 40030C 001111 00000 01011 1111 1111 1111 1111 400310 000000 01011 01001 01001 00000 100101 c) The four instructions sign extend a 2-byte data element in a register. This is the SGNEXT instruction : Syntax : SGNEXT Rt, Rs Semantics : Format, etc. : • It can use the I or R formats since only Rs and Rt are needed needed. If the I format is used, DOImm is not used. Otherwise, Rd is not used. • We make one memory access for the new instruction to fetch it The SGNEXT instruction saves four original instructions. The original code is rewritten with the SGNEXT below : 400000 LW R9, 0(R8) # Load a data element from the memory 400004 SGNEXT
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

cs2214exam1ans - CS2214 COMPUTER ARCHITECTURE &...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online