There are many kinds of circuits inside the modern CPU (Central Processing Unit) chip:



In addition to these, there are two more gates which combine operations commonly used together. These are the NAND (or NOT AND) gate:![]()
and the NOR (or NOT OR) gate:![]()
In order to illustrate the usefulness of logic gates in computer design, let us consider how one might go about constructing a circuit to add two bits. We first construct a truth table with columns for the inputs a and b (the operands of the addition operation) and columns for the outputs s (the sum) and c (the carry):![]()
Here we have reversed the order of 1s and 0s in the truth table in order to accommodate our "natural" ordering for numbers when we do arithmetic. For instance, the last row corresponds to "1 + 1 equals 0 with a carry of 1".
a b s c 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1
It is straightforward to recognize that the column representing the sum of a and b is just the output of an XOR operation, and that the column representing the carry is the output of an AND. Using this knowledge, is easy to construct a circuit whose purpose is to add two bits and produce a sum bit and a carry bit as output:
There are two important things to notice about this circuit:![]()
As before, the last row represents "1 + 1 + a carry of 1 from the previous place is equal to 1 with a carry into the next place". The sum of products form for the sum is
a b c (in) s c (out) 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1
s = a' b' c + a' b c' + a b' c' + a b cfrom the second, third, fifth and last rows (where c is the carry in from the previous place). The sum of products form for the carry out is
c out = a' b c + a b' c + a b c' + a b cfrom the fourth and last three rows. We can use the distributive properties to "factor" these expressions into
s = a' (b' c + b c') + a (b' c' + b c)and
c out = (a' b + a b') c + a b (c' + c)With the Complement and Identity axioms we can write the carry out as
c out = (a' b + a b') c + a bsince
c + c' = 1and
a b * 1 = ab.This enables us to construct the full adder as the following circuit:
Be sure and check this!![]()
If we connect a half adder:
in the least significant bit to a series of full adders![]()
as follows:![]()
with the carry outs wired to the carry ins of the next most significant bits, we have an adder for a pair of signed integers. Here, the subscripts indicate which power of 2 each adder is working on. For instance, one half adder and 15 full adders (n = 15) make up an adder for a short integer, a half adder and 31 full adders (n = 31) make up an adder for a long integer, etc. It should be clear that computer chip design is quite comlicated; without the benefits of Boolean Algebra, it is probable that you would not have the opportunity to learn this fascinating subject in preperation for your fascinating career in computers!![]()
In the last section of this chapter we explore another example of a Boolean Algebra: set theory.
Go to: Title Page Table of Contents Index
©2002, Kenneth R. Koehler. All Rights Reserved. This document may be freely reproduced provided that this copyright notice is included.
Please send comments or suggestions to the author.