The 74LS85 is a 4 bit magnitude comparator telling whether A is greater, less or equal to B. This page covers the outputs and cascading to wider compare.
The 74LS85 compares 4 bit unsigned A and B and outputs three results: A greater, A less, A equal. It starts at the most significant bit; if they differ it decides at once, else it moves down, exactly like comparing numbers by hand. It has cascade inputs (A greater in, A less in, A equal in) to feed a lower stage result into a higher stage, cascading to 8 or 16 bits.
In cascade the lower chip three outputs feed the higher chip three cascade inputs, with the lowest chip cascade inputs set to equal in 1 and the other two 0 as the equality baseline. Then the higher chip, when its bits are equal, uses the lower conclusion. Uses: address range test, timer compare, sorting, alarm threshold (output when measured exceeds set). It saves MCU math on site.
| Output | Meaning | Cascade |
|---|---|---|
| A greater | A big | to high |
| A less | A small | to high |
| A equal | same | to high |
| Cas in | low result | set equal |
| Use | threshold | hardware |
| Trap | in wrong | all wrong |
The 74LS85 compares 4 bit A and B into greater less equal, deciding at the MSB. Cascade lower outputs to higher cascade inputs and set the lowest to equality baseline. Use for address range and threshold alarms; signed numbers need twos complement and it gives relation not difference.
The quantities and component characteristics discussed here follow current national standards and the corresponding IEC documents: Comparator use per GB/T 4728; control to GB/T 5226.1 and IEC 60204-1. Always check the device datasheet and the product design file for ratings and derating.
Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.