assign1soln - Introduction to Computer Engineering I...

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

View Full Document Right Arrow Icon
Introduction to Computer Engineering I Assignment 1 Data Representation Due Date: Feb 02, 2009 at 5 PM The assignment is due Monday, February 2 nd , 2009, by 5:00 pm via WebCT. Late assignments will be penalized at 5% per day and no assignments will be accepted after February 4 th , 5:00 pm. Instructions on how to prepare your assignment for electronic submission will be discussed in the tutorials. Part 1 To gain some familiarity with the different representations encountered in Module 1, it is often useful to perform operations and conversions by hand. Q1 . Convert the following integers into their numerical equivalents in the indicated bases. Be sure to use the correct number of significant figures for each case and show how the correct number of significant figures was obtained. (16 points) (a) 291.42 10 (i) X 2 (ii) X 16 (iii) X 5 (iv) X 3 (b) 1001.443 5 (i) X 10 (ii) X 5 (iii) X 2 (iv) X 16 Q2 . What is the decimal (base-10) equivalent value of the following 10 digit numbers. (12 points) (a) 11 1011 1011 i. binary (unsigned: positive integers) ii. binary (sign and magnitude) iii. binary (signed: 2’s complement binary numbers) iv. hexadecimal (positive integers) v. base-6 (6’s complement) (b) 01 1011 1011 i. binary (unsigned: positive integers) ii. binary (sign and magnitude) iii. binary (signed: 2’s complement binary numbers) iv. hexadecimal (positive integers) v. base-6 (6’s complement) (c) 13 5456 1004 i. base-7 positive integers ii. base-10 positive integers 1/21
Background image of page 1

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

View Full DocumentRight Arrow Icon
Q3 . (12 points) (a) Convert the following number to single precision IEEE 754 based on the procedure described in class and in the notes. Express the result in hexadecimal. Show all your work. -1.009 x 10 -15 (b) Convert the following IEEE 754 single precision number to its decimal (base-10) equivalent. Express your answer to 3 decimal (base-10) places c33dfc00 16 (c) Indicate the special cases of IEEE 754. In other words, are there any distinct IEEE 754 representations that represent the same number? Are there are any numbers that do not convert to and from IEEE 754 in the usual way? Part 2 Remaining questions will involve “C” language programming. You are free to use any platform at your disposal as long as it is ANSI compliant. Q4 . (10 points) Write a simple “C” language program that inputs an arbitrary decimal number (subject to the limits of IEEE-754, single precision) and outputs the internal machine representation as an 8-digit hexadecimal number. Use this program to verify the conversion you did by hand in Q3a. To simplify the coding it will not be necessary to check the input, i.e., you may assume the number is properly formatted and in range. Q5 . (10 points) Write another “C” language program that inputs an 8-digit hexadecimal number, representing an IEEE-754 code and outputs the corresponding decimal number. Use this program to verify your result for Q3b. As with Q8, it is not necessary to check the input. Q6
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 21

assign1soln - Introduction to Computer Engineering I...

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