## Description

**Lab**** 3 1-bit Adder/Subtractor **

The objective of this lab is to build a circuit to perform 1-bit addition/subtraction.

**Chips: **

** ** 74HCT**08** Quad 2-input AND gate, 74HCT**32** Quad 2-input OR gate, 74HCT**04** inverter, 74HCT**86** Quad 2-input XOR gate

**Procedure**

Build a circuit with AND, OR and XOR gates to perform 1-bit addition.

- Derive the truth table for 1-bit full adder:

A circuit that adds a column of three bits is called a full-adder. We can design such a circuit by making a table listing the outputs for all possible input combinations. Note that in each column there is a sum bit which is put at the bottom and a carry bit that is taken to the next column. So we need to specify two output bits for each input combination. Let us call the two data bits A and B. (These are the bits in the two bottom rows of the sum, corresponding to the given numbers to be added.) We call the input carry Cin. The output bits will be S for the sum bit and Cout for the output carry. The summation is shown symbolically below, together with the table giving the outputs for each input combination. Each row of the table is filled in simply by writing in binary the sum of the three bits A + B + Cin, using 0 = (00)_{2}, 1 = (01)_{ 2}, 2 = (10)_{ 2}, and 3 = (11)_{ 2}.

A | B | Cin | Cout | S |

0 | 0 | 0 | 0 | 0 |

0 | 0 | 1 | 0 | 1 |

0 | 1 | 0 | 0 | 1 |

0 | 1 | 1 | 1 | 0 |

1 | 0 | 0 | 0 | 1 |

1 | 0 | 1 | 1 | 0 |

1 | 1 | 0 | 1 | 0 |

1 | 1 | 1 | 1 | 1 |

- Write the Boolean functions for Cout and S based on the truth table (sum of minterms):

Cout = A’BCin+AB’Cin+ABCin’+ABCin

S = A’B’Cin+A’BCin’+AB’Cin’+ABCin

- Write the Boolean functions for Cout and S based on the given logic diagram (simplified functions):

Cout = AB+(A⊕B)(Cin)

S = (A⊕B) ⊕Cin

- Circuit Construction on Tinkercad

The full-adder circuit diagram shown in the previous page uses two XOR gates, two AND gates, and one OR gate. The circuit can be built with one 7408 AND chip, one 7432 OR chip, and one 7486 XOR chip. DIP switches will be used to supply all three input logic levels A, B and Cin, and LEDs will be used to provide readout of the two output bits Cout and S.

- Make a copy of the start kit from https://www.tinkercad.com/things/19XqriP2dMF and rename the copy as “Lab 3 1-bit Adder/Subtractor” on Tinkercad Circuits dashboard.
- Connect chips together according to the schematic diagram shown in the previous page.
- Connect the inputs (A, B, Cin) to three switches, and the two outputs (Cout, S) to a pair of LEDs.
- Press “Start Simulation”
- Apply all eight combinations of logic LOW and HIGH levels to the three gate inputs using the DIP switches. Observe the two outputs, and record the results in a truth table, in the form of 0s and 1s. Verify if your table matches with the truth table shown in the first page.

- Homework: Follow the same procedure for the 1-bit adder to build a 1-bit subtractor. Derive the truth table for 1-bit full subtractor (A- B – Bin), write down the functions, and build the subtractor using the given logic diagram.

A | B | Bin | Bout | D |

0 | 0 | 0 | 0 | 0 |

0 | 0 | 1 | 1 | 1 |

0 | 1 | 0 | 1 | 1 |

0 | 1 | 1 | 1 | 0 |

1 | 0 | 0 | 0 | 1 |

1 | 0 | 1 | 0 | 0 |

1 | 1 | 0 | 0 | 0 |

1 | 1 | 1 | 1 | 1 |

__Submission Instructions:__

__Lab work submission__

- For each input combination, take a screenshot of your circuit.
- Copy the link of your circuit for sharing.
- On the Blackboard, click on Lab 3. Attach the 8 screenshots from Step 1 and paste the link from Step 2 into the Comments area, then hit Submit button.

__Lab report submission__

Lab report is needed for this lab. Please follow the guidelines and sample report on the Blackboard when you are writing your lab report. Click on **Lab 3 Report Submission** to submit your report. It is due one week after the lab is done.

__TESTING INPUT COMBINATIONS FOR ADDER:__

__https://www.tinkercad.com/things/gBXckLXPbDP-copy-of-csc-347-starter-kit/editel?sharecode=Fgs8tWlkZwnfxNLX6TlnRi6d18ig4ayYRGUeFaG48sA__

0+0+0=00

0+0+1=01

0+1+0=01

0+1+1=10

1+0+0=01

1+0+1=10

1+1+0=10

1+1+1=11

__ __