COMP 1113 DUE: February 19, 2011
Assignment #5
This is the fifth of approximately 10 graded assignments in the course. You must arrive for class
at 9:00 a.m., Saturday, February 19, 2011, prepared to submit your solutions to these questions.
Students must submit solutions individually, in their own handwriting.
You do not have to show detailed calculations for converting between decimal, hexadecimal and
binary representations on this assignment.
1. Write down the 8-bit unsigned binary, signed magnitude, one’s complement, two’s
complement and excess-128 forms as applicable for each of the following decimal values. Where
a particular form is not possible within 8-bits, make a note of that fact.
(a) 83 (b) –92 (c) -153 (d) 178 (e) 406 (f) 0
(g) 127 (h) –127 (i) –128 (j) 128
2. Form the following sums of unsigned binary numbers. Show “carries” explicitly in your work.
Verify your answers by carrying the same sums out in decimal.
(a) 01110010 + 01011001 (b) 0111 1001 0101 1010 + 0101 1101 1010 1110
3. State what decimal values the following binary numbers represent if you interpret these binary
numbers as either unsigned binary, signed magnitude, one’s complement, two’s complement, or
excess-128 forms:
(a) 0101 1101 (c) 1000 0000 (e) 0000 0000 (g) 0000 0001
(b) 1011 0111 (d) 1111 1111 (f) 1000 0001 (h) 0111 1111
4. Perform each of the following arithmetic operations by converting the given decimal numbers
into 8-bit two’s complement form. Show a check of your binary answers by comparing your
binary result with the result of doing the arithmetic by decimal. In each case, comment explicitly
on whether you’ve detected overflow or not at the binary arithmetic level.
(a) 52 + 28 (b) 112 - 73 (c) -57 - 19 (d) -76 - 83 (e) –108 + 77 (f) 59 + 97
5. Use 16-bit twos-complement binary forms to evaluate the following results. Demonstrate that
your binary results are correct by converting them back to decimal:
(a) 4683 + 15329 (b) 4683 - 15329 (c) 23453 + 19872
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment