HW_1_soln_mms_1

HW_1_soln_mms_1 - Homework #1Solutions ECE 15a Winter 2010...

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

View Full Document Right Arrow Icon
Homework #1Solutions ECE 15a Winter 2010 1. Do the following conversion problems: (5p) (a) Convert decimal 34.4375 to binary Soln: 34/2 = 17 + 0 17/2 = 8 + 1 8/2 = 4 + 0 4/2 = 2 + 0 2/2 = 1 + 0 1/2 = 0 + 1 (34) 10 = (100010) 2 .4375 x 2 = 0 + .8750 .8750 x 2 = 1 + .7500 .7500 x 2 = 1 + .5000 .5 x 2 = 1 + .0 (.4375) 10 = (.0111) 2 (34.4375) 10 = (100010.0111) 2 (5p) (b) Calculate the binary equivalent of 1/3 out to 8 places. Then convert from binary to decimal. How close is the result to 1/3? 1/3 = 0.333
Background image of page 1

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

View Full DocumentRight Arrow Icon
0.333 x 2 = 0 + 0.666 .666 x 2 = 1 + .332 .332 x 2 = 0 + .664 .664 x 2 = 1 + .328 .328 x 2 = 0 + .656 .656 x 2 = 1 + .312 .312 x 2 = 0 + .614 .614 x 2 = 1 + .228 Binary equivalent of (1/3) 10 = (0.01010101) 2 Binary to decimal: (0.01010101) 2 = (1/4 + 1/16 + 1/64 + 1/256) 10 = 85/256 = (0.33203125) 10 2. A computer has a word length of 8 bits, including sign. Obtain 1’s and 2’s complement of the following binary numbers. This problem may be interpreted in several ways: (1) The given numbers are in sign and magnitude representation, and (2) they are in 1’s or (3) in 2’s complement representation. (1) The given binary numbers are in sign and magnitude representation: 8 bit word (including sign) Base integer 1s Compliment 2s Compliment 1 1101010= -1101010 0 1101010 10010101 10010110 0 1111110= +1111110 0 1111110 01111110 01111110 0 0000001= +0000001 0 0000001 00000001 00000001 1 0000000= -0000000 0 0000000 11111111 00000000 - Base integer is obtained by replacing the sign bit by 0
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.

This note was uploaded on 03/17/2010 for the course ECE 15A taught by Professor M during the Spring '08 term at UCSB.

Page1 / 8

HW_1_soln_mms_1 - Homework #1Solutions ECE 15a Winter 2010...

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