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
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).
| Pin | Name | Type | What it is |
|---|---|---|---|
| 1 | B3 | Input | Input |
| 2 | IA<B | Input | Input |
| 3 | IA=B | Input | Input |
| 4 | IA>B | Input | Input |
| 5 | A>B | Output | Totem-pole output |
| 6 | A=B | Output | Totem-pole output |
| 7 | A<B | Output | Totem-pole output |
| 8 | GND | Ground | 0 V |
| 9 | B0 | Input | Input |
| 10 | A0 | Input | Input |
| 11 | B1 | Input | Input |
| 12 | A1 | Input | Input |
| 13 | A2 | Input | Input |
| 14 | B2 | Input | Input |
| 15 | A3 | Input | Input |
| 16 | VCC | Power | +5 V supply |
74LS85 function table
| A compared with B | Cascade inputs | A>B | A=B | A<B |
|---|---|---|---|---|
| A > B | any | 1 | 0 | 0 |
| A < B | any | 0 | 0 | 1 |
| A = B | IA>B = 1 | 1 | 0 | 0 |
| A = B | IA<B = 1 | 0 | 0 | 1 |
| A = B | IA=B = 1 | 0 | 1 | 0 |
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
| Package | 16-pin DIP |
| Supply voltage | 5 V (4.75 V to 5.25 V) |
| Supply current, typical | 10 mA |
| Output type | Totem-pole — drives both high and low |
| Output current, low | sinks up to 8 mA |
| Output current, high | sources up to 0.4 mA |
| Input current, low | 0.4 mA out of each input held low |
| Fan-out | one 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.