ps4_sol - Department of Electrical and Computer Engineering...

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

View Full Document Right Arrow Icon
The University of Texas at Austin EE 306, Spring 2008 Problem Set 4 Due: Monday April 14th, before class Instructor: Ramesh Yerraballi TAs: Jasveen Kaur, Nady Obeid. Instructions This problem set should be your individual work. Please remember to put the name of the TA and the time for the discussion section you would like the problem set turned back to you. Show your work. Questions (Prob 5.9) (8 pts, 2 pts each) We would like to have an instruction that does nothing. Many ISAs actually have an opcode devoted to doing nothing. It is usually called NOP, for NO OPERATION. The instruction is fetched, decoded and executed. The execution phase is to do nothing! Which of the following three instructions could be used for NOP and have the program still work correctly? 0001 001 001 1 00000 a. Add R1, R1, #0 => differs from a NOP in that it sets the Condition Codess. 0000 111 000000001 b. BRnzp #1 => Unconditionally branches to one after the next address in the PC. There- fore no, this instruction is not the same as NOP. 0000 000 000000000 c. Branch that is never taken. Yes same as NOP. What does the ADD instruction do that the others do not do? It sets the Condition Codes. 1. ( 12 pts ) The LC-3 does not have an instruction to perform an OR. Write a LC-3 machine language program segment that takes the values in R1 and R2 and stores the OR of the two operands (R1 OR R2) in R3. NOT R1 R1 1001 001 001 111111 NOT R2 R2 1001 010 010 111111 AND R3 R2 R1 0101 011 010 000 001 NOT R3 R3 1001 011 011 111111 2. (Adapted 5.13)
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.

This note was uploaded on 07/03/2008 for the course EE 306 taught by Professor Ambler during the Spring '07 term at University of Texas.

Page1 / 6

ps4_sol - Department of Electrical and Computer Engineering...

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