I'm working on an extra work question our teacher assigned us from the book. Design a combinatorial circuit that compares two 4-bit unsigned numbers A and B to see whether B is greater than A. The circuit has one output X, so that X = 1 if A < B and X = 0 if A = B or A > B.
I had 2 ideas, but neither are very good. 1 was to get 2's complement version of A(positive) and B(negative). I could then add them together and if we had a negative, it would be obvious that B is greater than A. The leading bit would be 1 so I would just negate the leading bit and have that be my output. Else it would output 1. This is almost a solution, but I don't think it would work if we had A = B because then the leading bit would be 0 but we would have an output of 1 which would indicate A>B when in fact A = B.
My second idea was to split each number into 4 bits, and compare the bits of each number and find out that way. This would require a 256 row truth table though, and I'd rather just not answer the question than write that out.
Neither of my approaches really seem feasible(I don't even feel as though they accomplish the task). Can anyone suggest a hint as to what would be a good approach or idea to accomplish this task? (Not looking for a full out solution, just something to get me started)