# Solution for Spring 2002 CSCI 255 Practice Homework 2

## Problem 1

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

100100 + 011010 | 111110 |

010110 + 111111 | 010101 |

Neither addition results in an overflow. Overflow *never*
occurs when adding numbers of different signs.

## Problem 2

Compute the following bit-wise logical operations on six-bit
binary numbers.

011011 AND (101000 OR 000001) | 011011 AND 101001 001001 |

NOT(001100) AND NOT(011110) | 110011 AND 100001 100001 |

## Problem 3

Complete a truth table to describe the logic circuit shown below.

input | output |

A | B | C | X |

0 | 0 | 0 | 0 |

0 | 0 | 1 | 0 |

0 | 1 | 0 | 0 |

0 | 1 | 1 | 1 |

1 | 0 | 0 | 0 |

1 | 0 | 1 | 1 |

1 | 1 | 0 | 0 |

1 | 1 | 1 | 1 |

You can solve the problem in a couple of ways. First, you can just
"plug in" all eight input combinations and see what they
produce on the output. Or, you can determine what the function
is algebraicly, in this case
it simplifies to A C + B C, and then complete a truth table.
Unless you are particularly good in Boolean algebra, you'll
find the first method easier.