74LS85 4-bit magnitude comparator

The 74LS85 is a 4-bit magnitude comparator. It compares the two 4-bit numbers A3–A0 and B3–B0 and drives one of three outputs high: A>B, A=B or A

74LS85 pinout

VCCB3A3IA<BB2IA=BA2IA>BA1A>BB1A=BA0A<BB0GND1611521431341251161079874LS85

Top view of the 16-pin DIP package. Pin 1 is at the bottom left, beside the notch, and the numbers run anticlockwise. Power is on pin 16 (VCC, +5 V) and pin 8 (GND).

PinNameTypeWhat it is
1B3InputInput
2IA<BInputInput
3IA=BInputInput
4IA>BInputInput
5A>BOutputTotem-pole output
6A=BOutputTotem-pole output
7A<BOutputTotem-pole output
8GNDGround0 V
9B0InputInput
10A0InputInput
11B1InputInput
12A1InputInput
13A2InputInput
14B2InputInput
15A3InputInput
16VCCPower+5 V supply

74LS85 function table

74LS85 function table
A compared with BCascade inputsA>BA=BA<B
A > Bany100
A < Bany001
A = BIA>B = 1100
A = BIA<B = 1001
A = BIA=B = 1010

For a single 4-bit comparison, tie IA=B high and IA>B and IA

What the 74LS85 is used for

  • Comparing two 4-bit numbers
  • 8-bit and wider comparators, by feeding the outputs of the low stage into the cascade inputs of the next
  • Detecting when a counter reaches a set value

For a single 4-bit compare tie IA=B high and the other two cascade inputs low.

Electrical summary

Package16-pin DIP
Supply voltage5 V (4.75 V to 5.25 V)
Supply current, typical10 mA
Output typeTotem-pole — drives both high and low
Output current, lowsinks up to 8 mA
Output current, highsources up to 0.4 mA
Input current, low0.4 mA out of each input held low
Fan-outone output can drive about 20 LS inputs

Typical figures for quick reference when planning a board. Check the manufacturer's datasheet for limits and timing before committing a design. The 74HC85 and 74HCT85 use the same pin numbers, with different electrical values.

Try the 74LS85 on a breadboard

The Breadboard Simulator has the 74LS85 in its parts library: seat it on a virtual breadboard, wire it, power the board and probe the pins before you build the real thing.

Related chips

Build it before you build it.

Seat real 74-series chips on a virtual breadboard, wire them and probe every pin.