CS355 Sylabus
Circuit Design Example: Adding two 2-bit binary numbers

• Problem description:

Construct a circuit that has 4 inputs and 3 outputs, the 4 inputs represents two 2-bit binary numbers and the 3 outputs represents the value that is equal to sum of the input numbers.

• Again, we must find the boolean function (in table form) from the description above.

Let us denote the inputs as a1 a0 b1 and b0, the outputs as z2, z1 and z0:

a1 a0 b1 b0   z2 z1 z0
- - - - + - - -
0 0 0 0   0 0 0
0 0 0 1   0 0 1
0 0 1 0   0 1 0
0 0 1 1   0 1 1
0 1 0 0   0 0 1
0 1 0 1   0 1 0
0 1 1 0   0 1 1
0 1 1 1   1 0 0
1 0 0 0   0 1 0
1 0 0 1   0 1 1
1 0 1 0   1 0 0
1 0 1 1   1 0 1
1 1 0 0   0 1 1
1 1 0 1   1 0 0
1 1 1 0   1 0 1
1 1 1 1   1 1 0

• Now we can apply the circuit construction algorithm on each of the columns to obtain the circuit diagram:

• You can experiment the circuit with this demo file: click here

• Note: when you want to construct a circuit in logic-sim code, you only need to find the boolean expressions for each output in a logic table format. You don't need to draw out the circuit.

The circuit file 2-bit-adder was written using the table above, not using the circuit diagram.

I only use the circuit diagram to show you how things are connected.

• NOTE: you do need to learn to draw circuit diagrams, especially for the midterm and final tests.

For obvious reasons, the answers to test questions about circuit design will be a circuit diagram and I will not accept logic-sim programs as answer on tests !