# Division of binary numbers logic circuit

If we want to divide two numbers I have problem implementing this logic.I am posting 1 images with 2 different steps to the solution.

In example a) the most significant digits of the divident >= divisor we subtract the divisor from those 2 digits.

In b)the most significant digits of the divident<divisor so we move down the next digit of the divident(which happens to be the last) and we put a 0 in the quotient and do the subtraction.

I dont understand how to make a logic circuit which does that job:check if the divisors is greater and equal or less than the most left digits of the divident and depending on the results does a different function

## 2 answers

You're thinking of a digital comparator, "a hardware electronic device that takes two numbers as input in binary form and determines whether one number is greater than, less than or equal to the other number."

#### 1 comment thread

I dont understand how to make a logic circuit which does that job:check if the divisors is greater and equal or less than the most left digits of the divident

So *think* about it. Break it down into small chunks. Let's ignore the reason behind your question and try to make a digital block that compares two unsigned binary numbers and tells you either A > B, A = B, or A < B.

Start with the highest bit. There are four possible cases. Write a truth table to show the action in each possible case:

A B action --- --- ---------------- 0 0 can't tell, need to look at lower bits. 0 1 A < B, done. 1 0 A > B, done. 1 1 can't tell, need to look at lower bits.

You should be able to see how this per-bit logic can be chained, starting from the highest bit down to the lowest bit. At any point where the middle two cases in the truth table above are found, the process terminates with a definitive answer. Or, you could say that the result of comparing that bit overrides any output from the results of comparing lower bits.

If you get all the way to the end without a definitive answer, then the two values are equal.

Joel Reyes Noche has already told you this is a standard block called a "digital comparator". Personally, I've seen this called a "magnitude comparator". That may help you search for more material on it out there.

## 0 comment threads