CS473 - Base Conversion Review answers

Number conversions from decimal

Decimal → binary

a)
OldNewBit
107531
53261
26130
13 61
6 30
3 11
1 01
Answer01101011

b) One way to convert a negative number is to calculate the binary version of the absolute value and then take the 2's complement (which is found by adding 1 to the 1's complement):
OldNewBit
39191
19 91
9 41
4 20
2 10
1 01
Absolute00100111
1's complement11011000
Answer11011001

c)
OldNewBit
58290
29141
14 70
7 31
3 11
1 01
Answer00111010

d) Another way to convert a negative number is to realize that in 8-bit arithmetic, x+256 = x; in this case, -109 + 256 = 147:
OldNewBit
147731
73361
36180
18 90
9 41
4 20
2 10
1 01
Answer10010011

Decimal → hexademical

e)
OldNewRadix
13428314
83 5 3
5 0 5
Answer053e

f) Using a technique similar to b):
OldNewRadix
11234702 2
702 4314
43 211
2 0 2
Absolute2db2
1's complementd41d
Answerd41e

g)
OldNewRadix
8695543 7
543 33 f
33 2 1
2 0 2
Answer21f7

h) Using a technique similar to d) (-1234 = -1234 + 65536 = 64302):
OldNewRadix
64302401814
4018 251 2
251 1511
15 015
Answerfb2e

Number base conversions to decimal

Binary → decimal

i)
OldBitNew
01 1
20 2
40 4
81 9
180 18
361 37
740 74
1481149
Answer149 - 256 = -107

j)
OldBitNew
00 0
01 1
20 2
41 5
100 10
201 21
420 42
841 85
Answer85

k)
OldBitNew
01 1
21 3
60 6
120 12
241 25
501 51
1020102
2040204
Answer204 - 256 = -52

l)
OldBitNew
00 0
00 0
00 0
00 0
00 0
01 1
21 3
60 6
Answer6

Hexadecimal → decimal

m)
OldRadixNew
010 10
16011 171
273612 2748
439681343981
Answer43981 - 65536 = -21554

n)
OldRadixNew
0 1 1
16 2 18
288 3 291
4656 4 4660
Answer4660

o)
OldRadixNew
010 10
16015 175
2800 1 2801
44816 244818
Answer44818 - 65536 = -20718

p)
OldRadixNew
0 0 0
010 10
160 1 161
257611 2587
Answer2587

Binary arithmetic

1.
      111
  01100101
+ 00010011
  --------
  01111000

2. -01110110 = 10001001 + 1 = 10001010

     1
  01101100
+ 10001010
  --------
  11110110

3.


  1111111111101100 (first term * 00000001)
+ 1111111111011000 (first term * 00000010)
  ----------------
  1111111111000100
+ 1111111110110000 (first term * 00000100)
  ----------------
  1111111101110100
+ 1111110110000000 (first term * 00100000)
  ----------------
  1111110011110100
4.
  00101011
+ 11101010 (divisor*00000010, negated)
  --------
  00010101
+ 11110101 (divisor*00000001, negated)
  --------
  00001010 (remainder)

quotient is 00000011