{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

prelim1_sp04sol

# prelim1_sp04sol - NETID NAME SIGNATURE ECE 314 Prelim Exam...

This preview shows pages 1–6. Sign up to view the full content.

NETID______________________________ Page 1 of 12 NAME:_____________________________ SIGNATURE:________________________ ECE 314 Prelim Exam March 18, 2004 Normal academic integrity rules apply. Answers

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

View Full Document
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
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

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

View Full Document
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 01 10 11 0x4000F000 EF BE AD DE 0x4000F004 FE CA EF BE 0x4000F008 CE FA ED FE 0x4000F00C DE C0 EF BE Table 3: Little-Endian Memory. Table 1: Register File \$6 0x4000F000 \$7 0xDEADBEEF \$8 0xBEEFCAFE \$9 0xFEEDFACE \$10 0xDEADC0DE
NETID______________________________ Page 5 of 12 Q.3. Combinational Logic Given a 3-bit input number (x 2 x 1 x 0 ), implement the following combinational logic that

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 12

prelim1_sp04sol - NETID NAME SIGNATURE ECE 314 Prelim Exam...

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

View Full Document
Ask a homework question - tutors are online