Electronic – Designing a combinational circuit that converts a 5 bit binary into its 2’s complement

digital-logic

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

Best Answer

As @oldfart suggested, instead of solving all those lengthy K-maps, you can directly draw the combinational ckt by using the relation that:

Two's compliment = One's compliment + 1

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

You can expand the Circuit further by substituting the equivalent gate level circuit of adders.

enter image description here