Build an ALU

Reminders

You will once again use the TTL chips to build circuits. Please remember to:

You can find a TTL pinout diagram printed in the cabinet or in this pdf.

Remember also that it can help to label the coordinates of your physical wires on your circuit diagrams.

Part 1: Build a one-bit full adder

Using the logic diagram below, build a full adder on your protoboard.

Plan carefully; you will need to leave space to build a multiplexor from a decoder on your board in the next two parts of the lab.

Logic diagram for a full adder

Test your circuit using the truth table in Figure B.5.3 (p. B-717) of your textbook.

Part 2: Build a two-bit decoder

One way to think of a decoder is a binary to unary converter: the two input bits specify a binary number. That number determines which output line is turned on, while the rest are off.

  1. Draw a circuit diagram for a two-bit decoder using four AND gates and two NOT gates.
  2. Build your two-bit decoder on the protoboard using the TTL chips.

Don’t disassemble your decoder—you will use it in the next step to build a four-input multiplexer.

Part 3: Build a four-input multiplexor

Turn your two-bit decoder into a four-input multiplexer by adding four two-input AND gates and three two-input OR gates, as follows.

Use the two inputs to your decoder as the selector lines. Use four logic switches as your multiplexer input (for now). Connect each input to an AND gate, along with one of the decoder outputs. Connect all the AND gate outputs to a four-input OR gate, which you will have to construct from two-input OR gates. The logisim circuit below shows this circuit, using your existing decoder:

Multiplexer built from a two-bit decoder

Part 4: Finish your ALU

Now that you have a one-bit adder and a four-input multiplexor, complete your ALU with AND and OR gates. Use the selector in your multiplexor to choose between addition (selector at 00), logical AND (selector at 01), and logical OR (selector at 10).

Extra Challenge: Subtraction

If you still have time, add a binvert input so that your ALU can subtract as well as add.

  1. Using b and binvert as inputs, draw the truth table for a one-bit selector whose inputs are \(b\) and \(\overline{b}\) with the binvert control signal. (You should find the resulting circuit to be simpler than a general one-bit selector with two independent inputs.)
  2. Wire the appropriate gate(s) to conduct the one-bit subtraction.
  3. Set the binvert and carry_in inputs and test that your ALU implements subtraction correctly.

Copyright © 2018, 2019, 2020, 2022 Marge Coahran, Charlie Curtsinger, Janet Davis, and Jerod Weinman

CC-BY-NC-SA This work is licensed under a Creative Commons Attribution NonCommercial ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.