162k views
1 vote
Make a circuit that compares 2 4 bit numbers( k and j) in two's complement and gives an output "x" = one if j is greater than or equal to k and an output 0 if k>j only uses 4 bit unsigned adders logic gates and muxes. not allowed to use magnitude comparator or build comparator with logic gates.

1 Answer

5 votes

Final answer:

To compare 4-bit numbers in two's complement using only 4-bit unsigned adders, logic gates, and muxes, convert the numbers to regular binary form and subtract one number from the other. Determine the output based on the result of the subtraction.

Step-by-step explanation:

To compare two 4-bit numbers in two's complement and obtain the desired output using only 4-bit unsigned adders, logic gates, and muxes, we can use a combination of arithmetic and logical operations.

First, we need to convert the numbers from two's complement to regular binary form by taking the complement and adding 1. Then, we can use a 4-bit unsigned adder to subtract one number from the other.

If the result of the subtraction is negative, it means that the second number is greater than the first. If it is zero or positive, the first number is greater. We can use this information to set the output line accordingly.

=

User Matan Itzhak
by
8.4k points