# Trying to understand this table - comparator with carry

Create a circuit-table which compares two (signless) 4-bit binary numbers. The result is output signal c_i which is 1 if we have A≥B.

Given is A=0100 and B=0010. Fill the table whereby you choose c_-1 bit yourself so it makes all sense..

I believe this compare is done by subtraction and so we can use adder for this

(this is now for 1 bit:)

        3   2   1   0
----------------------
Ai      0   1   0   0
Bi      0   0   1   0
~Bi     1   1   0   1

Ci-1    1   0   0   1

Ci      1   1   0   1


We need to negate B, so negation of B is ~Bi in the table.

Then we add A and negation of B and if we see that Ci is 1 then we need to make sure that we get a carry when we add A and not B. I thought this is done like that.

Please can you tell me if this is right?

• Too much work. Figure it out for 1- and 2-bit inputs and extend it. – Ignacio Vazquez-Abrams Oct 10 '16 at 11:33
• This is all it's not too much. Only need to know if I udnerstood right? In table Ai and Bi and Ci are filled correctly anyway, only need to know if I filled Ci-1 correct too. – tenepolis Oct 10 '16 at 11:34