CSE370 Quiz 3 Solution (8 May)
 

You are to design a circuit that determines how many of 7 signals are high. Your result is to be a 3-bit binary number (to cover the range from 0 to 7). The design will use binary full-adders. Construct a circuit using as many binary full-adders as you wish to perform this function.

A straightforward implementation uses a series of adders to combine all the numbers. We use one full-adder to the add three of them. The two bit result is added with another two (the A and carry-in inputs of the first adder) in the second row of adders. Finally, the three-bit result of the first five is added with the final two signals in the third row of adders. Since the final result can never be greater than 7, the carry-out of the last adder can be ignored.

Now consider the same circuit but this time using only 4 full-adders.

Extending the initial idea of the above solution, we can form two two-bit results by adding two groups of three signals. Then, we can add these two two-bit results with the seventh signal in a second row of adders.

Another solution that uses only four full-adders is shown below. This one starts by adding three signals, then another two to that sum, then the final two to that sum. The carrys are all added in another full-adder to yield the high-order two bits of the total.


Comments to: cse370-webmaster@cs.washington.edu (Last Update: )