Computer Science 161.01

Digital Circuit Design (Homework #4)

Monday September 18th 2017

 

 

Name(s): ______________________________________________________________

 

1. A Circuit to Test Equality:  Create a circuit with inputs a1, b1, a2, b2 which will output 1 if and only if, as two-bit numbers, a1b1=a2b2. 

Create and simulate the circuit using this software.  Draw the circuit in the space provided below.

 

 

 

 

 

 

 

 

 

 

 

2. Half-Adder Circuit:  Create the Half-Adder (HA) circuit that we just derived in class, using this software.  Test the circuit with all 4 possible input combinations.  Record the results in the truth table below.

Carefully draw the circuit.

 

a          b                      sum      carry-out

0          0         

0                    1

1                    0

1          1

 

 

 

 

 

 


 

 

 

3. Full adder circuit:  A full adder circuit is one that performs the addition that occurs in

any column other than the rightmost.  For this, we’ll require three inputs (carry-in, a, b)

and, once again, two outputs (sum and carry-out).  We want to make liberal use of

XOR gates, and note the following: that adding three bits is really done

as follows: first “adding” two bits and then “adding” that result to the third.  For now,

draw only that part of the circuit that computes the sum bit and we’ll worry about the

carry-out bit later.  Test the sum part by testing all 8 combinations of the 3 inputs and

filling in the truth table for sum.

 

                        Carry-in           a          b                      sum      carry-out

                              0                0          0

                              0                0          1

                              0                1          0

                              0                1          1

                              1                0          0

                              1                0          1

                              1                1          0

                              1                1          1

 

The carry-out logic can be thought of as follows – a carry-out occurs whenever a and b

are both 1, but also whenever the carry-in is 1 and exactly one of a and b is 1.  (See if that

makes sense after filling out the column for carry-out above).  This logic can be

expressed as follows:

 

carry-out         =          (a AND b)  OR  (carry-in AND (a XOR b))

 

Create the entire full-adder circuit and carefully draw it on a blank sheet of

paper.

 

Think about how a full-adder might be constructed from two half-adders.