HW03 Binary Numbers
================================================================================
These are some simple exercises. Review Appendix A and B (pages 669, 681 in 5th edition) or any online resource to learn a technique that suits you to make this conversion. Do not fool yourself by short-cutting the answers to this homework. A can assure you that I care even less about the actual results. However, this type of exercise will be on your exam sheet. If you don't practice this simple conversions now, I doubt that you will find a better time in the years to come to learn this simple tricks.
1. Convert the following numbers to binary: (a)1984, (b)4000, (c)8192.
6. Most people can only count to 10 on their fingers; however, computer scientists can do better. If you regard each finger as one binary bit, with finger extended as 1 and finger touching palm as 0, how high can you count using both hands? With both hands and both feet? Now use both hands and both feet, with the big toe on your left foot as a sign bit for two’s complement numbers. What is the range of expressible numbers?
7. Perform the following calculations on 8-bit two’s complement numbers.
(a) 00101101 + 01101111
(b) 11111111 + 11111111
(c) 00000000 − 11111111
(d) 11110111 − 11110111
8. Repeat the calculation of the preceding problem but now in one’s complement.
9. Consider the following addition problems for 3-bit binary numbers in two’s complement. For each sum, state
i. Whether the sign bit of the result is 1.
ii. Whether the low-order 3 bits are 0.
iii. Whether an overflow occurred.
(a) 000 + 001
(b) 000 + 111
(c) 111 + 110
(d) 100 + 111
(e) 100 + 100
10. Signed decimal numbers consisting of n digits can be represented in n + 1 digits without a sign. Positive numbers have 0 as the leftmost digit. Negative numbers are formed by subtracting each digit from 9. Thus the negative of 014725 is 985274. Such numbers are called nine’s complement numbers and are analogous to one’s complement binary numbers. Express the following as three-digit nine’s complement numbers:
(a) 6, (b) −2, (c) 100, (d) −14, (e) −1, 0.
11. Determine the rule for addition of nine’s complement numbers and then perform the following additions.
(a) 0001 + 9999
(b) 0001 + 9998
(c) 9997 + 9996
(d) 9241+ 0802
14. Multiply 0111 and 0011 in binary.
22. Convert the following binary numbers to decimal 001100, 000011, 011100, 111100, 111111
23. Convert the following binary numbers (fixed point) to their decimal equivalents 11100.001, 110011.10011,
101010101010.1
24. Convert the following decimal numbers to their binary equivalents 64, 128, 256, 100, 111, 145, 255
25. Convert the following decimal numbers to their binary equivalents: 34.75, 25.25, 27.1875