Assign1_Soln2007

Assign1_Soln2007 - Introduction to Computer Engineering...

Info iconThis preview shows pages 1–5. 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

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: Introduction to Computer Engineering I (ECSE-221) Assignment 1 Solutions, Fall 2007 Q1 . Convert the following integers into their numerical equivalents in the indicated bases (X refers to your answer, the subscript indicates the base). Be sure to use the correct number of significant figures for each case and show how the correct number of significant figures was obtained. Show all your work. (10 points) (a) 659 10 (2 points) (i) X 2 659 / 2 = 329 remainder 1 329 / 2 = 164 remainder 1 164 / 2 = 82 remainder 0 82 / 2 = 41 remainder 0 41 / 2 = 20 remainder 1 20 / 2 = 10 remainder 0 10 / 2 = 5 remainder 0 5 / 2 = 2 remainder 1 2 / 2 = 1 remainder 0 1 / 2 = 0 remainder 1 Reversing the remainders, we get the answer: 1010010011 2 (ii) X 16 We can simply group the digits of the above answer in groups of 4: 0010 1001 0011 And convert directly to hexadecimal: 0010 = 2 1001 = 9 0011 = 3 So, 001010010011 2 = 293 16 (b) 1011 0010 1111 2 (3 points) (i) X 16 Simply group the digits in fours, and convert directly = 1011 0010 1111 = B 2 F = B2F 16 (ii) X 10 Could convert directly from the binary, but it's easier to use the base-16 result, since it's an exact representation of the base-2 number. = (B * 16 2 ) + (2 * 16 1 ) + (F * 16 ) = (11 * 256) + (2 * 16) + (15 * 1) = 2816 + 32 + 15 = 2863 10 (iii) X 3 Start with the base10 answer from (ii): 2863 10 Now, simply divide by 3 repeatedly: 2863 / 3 = 954 remainder 1 954 / 3 = 318 remainder 0 318 / 3 = 106 remainder 0 106 / 3 = 35 remainder 1 35 / 3 = 11 remainder 2 11 / 3 = 3 remainder 2 3 / 3 = 1 remainder 0 1 / 3 = 0 remainder 1 Reverse the remainders, and the answer is 10221001 3 (c) D95.4B7 16 (5 points) (i) X 2 Each base-16 digit converts to exactly 4 base-2 digits: D 9 5. 4 B 7 1101 1001 0101. 0100 1011 0111 So, the answer is 110110010101.010010110111 2 (ii) X 10 How many digits do we need after the decimal point? #digits 10 = #digits 16 * log (16) log (10) = 3 * 1.2041... = 3.6123... So, rounding up, we need 4 digits after the decimal point = (D * 16 2 ) + (9 * 16 1 ) + (5 * 16 ) + (4 * 16-1 ) + (B * 16-2 ) + (7 * 16-3 ) = (13*256)+(9*16)+(5*1)+(4*0.0625)+(11*.00390625)+(7*.000244140625) = 3328 + 144 + 5 + 0.25 + 0.04296875 + 0.001708984375 = 3477.294678.... Rounding to 4 digits, we get: = 3477.2947 10 Q2 . What is the maximum and minimum number in the range of a 6-digit number for each of the following cases? Express all numerical answers in both the original base and its decimal (base- 10) equivalent. For each case, also express the total number (in base-10) of distinct numbers that can be represented by the number scheme. Show all your work. (10 points) (a) binary (2's complement) (3 points) max: 011111 2 = 2 5-1 = 32-1 = 31 10 min: 100000 2 = -2 5 = - 32 10 Since each unique bit pattern represents a distinct number, there are 64 distinct numbers that can be represented (31 positive numbers, 32 negative numbers, and zero)....
View Full Document

This note was uploaded on 03/18/2011 for the course ECSE 221 taught by Professor F.pferrie during the Fall '09 term at McGill.

Page1 / 13

Assign1_Soln2007 - Introduction to Computer Engineering...

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