Comparator (digital technology)

from Wikipedia, the free encyclopedia

A comparator in digital technology is an electronic circuit that compares two digital values.

Identity Comparator

Structure of an identity comparator

Identity comparators ( English Identity Comparator ) test two bits for equality, which with the help of a XNOR gate is done. To compare bytes , two equivalent bits are compared with each other and the result is linked with an AND gate .

simple comparators
Compares family designation
2 × 8-bit byte TTL SN74LS688 (from TI )
2 × 9-bit bytes TTL AM29809 (from AMD )

Size comparator

Structure of a 1-bit size comparator

Magnitude comparators (Engl. Magnitude Comparator ) in addition to equality on the relations Bigger and Smaller test. In order to be able to carry out the size comparison, the two numbers must be coded in the same way. In addition, the size comparator must be designed for the code used.

Truth table for 1-bit size comparator
a b y a> b y a = b y a <b
0 0 0 1 0
0 1 0 0 1
1 0 1 0 0
1 1 0 1 0

n-bit size comparator

An n-bit size comparator is based on the fact that the difference is formed from the sizes to be compared and the result is checked for 0, <0,> 0. In the binary code, the adder is based on the addition of the two's complement , i.e. (-B) is the same as (+! B + 1). When adding a number with its inverted number (e.g. 1001101 + 0110010 = 1111111), the result is all bits 1. If a number is subtracted from itself, (A - A = A + (! A + 1) = 0 , carry = 1) the result is 0, with carry 1.

If A is to be compared with B, then:

condition Note equivalent to Intermediate result Carry Result
A == B A = B B +! B + 1 b'1..11 + 1 1 0
A> B A = B + d B + d +! B + 1 b'1..11 + 1 + d 1 d
A <B A = B - d B - d +! B + 1 b1..11 + 1 -d 0 -d
Schematic structure of an n-bit size comparator
Size comparators for dual code
Compares family designation
2 × 5-bit byte ECL MC10166
2 × 8-bit byte TTL SN74LS682 to SN74LS689

extension

To compare bytes that have more digits than is specified by the comparator module, several comparators can be connected in series or in parallel. The parallel solution has the advantage of lower latency for bytes with many digits , which results in a higher speed. The serial structure is only recommended if it means that fewer comparator modules have to be used.

Serial structure of a 7-bit byte size comparator
Parallel construction of an 8-bit byte size comparator