
CPSC 2105 Introduction to Computer Organization
Homework Set 1 Due Monday, January 23, 2006
Homework key with answers and comments.
Each of these questions counts 20 points.
1. Convert the following decimal numbers to binary numbers.
The numbers are unsigned. Use as many bits as necessary.
a) 63 b) 125 c) 104
ANSWER:
a) 63 = 32 + 31 = 32 + 16 + 8 + 4 + 2 + 1 011 1111
63 / 2 31 rem 1
31 / 2 15 rem 1
15 / 2 7 rem 1
7 / 2 3 rem 1
3 / 2 1 rem 1
1 / 2 0 rem 1
b) 125 = 64 + 61 = 64 + 32 + 29 = 64 + 32 + 16 + 13
= 64 + 32 + 16 + 8 + 4 + 1 0111 1101
125 / 2 62 rem 1
62 / 2 31 rem 0
31 / 2 15 rem 1
15 / 2 7 rem 1
7 / 2 3 rem 1
3 / 2 1 rem 1
1 / 2 0 rem 1
c) 104 = 64 + 40 = 64 + 32 + 8 0110 1000
104 / 2 52 rem 0
52 / 2 26 rem 0
26 / 2 13 rem 0
13 / 2 6 rem 1
6 / 2 3 rem 0
3 / 2 1 rem 1
1 / 2 0 rem 1
Page 1 of 4 Homework Key Revised 01/23/2006