{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ECE15A-Homework1-Winter2014 (1)

# ECE15A-Homework1-Winter2014 (1) - ECE15AHomework#1...

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

ECE 15A ­ Homework #1 Winter 2014 1. Do the following conversion problems: (5p) (a) Convert decimal 19.2225 to binary. Assume that the integral and fractional parts of the number can use 8 bits each. Integral: 19/2 = 9+1 9/2 = 4+1 4/2 = 2+0 2/2 = 1+0 1/2 = 0+1 10011 00010011 Fractional: .2225*2 =0+.445 .445*2 =0+.89 .89*2 =1+.78 .78*2 =1+.56 .56*2 =1+.12 .12*2 =0+.24 .24*2 =0+.48 .48*2 =0+.98 .00111000 Answer: 00010011.00111000 (5p) (b) Calculate the binary equivalent of 1/17 up to 8 places. Then convert from binary to decimal. How close is the result to 1/17? Fraction to Binary: 1/17*2 =0+2/17 2/17*2 =0+4/17 4/17*2 =0+8/17 8/17*2 =0+16/17 16/17*2 =1+15/17 15/17*2 =1+13/17 13/17*2 =1+9/17 9/17*2 =1+1/17 .00001111 Binary to Decimal: 0(1/2)+0(1/4)+0(1/8)+0(1/16)+1(1/32)+1(1/64)+1(1/128)+1(1/256) = 0.05859375 Comparison:

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

View Full Document
1/17 = 0.0588235294117647 repeating .00001111 = 0.05859375 % Error Calculation: |0.0588235294117647 ­ 0.05859375| / |0.0588235294117647| approx 0.390625 % error or 0.00022977941 absolute difference 2. A computer has a word length of 8 bits, including sign. Obtain 1’s and 2’s complement of the following binary numbers: (2p) (a) 10101010 1’s complement 01010101 (flip) = 1+4+16+64 = ­85 2’s complement 01010101 + 1 (flip+1) = 01010110 = 2+4+16+64 = ­86 (2p) (b) 01010011 01010011 = 1+2+16+64 = 83 = (2p) (c) 00000001 00000001 = 1 = 1 (2p) (d) 10000000 01111111 (flip)
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 7

ECE15A-Homework1-Winter2014 (1) - ECE15AHomework#1...

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

View Full Document
Ask a homework question - tutors are online