Building binary to two’s complement converter

digital-logic

enter image description here

This is a sample exam question, and no solutions were given

I don't understand the concept of 'one bit slice', and I've tried to understand the meaning of the table, I stared at it for a long time, and could not understand it.
I know that it's a binary to two's complement converter, so there is something to do with 'flip the numbers and add 1', but I can never see it one the table.
I am so stuck, please help me people.

thank you

Best Answer

I suppose the task given is to compute -B using 2's complement. As you say with 2's complement: S = not(B)+1.

That means there is only one input carry bit (always '1') that needs to propagate from LSB, and then through every slice.

I suppose I would draw a one bit slice like this:

enter image description here

So for task b) simply extend B to 4 bits (\$\textrm{B}_3, \textrm{B}_2, \textrm{B}_1, \textrm{B}_0\$) and start listing the values, (perhaps preferably counting down from 7 ("0111")), keep C_{in} at 1 and find the values for S and Cout. Note that the most negative number often needs special treatment ( see http://en.wikipedia.org/wiki/Two%27s_complement#Most_negative_number )

For task c) I suppose you just draw the 4 bit slices connected (Cout to Cin of the next) and add an overflow check for the most negative number for extra points.