# Spring 2001 CSCI 255 Homework 3

You must show your work to receive full credit. This assignment is due Monday, 12 February.

## Problem 1

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

• -17
• 25

## Problem 2

Which, if any, of the following additions of four-bit twos-complement numbers result in an overflow? You really don't even have to add the entire numbers to tell.

• 1100 + 1100
• 1000 + 1000
• 0100 + 0100
• 1000 + 0111

## Problem 3

Draw a circuit that implements the truth table shown below. The "inputs" to the truth table are A, B, and C. The output is Z. Again, review section 3.3.4 before attempting this problem.

inputoutput
ABCZ
0001
0010
0100
0110
1000
1011
1101
1111

## Problem 4

Assume x is a C integer variable. Describe how you would set bits 2,4, and 10 of x to 1 and clear bits 3, 5, and 9 to 0. You can did this in one statement.

## Problem 5

Implement the following Boolean function using only NAND gates and inverters:

• f(x, y, z) = x' y + x y' z

## Problem 6

Using truth tables show that the following pairs of Boolean equations are true:

• a b + a = a
• a + b c = (a + b)(a + c)