Solution for Spring 2002 CSCI 255 Practice Homework 1

Problem 1

Convert the following numbers from decimal into ten-bit twos-complement notation.

4310110101111
-5001000001100
10000000001
-171111101111

Problem 2

Convert the following ten-bit twos-complement numbers into decimal numbers.

1011001110-306
0110101110430
1000000010-510
0111111110510

Problem 3

What are the largest and smallest numbers that can be expressed as a ten-bit twos-complement number?

The smallest is -512 (binary 1000000000) and the largest is 511 (binary 0111111111). In general, if n is the width of the twos complement number, the smallest possible number is -2n-1 and the largest possible number is 2n-1-1,

Problem 4

Express the following decimal numbers in base 6:

2551103
36100

Problem 5

Add the following six-bit twos-complement number. Which, if any, of the additions result in an overflow?

101000 + 111011100011
011111 + 000111100110

In the first problem, two negative numbers are added and a negative number is the result. This is not an overflow. In the second problem, two postive numbers are added and a negative number is the result. This is an overflow.