hw2 solutions - Su, Andy – Homework 2 – Due: Sep 18...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Su, Andy – Homework 2 – Due: Sep 18 2007, 11:00 pm – Inst: Valvano 1 This print-out should have 26 questions. Multiple-choice questions may continue on the next column or page – find all choices before answering. The due time is Central time. Homework 2 001 (part 1 of 1) 10 points Using the estimation that 2 10 is approxi- mately equal to 10 3 , without using a calcu- lator, estimate the approximate value of 2 22 . Do not give the exact value, but rather give the answer with one significant decimal digit. For example, 2 18 is approximately equal to 300,000. Your answer must be within ± 25%. Correct answer: 4 × 10 6 . Explanation: First rewrite 2 22 as (2 2 ) × (2 20 ). Next, to one significant figure, 2 2 is equal to 4. If 2 10 is about a thousand (1000), then 2 20 is about 1 × 10 6 . So, the answer is 2 22 is about 4 × 10 6 . 002 (part 1 of 2) 10 points Assuming an 8-bit unsigned integer for- mat, what is the decimal value of hexadecimal 0xC2 ? Your answer must be exact. Correct answer: 194 . Explanation: The hexadecimal digit “ C ” has a decimal value of 12. Similarly, the hexadecimal digit “ 2 ” has a decimal value of 2. Hexadecimal numbers are base 16. So, 0xC2 = 16 × 12 + 2 = 194. 003 (part 2 of 2) 10 points Given the decimal number 126, what is its value in unsigned hexadecimal format? 1. 0x7B 2. 0x88 3. None of these 4. 0x80 5. 0x7E correct 6. 0x78 7. 0xA1 8. 0x86 Explanation: To get the most significant digit you divide by 16, which is 7. As a hex digit, 7 is 7. The remainder is used to form the least significant digit, which is 14. As a hex digit, 14 is E. Its binary value is 1111110. 004 (part 1 of 2) 10 points Assuming a 16-bit unsigned integer for- mat, what is the decimal value of hexadecimal 0xB5E4 ? Your answer must be exact. Correct answer: 46564 . Explanation: The hexadecimal digit “ B ” has a decimal value of 11, “ 5 ” has a decimal value of 5, “ E ” has a decimal value of 14, and “ 4 ” has a decimal value of 4. Hexadecimal numbers are base 16. So, 0xB5E4 = 4096 × 11 + 256 × 5 + 16 × 14 + 4 = 46564. 005 (part 2 of 2) 10 points Given the decimal number 23618, what is its value in unsigned hexadecimal format? 1. 0x5DA7 2. 0x5C96 3. 0x5BD9 4. 0x5CD4 5. None of these correct 6. 0x5C43 7. 0x5C5A 8. 0x5C86 Explanation: To convert from unsigned decimal to 16-bit Su, Andy – Homework 2 – Due: Sep 18 2007, 11:00 pm – Inst: Valvano 2 hexadecimal, you divide by 16 three times, keeping both the quotients and remainders as you go. The remainders in reverse order are the hex digits. First, we calculate 23618 /16 = 1476, where the remainder is 2. The hex digit for the remainder 2 is “ 2 ”. Next, you take 1476 /16 = 92 and the remainder is 4. The hex digit for the remainder 4 is “ 4 ”. Then, you take 92 /16 = 5 and the remainder is 12....
View Full Document

This note was uploaded on 04/26/2009 for the course EE 302 taught by Professor Mccann during the Fall '06 term at University of Texas.

Page1 / 5

hw2 solutions - Su, Andy – Homework 2 – Due: Sep 18...

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