Electronics Tutorials Home Page


Valid XHTML Web Page

Do you like our Site?
Help us to Share It

Bookmark to: Google Bookmark to: Yahoo Bookmark to: Digg Bookmark to: Del.icio.us Bookmark to: Technorati
Bookmark to: Facebook Bookmark to: Reddit Bookmark to: StumbleUpon Bookmark to: Slashdot Bookmark to: Newsvine
Bookmark to: Propeller Bookmark to: Blinklist Bookmark to: Simpy


Electronics Tutorial about Comparators
 

Digital Comparators

Navigation
Page: 8 of 8

The Digital Comparator

Another common and very useful combinational logic circuit is that of the Digital Comparator circuit. Digital or Binary Comparators are made up from standard AND, NOR and NOT gates that compare the digital signals at their input terminals and produces an output depending upon the condition of the inputs. For example, whether input A is greater than, smaller than or equal to input B etc.

Digital Comparators can compare a variable or unknown number for example A (A1, A2, A3, .... An, etc) against that of a constant or known value such as B (B1, B2, B3, .... Bn, etc) and produce an output depending upon the result. For example, a comparator of 1-bit, (A and B) would produce the following three output conditions.

Digital Comparator Outputs

This is useful if we want to compare two values and produce an output when the condition is achieved. For example, produce an output from a counter when a certain count number is reached. Consider the simple 1-bit comparator below.

1-bit Comparator

Digital Comparator Circuit

Then the operation of a 1-bit digital comparator is given in the following Truth Table.

Truth Table

InputsOutputs
BAA > BA = BA < B
00010
01100
10001
11010

You may notice two distinct features about the comparator from the above truth table. Firstly, the circuit does not distinguish between either two "0" or two "1"'s as an output A = B is produced when they are both equal, either A = B = "0" or A = B = "1". Secondly, the output condition for A = B resembles that of a commonly available logic gate, the Exclusive-NOR or Ex-NOR gate giving Q =  B

Digital comparators actually use Exclusive-NOR gates within their design for comparing the respective pairs of bits in each of the two words with single bit comparators cascaded together to produce Multi-bit comparators so that larger words can be compared.

Magnitude Comparators

As well as comparing individual bits, multi-bit comparators can be constructed to compare whole binary or BCD words to produce an output if one word is larger, equal to or less than the other. A very good example of this is the 4-bit Magnitude Comparator. Here, two 4-bit words ("nibbles") are compared to produce the relevant output with one word connected to inputs A and the other to be compared against connected to input B as shown below.

4-bit Magnitude Comparator

4-bit Magnitude Comparator

Some commercially available Magnitude Comparators such as the 7485 have additional input terminals that allow more individual comparators to be "cascaded" together to compare words larger than 4-bits with magnitude comparators of "n"-bits being produced. These cascading inputs are connected directly to the corresponding outputs of the previous comparator as shown to compare 8, 16 or even 32-bit words.

8-bit Word Comparator

8-bit Word Magnitude Comparator

Goto Page:  1 2 3 4 5 6 7 8
Add this Digital Comparators Tutorial to your Favourites

Advertisement


Page Designed and Written by Wayne Storr.   Last updated  ,
Copyright © 1998 − 2010, Electronics-Tutorials.ws, All Right Reserved.