# Designing a combinational circuit that converts a 5 bit binary into its 2's complement

I have a small homework the teacher gave us to assess our previous Digital Logic course. The question is to design a combinational circuit whose input is a 5-bit binary number and whose output is the 2's complement of the input number. I am also told to use the Quine-McCluskey method to simplify the circuit.

I have started by constructing a truth table of 5 variables with possible 32 combinations.

--------------------------------
v  w  x  y  z    A  B  C  D  E
--------------------------------
0  0  0  0  0    0  0  0  0  0
0  0  0  0  1    1  1  1  1  1
.
.
1  0  0  0  1    0  1  1  1  1
.
.
1  1  1  1  1    0  0  0  0  1
--------------------------------


I have 5 outputs. I'm confused on how to procced with this.

Output A can be expressed as:

A = v'w'x'y'z + v'w'x'yz' + v'w'x'yz + v'w'xy'z' + v'w'xy'z + v'w'xyz' +
v'w'xyz + v'wx'y'z' + v'wx'y'z + v'wx'yz' + v'wx'yz + v'wxy'z' +
v'wxy'z + v'wxyz' + v'wxyz + vw'x'y'z'


The same can be done for B, C, D and E. How do I proceed? Do I process (simplify) each output individually? If so, how can I combine them at the end?

Thanks,

Tamrat

• Typically each bit of the output would be independently calculated, but if you find common product terms you could share them. Have you reduced your expression to eliminate the don't cares? Mar 22, 2018 at 17:46
• I would use negate and add one. An adder is a well known circuit in gates. (You can also find that in Wiki: "Conveniently, another way of finding the two's complement of a number is to take its ones' complement and add one") Mar 23, 2018 at 7:18

if input = $A_4A_3A_2A_1A_0$ and output = $Z_5Z_4Z_3Z_2Z_1Z_0$ , then:
$Z_5Z_4Z_3Z_2Z_1Z_0$ = $A_4^1A_3^1A_2^1A_1^1A_0^1$ + 00001