prelim1_sp04sol - NETID_ NAME:_ SIGNATURE:_ ECE 314 Prelim...

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

View Full Document Right Arrow Icon
NETID______________________________ Page 1 of 12 NAME:_____________________________ SIGNATURE:________________________ ECE 314 Prelim Exam March 18, 2004 Normal academic integrity rules apply. Answers
Background image of page 1

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

View Full DocumentRight Arrow Icon
NETID______________________________ Page 2 of 12 Question Possible Points Points Earned Number Representation 15 Endian Representation 20 Combinational Logic 20 State Machines & Karnaugh Maps 20 C and MIPS 25 Total 100
Background image of page 2
NETID______________________________ Page 3 of 12 Q.1. Number Representations a) (8 pts) Fill in the blanks Encoding Decimal Value Binary Pattern Hex Pattern 8-bit Sign/Magnitude 145 __ 10010001 ________ 91 8-bit 2’s Complement _______ -23 11101001 ________ E9 8-bit Unsigned _______ 171 __ 10101011 AB 5-bit Sign/Magnitude -9 11001 ________ 19 b) (7 pts) Perform the following calculation in 8-bit 2’s complement. First convert the numbers from decimal to binary representation, and then perform the computation. Report your answer in both binary 8-bit 2’s complement and decimal representations. There will be no partial credit for this problem. (Hint: doing the addition in decimal will NOT work correctly.) (-32) (98) Answer: 8-bit 2’s complement: (3 pts) 0111 1110 Decimal: (4 pts) 126
Background image of page 3

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

View Full DocumentRight Arrow Icon
NETID______________________________ Page 4 of 12 Q2. Machine Endian-ness (20 pts) The following assembly code sequence is executed on two different machines, one of which is big-endian and the other of which is little-endian. The initial content of the register file is the same on both machines and shown in Table 1 . Determine the final state of both the big-endian and little-endian memory. sw $7, 0($6) sh $8, 4($6) srl $8, $8, 16 sh $8, 6($6) sb $9, 8($6) srl $9, $9, 8 sb $9, 9($6) srl $9, $9, 8 sb $9, 10($6) srl $9, $9, 8 sb $9, 11($6) sw $10, 12($6) sh $7, 14($6) a) (10 pts) Contents of the memory on the big-endian machine. 00 01 10 11 0x4000F000 DE AD BE EF 0x4000F004 CA FE BE EF 0x4000F008 CE FA ED FE 0x4000F00C DE AD BE EF Table 2: Big-Endian Memory. b) (10 pts) Contents of the memory on the little-endian machine. 00
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 12

prelim1_sp04sol - NETID_ NAME:_ SIGNATURE:_ ECE 314 Prelim...

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

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