samfinsol - Final Exam Review Solutions March 16, 2010...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Final Exam Review Solutions March 16, 2010 Binary Number Systems Question 1 Show the operation of 10 + ( 5) in 6-bit ones complement. First, we convert the absolute values of the operands to 6-bit binary numbers: 10 10 = 001010 2 5 10 = 000101 2 Now we need to negate the numbers. In ones complement, we negate a number by flipping its bits: 10 10 = 110101 5 10 = 111010 Now we add our two numbers: 110101 + 111010 101111 We also have a carry out of 1. We add this carry out back in to our sum: 101111 + 1 110000 You should verify that this is the ones complement of 15, as expected. Question 2 Define n-digit complements for base 10. Using your definition, show the arith- metic of x + y , where x = 216 10 and y = 65 10 , in a 6-digit system in base 10. The appropriate complements are nines and tens complements. We define both and show the arithmetic for each system. 1 To begin with, well define nines complement in analogy to ones comple- ment. Recall that ones complement for binary (base 2) numbers was defined as x 2 n 1 x, where n is the number of digits. So we define nines complement as x 10 n 1 x, again where n is the number of digits. (Youll see where the nines bit comes in soon.) We now convert our operands to 6-digit nines complement: 216 10 10 6 1 216 = 999999 216 = 999783 65 10 65 And we add up the operands: 999783 + 65 999848 Note there is no carry out; if there were, it would have to be added back in to the sum, just as in ones complement. You should verify that the answer is 151 i nines complement. Now we define tens complement in analogy to twos complement. Recall that twos complement for binary (base 2) numbers was defined as x 2 n x, where n is the number of digits. So we define tens complement as x 10 n x, again where n is the number of digits. (Note that the tens complement is just the nines complement plus one! Note also that this is exactly the case for twos complement, which is just ones complement plus one.) Again, we convert our operands to 6-digit tens complement: 216 10 10 6 216 = 1000000 216 = 999784 65 10 65 And, once again, we add the operands: 999784 + 65 999849 There is no carry out this time, either, but if there were, just as in twos com- plement, we would not need to do anything special; its enough to keep only the last six digits of the answer. You should verify that the answer is 151 in tens complement. 2 Question 3 Define n-digit complements for base 8. Using your definition, show the arith- metic of x y , where x = 120 8 and y = 27 8 , in a 6-digit system in base 8....
View Full Document

This note was uploaded on 06/12/2011 for the course CS 1 taught by Professor Staff during the Fall '08 term at Cornell University (Engineering School).

Page1 / 11

samfinsol - Final Exam Review Solutions March 16, 2010...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online