In this lab, you will use a logic circuit simulator to investigate
the design and analysis of logic circuits that carry out addition of
binary digits. During the lab you
will be asked a series of questions.
Record your answers and turn them in to the instructor at the end of
the lab period.

We will again use the logic simulator located at

http://www.gac.edu/~hvidsten/courses/MC170/simcir121/simcir.html

Open a new browser window and start the simulator befor proceeding on with this lab.

A
B | SUM CARRY

-----+------------

0 0 |

0 1 |

1 0 |

-----+------------

0 0 |

0 1 |

1 0 |

1
1 |

The term "half-adder" is used to refer to this circuit because it only partially solves the problem of adding two multiple-digit numbers. When you add two numbers, you not only sum up the digits in a particular column, but you also have to keep track of whether there is a carry digit coming from adding up a previous column.

For example, consider the following addition of A=1011 and B=111:

c c c c

1 0 1 1

+ 1 1 1

---------

1 0 0 1 0

When adding the digits in the second, third, and fourth columns, we have a carry of 1 coming in from the column to the right. A better adder circuit would have a third input, labeled "cin" that would keep track of this carry from a previous column. To construct such a "full" adder circuit, we'll need three inputs and two outputs. The inputs will be the two numbers A and B, and also the carry digit coming in from a previous column. The outputs will be the digit for the sum and a carry digit. Since we'll have both an input carry and an output carry, we'll designate them as "Cin" and "Cout". We'll use "Sum" to designate the digit of the sum. How can we build a full-adder?

We can implement the full adder by using two half-adder circuits. The first will add A and B to produce a partial sum and a partial carry, while the second will add Cin to the partial sum to produce the final Sum output. If either half-adder produces a carry, there will be an output carry. Thus, Cout will be an OR function of the half-adder carry outputs. The resulting full adder circuit is shown below.

A
B Cin | Cout Sum

---------+-----------

0 0 0 |

0 0 1 |

0 1 0 |

0 1 1 |

1 0 0 |

1 0 1 |

1 1 0 |

1 1 1 |

---------+-----------

0 0 0 |

0 0 1 |

0 1 0 |

0 1 1 |

1 0 0 |

1 0 1 |

1 1 0 |

1 1 1 |

So far we have focused solely on arithmetic and logical operations of the computer (activities of the ALU). How does memory get implemented with logical gates? The simplest circuit for storing a 1-0 value is called a flip-flop. This circuit is illustrated in Figures 16.17 and 16.18 of the text (page 296).

EXERCISE 4:To build this circuit in the simulator, use two "PushOn" switches for the two inputs. These switches are normally off (0) and turn on (1) only when pressed. Construct the flip-flop circuit in the simulator and then test what happens when you press the "Set" and "Reset" buttons. Note the "feed-back" wire that runs from the output of the circuit back to the input of the lower AND gate. What purpose does this wire serve in the circuit? Why is it reasonable to call this circuit a flip-flop circuit? What feature makes it useful for storing values?

Back to MCS 170 home page