ch05_complete - F.5 Chapter 5 Solutions 5.1 (a) ADD -...

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

View Full Document Right Arrow Icon
F.5 Chapter 5 Solutions 5.1 (a) ADD - operate - register addressing for destination and source 1 - register or immediate addressing for source 2 (b) JMP - control - register addressing (c) LEA - data movement - immediate addressing (d) NOT - operate - register addressing 5.2 The MDR is 64 bits. The statement does not tell anything about the size of the MAR. 5.3 Sentinel. It is a special element which is not part of the set of allowable inputs and indicates the end of data. 5.4 (a) 8 bits (b) 6 (c) 6 5.5 (a) Addressing mode: mechanism for specifying where an operand is located. (b) An instruction’s operands are located as an immediate value, in a register, or in memory. (c) The 5 are: immediate, register, direct memory address, indirect memory address, base + offset address. An immediate operand is located in the instruction. A register operand is located in a register (R0 - R7). A direct memory address, indirect memory address and base + offset address all refer to operands locate in memory. (d) Add R2, R0, R1 = > register addressing mode. 5.6 (a) 0101 011 010 1 00100 AND R3, R2, #4 (b) 0101 011 010 1 01100 AND R3, R2, #12 (c) 1001 011 010 111111 NOT R3,R2 if zero, no machine is busy. (d) We cannot do this in only one instruction. We’d need to do an AND with 0000 0000 0100 0000, since the state of machine 6 is in bit [6:6]. This is impossible with the 5-bit immediate value. We could use a second instruction to load this value into a register, and then perform the AND. 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 5.7 01111 (decimal 15) 5.8 Increasing the number of registers to 32 will need 5 bits to denote the register number. Now, the minimum number of bits needed for the ADD instruction will be 4 ( for the opcode ) + 3 registers * 5 bits = 19 bits. This cannot fit in the 16-bits allocated for an lc-3 instruction. 5.9 (a) Add R1, R1, #0 = > differs from a NOP in that it sets the CC’s. (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.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This homework help was uploaded on 04/07/2008 for the course ECE 495K taught by Professor Vijaykumar during the Spring '08 term at Purdue.

Page1 / 6

ch05_complete - F.5 Chapter 5 Solutions 5.1 (a) ADD -...

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

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