Comparator - mbits-mirafra/digitalDesignCourse GitHub Wiki
What?
Comparators are digital circuits that compare two input values and produce an output signal based on the relationship between the two inputs.
Types:
-
A>B: The A>B output is a logical high (or "1") when input A is greater than input B. In other words, if A is a larger value than B, the comparator will output a logical high.
-
A<B: The A<B output is a logical high (or "1") when input A is less than input B. In other words, if A is a smaller value than B, the comparator will output a logical high.
-
A=B: The A=B output is a logical high (or "1") when input A is equal to input B. In other words, if A and B have the same value, the comparator will output a logical high
Where ?
Sorting algorithms involve comparing multiple data elements with each other, rather than comparing two values with each other. The comparison operation used in sorting algorithms is typically a three-way comparison, which compares whether one element is less than, greater than, or equal to another element.
Block Diagram:

2 Bit Comparator:
Block diagram:

Truth Table:


Logical Equation:

Logic circuit:
