New version page

Penn CIS 240 - CIS 240 HOMEWORK

Upgrade to remove ads

This preview shows page 1-2 out of 7 pages.

Save
View Full Document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience

Upgrade to remove ads
Unformatted text preview:

Name: 1CSE 240 Autumn 2004Due: Fri. 17 September 2004Intro. to Computer Architecture Homework 1Write your answers on these pages. Additional pages may be attached (with staple) if necessary. Please ensure thatyour answers are legible. Please show your work. Write your name at the top of each page. Due at the beginning ofclass. Total points: 66.1. [12 Points] Conversion.(a) Convert the binary number 00100101 to decimal.(b) Convert the decimal number 21 to an 8-bit unsigned binary representation.(c) Convert the 8-bit 2’s complement binary number 11011010 to decimal.2(d) Convert the decimal number -111 to an 8-bit 2’s complement binary representation.(e) Convert the 8-bit unsigned binary number 11010010 to hexadecimal.(f) Convert the unsigned hexadecimal number 29 to unsigned 8-bit binary.Name: 32. [12 Points] Binary Arithmetic and Logical Operations. Let A = 00100101 and B = 11111011 be 2’s comple-ment integers. Compute the following. Assume a fixed width of 8 bits (i.e., your answers must be 8 bits). Pleaseshow your work.(a) A + B(b) A OR B(c) A AND B(d) B − A(e) A − B(f) A + B + 143. [6 Points] Logical Operations. Complete the following truth tables.(a)A A A OR A A AND A0 10 1(b)A B C (A OR B) AND C (A AND C) OR (B AND C)0 0 00 0 10 1 00 1 11 0 01 0 11 1 01 1 1(c)A B (A AND B) (A OR B)0 00 11 01 1Name: 54. [6 Points] Floating Point.(a) Give an example of a number that has a 32-bit floating point representation (as in Figure 2.2 in the text-book) and cannot be represented as a 32-bit 2’s complement integer. Explain why this number cannot berepresented as an integer.(b) Give an example of a number that can be represented as a 32-bit 2’s complement integer but cannot berepresented exactly as a 32-bit floating point. Explain why this number cannot be represented as a floatingpoint.5. [8 Points] Limitations of Fixed-Width Arithmetic. Consider the following 8-bit 2’s complement numbers:A = 01111111, B = 00000101, and C = 10001011. Assume that only 8 bits are available to represent values.Show your work.(a) Evaluate A + B. Give your answer as an 8-bit 2’s complement number. Convert this number to decimal.Why doesn’t this represent the sum of A and B?(b) Evaluate C − A. Give your answer as an 8-bit 2’s complement number. Convert this number to decimal.Why doesn’t this represent the difference of C and A?66. [10 Points] Bits Are Bits! Consider the following sequence of 16 bits: 1100 0110 0011 0001. These bits can beinterpreted in many different ways.(a) If we interpret these bits as a 16-bit unsigned binary integer, what is the decimal value represented by thebit sequence?(b) If we interpret these bits as a 16-bit 2’s complement integer, what is the decimal value represented by thebit sequence?(c) If we interpret the low-order 8 bits as an ASCII character (see Appendix E in your textbook), what is thischaracter?(d) If we interpret these bits as a floating point number, what is the decimal value represented by the bitsequence. Assume that the floating point representation devotes 1 bit to the sign, 5 bits to the exponent,and 10 bits to the fraction (similar Figure 2.2 in your textbook).(e) If we interpret these bits as an Red-Green-Blue (RGB) color, what is the color represented by the bitsequence? Assume the high-order bit is always 1, the next 5 bits represent red, the next 5 bit representgreen, and the low-order 5 bits represent blue.Name: 77. [No Points] Last and Most Important Question! This question is compulsory. Give us your feedback.(a) How many hours did you spend on this assignment?(b) On a scale of 1-5, how difficult did you find this assignment? (1-easiest, 5- most difficult)(c) Do you have any other comments on your experience completing this assignment? What are


View Full Document
Download CIS 240 HOMEWORK
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view CIS 240 HOMEWORK and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view CIS 240 HOMEWORK 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?