# CS201 Lab: Design Adders & Subtractors

## Objective of this lab:

To investigate arithmetic circuitry.
Arithmetic circuits play a central role in the operation of a microprocessor.

## Preparation

Read **lab lecture notes**.

## Lab Assignments

- Design a half adder as shown by the diagram and truth table below
using one
**XOR** and one **AND** gate.

The square box labelled "half-adder" is a black box that contains
the circuitry (XOR and AND gates) to perform the half adder function.

Build and test your circuit with the truth table.

Write the expressions of the sum and the carry beside the circuit.

**Hand-In**

- Circuit labelled "1. Half Adder"
- Expressions for Sum and Carry

- A full adder can be designed using two half adders and some additional gates.

(Hint Ci+1= the sum of the carries out of the two half adders).

Build and test your circuit with the truth table.

Write the expressions of the sum and the carry beside the circuit.

**Hand-In**

- Circuit labelled "2. Full Adder using Half Adders"
- Expressions for Sum and Carry

- A half subtractor subtracts two bits, xi and yi producing their difference di.

It also has an output bi to specify if a 1 has been borrowed from the next higher position.

The truth table and schematic diagram for a half subtractor are shown below.

Give the simplified boolean function for di and bi+1 and build the half subtractor circuit.

**Hand-In**

- Circuit labelled "3. Half Subtractor"
- Expressions for Difference and Borrow

- Using the property that:

show that a half subtractor can be implemented using a **half adder**
and two **inverter** gates.

Build and test this circuit with the truth table.

Write the expressions of the difference and the borrow beside the circuit.

**Hand-In**

- Circuit labelled "4. Half Subtractor using Half Adder"
- Expressions for Difference and Borrow

- A full subtractor can be built using two
**half subtractors** and an
**OR** gate.

Design and test a full subtractor (schematic diagram and truth table shown below).

Write the expressions of the difference and the borrow beside the circuit.

**Hand-In**

- Circuit labelled "5. Full Subtractor using Half Subtractors"
- Expressions for Difference and Borrow

- Show that a full subtractor can be implemented using a
**full adder**
and two **inverter gates**.

Build and test your circuit with the truth table.

Write the expressions of the difference and the borrow beside the circuit.
**Hand-In**

- Circuit labelled "6. Full Subtractor using Full Adder"
- Expressions for Difference and Borrow

*
Copyright: Department of Computer Science, University of Regina.
*