Show all your work. If you do not show your work, you get no credit.
For all the problems that involve conversions to and from decimal, use the multiplication method to convert to decimal, and the division method to convert from decimal. Also, when going from two's complement binary form to decimal, be sure to use `+' and `-' with decimal number.
from page 45, 46, and 48
Begin: +23
Old | Radix | New | Digit |
---|---|---|---|
23 | 2 | 11 | 1 |
11 | 2 | 5 | 1 |
5 | 2 | 2 | 1 |
2 | 2 | 1 | 0 |
1 | 2 | 0 | 1 |
Second: Convert to two's complement form: 000101112C
Next: -120
Old | Radix | New | Digit |
---|---|---|---|
120 | 2 | 60 | 0 |
60 | 2 | 30 | 0 |
30 | 2 | 15 | 0 |
15 | 2 | 7 | 1 |
7 | 2 | 3 | 1 |
3 | 2 | 1 | 1 |
1 | 2 | 0 | 1 |
Fourth: Convert to two's complement form (use algorithm because started
negative):
01111000 -> 10000111 + 00000001 -> 100010002C
Last: Add the two together:
00010111 +10001000 --------- 10011111answer: 100111112C with no overflow; with negative bit set
Begin: -20
Old | Radix | New | Digit |
---|---|---|---|
20 | 2 | 10 | 0 |
10 | 2 | 5 | 0 |
5 | 2 | 2 | 1 |
2 | 2 | 1 | 0 |
1 | 2 | 0 | 1 |
Second: Convert to two's complement form (use algorithm because started
negative):
00010100 -> 11101011 + 00000001 -> 111011002C
Next: -32
Old | Radix | New | Digit |
---|---|---|---|
32 | 2 | 16 | 0 |
16 | 2 | 8 | 0 |
8 | 2 | 4 | 0 |
4 | 2 | 2 | 0 |
2 | 2 | 1 | 0 |
1 | 2 | 0 | 1 |
Fourth: Convert to two's complement form (use algorithm because started
negative):
00100000 -> 11011111 + 00000001 -> 111000002C
Last: Add the two together:
11101100 +11100000 --------- 11001100answer: 110011002C with no overflow; with carry-out; with negative bit set
Begin: -44
Old | Radix | New | Digit |
---|---|---|---|
44 | 2 | 22 | 0 |
22 | 2 | 11 | 0 |
11 | 2 | 5 | 1 |
5 | 2 | 2 | 1 |
2 | 2 | 1 | 0 |
1 | 2 | 0 | 1 |
Second: Convert to two's complement form (use algorithm because started
negative):
00101100 -> 11010011 + 00000001 -> 110101002C
Next: +44
Old | Radix | New | Digit |
---|---|---|---|
44 | 2 | 22 | 0 |
22 | 2 | 11 | 0 |
11 | 2 | 5 | 1 |
5 | 2 | 2 | 1 |
2 | 2 | 1 | 0 |
1 | 2 | 0 | 1 |
Fourth: Convert to two's complement form: 001011002C
Last: Add the two together:
11010100 +00101100 --------- 00000000answer: 000000002C with no overflow; with carry-out; with zero bit set
Begin: +47
Old | Radix | New | Digit |
---|---|---|---|
47 | 2 | 23 | 1 |
23 | 2 | 11 | 1 |
11 | 2 | 5 | 1 |
5 | 2 | 2 | 1 |
2 | 2 | 1 | 0 |
1 | 2 | 0 | 1 |
Second: Convert to two's complement form: 001011112C
Next: -92
Old | Radix | New | Digit |
---|---|---|---|
92 | 2 | 46 | 0 |
46 | 2 | 23 | 0 |
23 | 2 | 11 | 1 |
11 | 2 | 5 | 1 |
5 | 2 | 2 | 1 |
2 | 2 | 1 | 0 |
1 | 2 | 0 | 1 |
Fourth: Convert to two's complement form (use algorithm because started
negative):
01011100 -> 10100011 + 00000001 -> 101001002C
Last: Add the two together:
00101111 +10100100 --------- 11010011answer: 110100112C with no overflow; with negative bit set
Begin: -56
Old | Radix | New | Digit |
---|---|---|---|
56 | 2 | 28 | 0 |
28 | 2 | 14 | 0 |
14 | 2 | 7 | 0 |
7 | 2 | 3 | 1 |
3 | 2 | 1 | 1 |
1 | 2 | 0 | 1 |
Second: Convert to two's complement form (use algorithm because started
negative):
00111000 -> 11000111 + 00000001 -> 110010002C
Next: -72
Old | Radix | New | Digit |
---|---|---|---|
72 | 2 | 36 | 0 |
36 | 2 | 18 | 0 |
18 | 2 | 9 | 0 |
9 | 2 | 4 | 1 |
4 | 2 | 2 | 0 |
2 | 2 | 1 | 0 |
1 | 2 | 0 | 1 |
Fourth: Convert to two's complement form (use algorithm because started
negative):
01001000-> 10110111 + 00000001 -> 101110002C
Last: Add the two together:
11001000 +10111000 --------- 10000000answer: 100000002C with no overflow; with a carry-out; with negative bit set
1) to decimal:
First: convert from 2C form: 00000010 + 00000001 -> 000000112
Second: use mult. method table:
Old | Digit | New | Radix |
---|---|---|---|
0 | 0 | 0 | 2 |
0 | 0 | 0 | 2 |
0 | 0 | 0 | 2 |
0 | 0 | 0 | 2 |
0 | 0 | 0 | 2 |
0 | 0 | 0 | 2 |
0 | 0 | 0 | 2 |
0 | 1 | 1 | 2 |
2 | 1 | 3 |
Third: remember that the 2C form has a 1 in the MSB, final answer: -310
2) go from decimal to hex:
First: use division table to get digits:
Old | Radix | New | Digit |
---|---|---|---|
3 | 16 | 0 | 3 |
Second: Convert to two's complement form because starting with negative number:
0 3 f-0 f-3 --- --- f c + 0 1 --- --- f d
answer: fd16
Begin: Largest 16 bit Positive number in 2C: 0111111111111111
Second: convert to hexadecimal:
0111 1111 1111 1111 7 f f f
answer: 7fff16
Next: Convert from hexadecimal to decimal:
Old | Digit | New | Radix |
---|---|---|---|
0 | 7 | 7 | 16 |
112 | f | 127 | 16 |
2032 | f | 2047 | 16 |
32752 | f | 32767 |
answer: Began with positive 2C binary number so: +3276710
Begin: Largest 16 bit Negative number in 2C: 1000000000000001
Second: convert to hexadecimal:
1000 0000 0000 0001 8 0 0 1
answer: 800116
Next: Convert from hexadecimal to decimal:
First: convert from 2C form: 8001
8 0 0 1 f-8 f-0 f-0 f-1 --- --- --- --- 7 f f e + 0 0 0 1 --- --- --- --- 7 f f f
Old | Digit | New | Radix |
---|---|---|---|
0 | 7 | 7 | 16 |
112 | f | 127 | 16 |
2032 | f | 2047 | 16 |
32752 | f | 32767 |
answer: Began with negative 2C binary number so: -3276710
Last modified: Sun Sep 23 20:41:32 MDT 2001