HELP: circuit that gives two compliment of 4 bit binary number

Thread Starter

Michael Iovenko

Joined Sep 24, 2017
3
Hi everybody, I'm new to the forum and got on here because I'm looking for help with making a circuit that calculates the twos compliment of a 4 bit binary number. I'm using logisim and I understand you would invert the numbers and add one although for me to visualize what that would mean circuit wise is hard at this point. I know learning is key but I can't seem to find this anywhere, help would be greatly appreciated!
 

WBahn

Joined Mar 31, 2012
32,970
As you say, you would invert the bits and add one.

Can you make a circuit that would add 1 to an arbitrary 4-bit binary number?

Can you make a circuit that would invert all of the bits in a 4-bit binary number?

Are you familiar with a 4-bit binary adder made from Full Adders?

You need to show your best attempt to do as much as you can.
 

Thread Starter

Michael Iovenko

Joined Sep 24, 2017
3
As you say, you would invert the bits and add one.

Can you make a circuit that would add 1 to an arbitrary 4-bit binary number?

Can you make a circuit that would invert all of the bits in a 4-bit binary number?

Are you familiar with a 4-bit binary adder made from Full Adders?

You need to show your best attempt to do as much as you can.
heres what I have so far
 

Attachments

WBahn

Joined Mar 31, 2012
32,970
You are close, but think about what you are doing with that circuit.

You 4-bit adder's output is

S = A+B+Cin

If your input is V, then

S = -V = ~V + 1

But you are setting A and B both to ~V, so you are getting

S = ~V + ~V + 1

S = (~V + 1) + (~V + 1) - 1

S = 2(-V) - 1

S = -(2V + 1)

You input is V = 3, so you have

S = -7

The 4-bit two's complement representation of -7 is 1001, which is what you circuit is producing.
 
Top