74LS85 or SN54/7485 is a 4-bit magnitude comparator of two binary format inputs. In electronics devices besides addition and subtraction comparison of binary numbers is also important to perform the operations. To solve this issue, we use TTL based comparators. The basic function of the comparator is to compare the two input bits and then give the three outputs. The output will always be in 3-bits which will describe the input relation with each other. The input can be greater or equal to each other. By using logic gates the comparators can be designed but to avoid large circuit size we can use the premade comparator IC.
74LS85 4-Bit Comparator Introduction
The IC 74LS85 is a magnitude comparator integrated circuit that can be used to compare the binary data. It is smaller in size and it comes in multiple packages to fulfill the requirement of different circuits. The 74LS85 can compare two 4-bit binary data and output can be received from the output pins in the form of HIGH and LOW state. IC 74LS85 receives 8 parallel inputs for two 4-bit binary data and gives the output in 3-bit in parallel form. The IC has low power consumption and it gives the output in TTL form, which makes it compatible with other TTL based devices and microcontrollers.
74LS85 Pin Configuration
Pinout diagram of 7485 binary magnitude comparator is shown below:
|B3||Pin 1||Pin 1 will be used to give the input of data B (First Data = A, Second Data = B) to the IC. The MSB (Most Significant Bit) of 4-bit data B will be given at this pin.|
|IA < B||Pin 2||Pin 2 – Pin 4 is the input pins. Those pins will be only used when we need to compare the data longer than the 4-bits. These pins will receive the values from the output pins of the previous IC to compare the next bits. Pin 2 will receive the HIGH state in case of data B is greater than data A, Pin 3 will receive the HIGH state in case of data A and B are equal and Pin 4 will receive the HIGH state when input B is less then A. At the same time only one pin will be HIGH others will be LOW.|
|IA = B||Pin 3|
|IA > B||Pin 4|
|OA > B||Pin 5||Pin 5 is an output pin. In the case of data, A is higher than data B the output state will be HIGH at pin 5.|
|OA = B||Pin 6||Pin 6 is an output pin. In the case of data, A and B are equal the output state will be HIGH at pin 6.|
|OA < B||Pin 7||Pin 7 is an output pin. In the case of data, A is less then data B the output state on pin 7 will be HIGH.|
|GND||Pin 8||Pin 8 is a ground pin. It will use as the common ground with Power supply and other devices.|
|B0||Pin 9||Pin 9 will use to receive the LSB (Least Significant Bit) of the 4-bit input data B.|
|A0||Pin 10||Pin 10 is an input pin. It will use to receive the LSB of the 4-bit input data A.|
|B1||Pin 11||Pin 11 will be used as the input pin. It will receive the second LSB of 4-bit input data B.|
|A1||Pin 12||Pin 12 will be used as the input pin for data A. It will receive the second LSB of 4-bit input data A.|
|A2||Pin 13||Pin 13 will be used to receive the second bit of 4-bit input data A.|
|B2||Pin 14||Pin 14 will be used to receive the second bit of 4-bit input data B.|
|A3||Pin 15||Pin 15 will be used to receive the MSB of 4-bit input data A.|
|VCC||Pin 16||Pin 16 will be used to give the power to the IC to make it functional.|
74LS85 Binary Comparator Features
- 74LS85 can be used to compare 4-bits at the same time.
- It can be expanded further to compare data more than 4-bits.
- 7485 gives output in TTL form, which makes it compatible with other TTL devices and microcontrollers.
- It comes in two packages, SOIC and PDIP.
- It comes with internal protection from clamp voltages.
- The voltage range for IC is 4.75 to 5.25.
- The input voltage for the HIGH state is minimum 2 and the LOW state is a maximum of 0.8.
- The output current for the HIGH state is -0.4mA and the LOW state is 8mA.
- IC can operate up to 0 to 70 degrees.
- IC has internal protection from clamp voltages whole range is about -1.5V.
For more electrical and mechanical dimensions check datasheet
How 74LS85 Comparator Works?
The make the IC workable we will need to connect the IC first with the power supply and further with a TTL device or microcontroller to use it. In other IC like an adder, the IC starts working from LSB but in the comparator, the IC will start comparing from the MSB. The data will start comparing from MSB and it will go to the LSB. In the case, at any point, data A is bigger than the data B or vice versa then the output will be decided. In IC the input data will be of two parts with 4-bit each and output data will be of 3 bits. In input, the data can be any binary numbers but in output data, only one bit will HIGH other will be LOW and all three bits will be describing the output on the base of input. Here’s the circuit of IC as a 4-bit comparator.
Figure 1: IC working as the 4-bit comparator
The IC can use to compare the data more than 4 bits by using the input expander pins. In IC those pins are Pin 2,3 and 5.
Truth Table 7485
8-bit Comparators Example with 74LS85
In the example we will use 74ls85 instead of comparing 4-bit, we will compare the 8-bit and the same method could follow to compare the data more than 8-bit. First, connect the IC with logic inputs then attach the output of the first IC with the input of the second IC. After that, we can attach view the output on the second IC. Here’s the circuit:
Figure 2: Proteus Circuit
After that check the all three-output condition. First, give the input A and B equal. In that condition, the output should be 010. Pin 6 should be HIGH only.
Figure 3: Equal data
After that give the input data A and B greater than each other one by one. The output will be 100 when data A less than B and it will be 001 for data A is greater than B. Here’s the result.
Figure 4: DATA A is greater
Figure 5: DATA B is greater
You may notice that in the case of B and A, data stop comparison when the MSB of the data becomes greater than previous. The comparator alone doesn’t have any special use instead of comparator but using this we can build further logics to solve multiple functions.
- 7485 has multiple uses in servers, networking devices, digital systems, and smart electronic devices.
- IC simply used to compare the binary data which allows the other devices to perform other functions.
- The IC comes internally in some embedded systems to perform logical operations.