# hw5solns - CMPS 10 - Homework Assignment 5 Problems:...

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

CMPS 10 - Homework Assignment 5 Problems: Chapter 4 (p.184): 8abc, 9abcd, 15abcd, 17, 18, 19, 20, 22, 23, 24 8.) Assume that our computer stores decimal numbers using 16 bits – 10 bits for a sign/magnitude mantissa and 6 bits for a sign/magnitude base-2 exponent. (This is exactly the same representation used in the text.) Show the internal representation of the following decimal quantities. a.) +7.5 b.) -20.25 c.) -1/64 Solution: Using the steps described in the “Fractional Numbers” section (page 137), we can construct the following table: Decimal Binary Normalized +/- Mantissa +/- Exp. +7.5 +111.1 +0.1111 x 2 3 0 111100000 0 00011 -20.25 -10100.01 -0.1010001 x 2 5 1 101000100 0 00101 -1/64 -0.000001 -0.1 x 2 -5 1 100000000 1 00101 Each fractional number is represented by: [sign of mantissa (1)][mantissa (9)][sign of exponent (1)][exponent (5)], where the number in parentheses represents the number of bits used for each component. Therefore, from the chart above, we find the following answers: a.) 0111100000000011 b.) 1101000100000101 c.) 1100000000100101 9.) Using the ASCII code set given in Figure 4.3, s how the internal binary representation for the following character strings. a.) AbC c.) \$25.00 b.) Mike d.) ( a+b ) Solution: To answer this problem, we simply look up the appropriate values in Figure 4.3 (page 141). Spaces are used to break up the individual characters below. a.) 01000001 01100010 01000011 b.) 01001101 01101001 01101011 01100101 c.) 00100100 00110010 00110101 00101110 00110000 00110000 d.) 00101000 01100001 00101011 01100010 00101001

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

View Full Document
15.) Assume that a = 1, b = 2, and c = 2. What is the value of each of the following Boolean expressions? a.)
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 09/15/2011 for the course CMPS 10 taught by Professor Tantalo during the Fall '08 term at University of California, Santa Cruz.

### Page1 / 6

hw5solns - CMPS 10 - Homework Assignment 5 Problems:...

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

View Full Document
Ask a homework question - tutors are online