MOULDLKnowledge BaseElectrical Knowledge Base3D Model DownloadsMembership
中文版Model Store »
Knowledge Base › Electrical Knowledge Base › Comparator 74LS85 function and use
HomeModels
Table of contents

On this page

Electrical & Electronic Basics (600 articles)

Quick Reference

  • PLC & Programming
  • Electrical & Electronic Basics (monthly)(每月更新中)
  • Electrical Control & Drawings (monthly)(每月更新中)
  • Drives & Actuators (monthly)(每月更新中)
  • Sensors & Detection (monthly)(每月更新中)
  • Industrial Communication & Networks (monthly)(每月更新中)
  • HMI & Host Systems (monthly)(每月更新中)
  • Industrial Robots & Motion Control (monthly)(每月更新中)
  • Mechatronic System Integration (monthly)(每月更新中)
  • Fault Diagnosis & Standards (monthly)(每月更新中)

Comparator 74LS85 function and use

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.

1. How it works

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.

2. Practice and pitfalls

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.

3. 74LS85 compare

OutputMeaningCascade
A greaterA bigto high
A lessA smallto high
A equalsameto high
Cas inlow resultset equal
Usethresholdhardware
Trapin wrongall wrong

4. Notes

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.

5. References

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.

6. Cautions

⚠️ Three common pitfalls:
① Cascade inputs wrong makes the comparison wrong.
② Lowest stage not set to equality baseline always says unequal.
③ Using it as a subtractor; it gives relation not the difference.

Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.

Related reading

Related 3D models: Ready to build it? Download free 3D models & CAD drawings at MOULDL »
MOULDL · Electrical Knowledge Base · free self-study reference for electrical & automation engineers, 3D CAD models at MOULDL