{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

HW2 - (a Memory accesses Move#AVEC R1 1 Move#BVEC R2 1 Load...

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

View Full Document Right Arrow Icon
ECE 662 (Sp 2009) Homework 2 Solutions 1. Problem 2.2 of the textbook. (a) (a) 00101 (b) 00111 (c) 10010 + 01010 + 01101 + 01011 01111 10100 11101 no overow overow no overow (d) 11011 (e) 11101 (f) 10110 + 00111 + 11000 + 10011 00010 10101 01001 no overow no overow overow (b) To subtract the second number, form its 2's-complement and add it to the first number. (a) 00101 (b) 00111 (c) 10010 + 10110 + 10011 + 10101 11011 11010 00111 no overow no overow overow (d) 11011 (e) 11101 (f) 10110 + 11001 + 01000 + 01101 10100 00101 00011 no overow no overow no overow 2. Problem 2.5 of the textbook. Byte contents in hex, starting at location 1000, will be 4A, 6F, 68, 6E, 73, 6F, 6E. The two words at 1000 and 1004 will be 4A6F686E and 736F6EXX. Byte 1007 (shown as XX) is unchanged. (See Section 2.6.3 for hex nota- tion.) 3. Problem 2.10 of the textbook.
Background image of page 1

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

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (a) Memory accesses Move #AVEC, R1 1 Move #BVEC, R2 1 Load N, R3 2 Clear R0 1 LOOP Load (R1)+, R4 2 Load (R2)+, R5 2 Multiply R4, R5 1 Add R5, R0 1 Decrement R3 1 Branch>0 LOOP 1 Store R0, DOTPROD 2 (b) k 1 = 1 + 1 + 2 + 1 + 2 = 7; and k 2 = 2 + 2 + 1 + 1 + 1 + 1 = 8 4. Problem 2.13 of the textbook. (a) 1220, (b) part of the instruction, (c) 5830, (d) 4599, (e) 1200. 5. Problem 3.25 of the textbook. (a) Location $1000 + $3000 = $4000 → $2000 The instruction occupies two bytes. One memory access is needed to fetch the instruction and 4 to execute it. (b) Effective Address = $1000 + $1000 = $2000, $3000 + $1000 = $4000 → D0 4 bytes. 2 accesses to fetch instruction and 2 to execute it. (c) $2000 + $3000 = $5000 → $2000 6 bytes 3 accesses to fetch instruction and 4 to execute it....
View Full Document

{[ snackBarMessage ]}

Page1 / 2

HW2 - (a Memory accesses Move#AVEC R1 1 Move#BVEC R2 1 Load...

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

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