US3251035A - Binary comparator - Google Patents

Binary comparator Download PDF

Info

Publication number
US3251035A
US3251035A US253162A US25316263A US3251035A US 3251035 A US3251035 A US 3251035A US 253162 A US253162 A US 253162A US 25316263 A US25316263 A US 25316263A US 3251035 A US3251035 A US 3251035A
Authority
US
United States
Prior art keywords
word
bit
gate
bits
circuit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
US253162A
Inventor
Weinstein Hillel
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
RCA Corp
Original Assignee
RCA Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority to GB1050340D priority Critical patent/GB1050340A/en
Application filed by RCA Corp filed Critical RCA Corp
Priority to US253162A priority patent/US3251035A/en
Priority to FR961160A priority patent/FR1381717A/en
Application granted granted Critical
Publication of US3251035A publication Critical patent/US3251035A/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/02Comparing digital values
    • G06F7/026Magnitude comparison, i.e. determining the relative order of operands based on their numerical value, e.g. window comparator

Definitions

  • the circuit of the invention includes means responsive to each pair of like signiiicance bits of the two binary words being compared for producing a third word.
  • a bit has one value when the corresponding two bits compared are equal, and a second value when the corresponding two bits compared are unequal.
  • the circuit also includes means responsive to the bit of highest signicance having this second value in the thirdword,
  • the circuit indicates that the two words being compared are equal.
  • FIG. 1 is a block circuit diagram of the comparator of the invention
  • FIG. 2 is a block circuit diagram of the selector circuit which appears in FIG. 1;
  • FIG. 3 is a schematic circuit diagram of one form of yselector circuit which may be used in the circuit of the invention.
  • a three bit binary word a1, a2, a3 is compared with a second three bit binary word b1, b2, b3. It should be appreciated, however, that this is merely illustrative as the invention is applicable to the comparison of words having any desired number of binary bits.
  • electrical signals represent binary bits. It is arbitrarily assumed that a positive-going signal represents a zero and a negative going signal a one. For the sake of brevity, the bit itself rather than the signal manifesting ythe bit is generally referred to in the discussion.
  • the circuit of FIG. 1 includes six AND gates 10-15 three EXCLUSIVE-OR gates 16-18 and a selector circuit- 20. Each AND gate receives either an a bit or a b bit. For example, AND gate receives the bit a1 and AND gate 13 receives the bit b1.' Each AND gate also receives a d bit which is fed back from the selector circuit 20. For example, AND gates 10 and 13 receive the bit d1. Each EXCLUSIVE-OR gate receives the two bits of the same rank of the two binary words being compared. For example, EXCLUSIVE-OR gate 16 receives the bits a1 and b1.
  • the bits a1, b1 are the bits of greatest signilicance (the 22 bits) and the bits a3, b3 are the bits of least significance (the 2 bits).
  • the output of the circuit of FIG. 1 is taken from across resistors 22 or 24, or from NOR gate 26.
  • the selector circuit 20 in response to a timing pulse TP-l'and a binary word c1, c2, c3, having a one in the c1 position, produces the binary output word d1, d2, :13:100 lregardless of the icevalues of c2 and c3.
  • b1 is a -fzero, so that AND gate 13 produces a zero output.
  • d2 .and d3 are also zero so that AND gates 14 and 15 both produce Ia zero output. Therefore, a zero output appears across resistor 24 and the a word has been determined as the larger one ofthe two.
  • AND gate 10 is disabled.
  • AND gate 32 is primed. However, the one is applied via lead 39 to the inhibit terminal 35'of ANDl gate 34 and via lead 40 and 0R gate 38 to the inhibit terminal 37 of AND gate 36. Thus, AND gates 34 and 36 are disabled due to the presence of the inhibit signals. Therefore, when the 'TP-1 pulse occurs, only AND gate 32 becomes enabled and the output word produced is 1 00.
  • AND gate 32 is disabled and OR gate 38 disables AND gate 36. Therefore, when a TP-l pulse occurs, the only gate which becomes enabled is 34 and the output word produced is 010.
  • FIG. 3 is a circuit diagram of one way in which the circuit of FIG. 2 may be implemented.
  • the circuit consists of a matrix which includes diodes 50, 52, 54, 56, 58 and 60, and a number of resistors.
  • the circuit also includes inverters 62 and 64. Assume again that the input word is lc2c3. A one appears as anegative-going voltage. The one on lead c1 back biases diode 50.
  • the logical inverter 62 changes the one to a zero and this zero (which is a positive-going voltage) forward biases diodes 52 and 54. Therefore, when the timing pulse TP-l (a negative-going pulse) occurs, diode 50 does not conduct but diodes 52 and 54 do conduct.
  • column 68 carries a negative voltumns 68, 70 and 72 all carry a positive voltage (binary zero) and the a' word produced is 000.
  • the d word is fed back to the circuit shown in FIG. 1 and the NOR gate 26 produces an output 1:17.
  • An important advantage of the comparator circuit of FIG. 1 is that it is very fast. It is not necessary that a carry signal ripple from stage to stage as in many previous circuits. Instead, as lsoon as the timing pulse TP-l occurs, an output is available indicative of whether the two words being compared are equal or unequal and, if unequal, the sense of the unequality. This is so regardless of the length of the two binary words.
  • selector circuit Although only one specific type of selector circuit is illustrated, there are a number of others which are available which can be used instead.
  • the convergent-divergent tree network of application Serial No. 213,339, filed July 30, 1962 by the present inventor may be employed.
  • the time required to perform the comparison of two words is one cycle of CP pulses, that is, CPA, CP-Z, CP-3.
  • a circuit for comparing two n bit binary words comprising, means responsive to the two words for producing a third n bit word, any bit of which has one value when the corresponding two bits compared are equal and a second value when the corresponding two bits compared are unequal; and means responsive to the bit of highest significance having said second value in the third word, and the two bits of the same significance in the two words being compared, for manifesting which of the two words is the larger.
  • a circuit for comparing two binary words comprising, means responsive to the two words for producing a third word, the bits of which have one value when the two bits compared are equal and a second value when the two bits compared are unequal; means responsive to the bit of highest significance having said second value in ⁇ the third word, and the two bits of the same significance in the two words being compared, for manifesting which of the two words is the larger; and means responsive to the absence from the third word of a bit of said second value for indicating that the first and second words are equal.
  • a circuit for comparing two binary words comprising, in combination,
  • n first lines for respectively supplying manifestations of a first n bit binary word
  • n second lines for respectively supplying manifestations of a second n bit binary word
  • n EXCLUSIVE-OR gates each connected to receive a different first and second line, and the first and second line for each gate carrying bits of the same significance;
  • a circuit for comparing two binary words comprising, in combination,
  • n first lines for respectively supplying manifestations of a first n bit binary word
  • n second lines for respectively supplying manifestations of a second n bit binary word
  • n EXCLUSIVE-OR gates each connected to receive a different first and second line, and the first and second line for each gate carrying bits of the same significance;
  • selector circuit means responsive to the output word of the n EXCLUSIVE-OR gates for producing a second output word having a one in the same bit position as the one of highest significance in the output word of the EXCLUSIVE-OR gates and a zero in allother bit positions;

Description

May 10, 1965 H. wElNsTElN 3,251,035
BINARY COMPARATOR Filed Jan. 22, 1963 2 Sheets-Sheet l Q2 I l /7 C J/ffwe @em/r ira/wad May l0, 1966 H. WEINSTEIN BINARY COMPARATOR 2 Sheets-Sheet 2 Filed Jan. 22, 1963 /m f@ /M u 4. m @y VM W vw WW i A /A 4 N 27, H.. y /M M .www Y B 5r lL f c2 5 @l 4C Z.
H 2.2% 0 v/ wz N 1T /I M H A www NH f. Xv/o MNH/N,
United States Patent O 3,251,035 BINARY COMPARATOR Hillel Weinstein, New Brunswick, NJ., assigner to Radio Corporation of America, a corporation of Delaware Filed Jan. 22, 1963, Ser. No. 253,162 4 Claims. (Cl. 340-1462) This invention relates to an improved circuit for comparing two binary words, that is, for determining whether one binary word is greater than, less than, or equal to a second binary word. Circuits of this type are useful, among other places, in data processing equipment.
The circuit of the invention includes means responsive to each pair of like signiiicance bits of the two binary words being compared for producing a third word. In the third word a bit has one value when the corresponding two bits compared are equal, and a second value when the corresponding two bits compared are unequal. The circuit also includes means responsive to the bit of highest signicance having this second value in the thirdword,
if 'such a bit is present, and the two bits of the same sig-V nicance in the two words being compared for manifesting which one of the two words compared is the larger. If a bit of this second value is not present in the third word, the circuit indicates that the two words being compared are equal.
The invention is discussed in greater detail below and is described in the following drawings of which:
FIG. 1 is a block circuit diagram of the comparator of the invention;
FIG. 2 is a block circuit diagram of the selector circuit which appears in FIG. 1; and
FIG. 3 is a schematic circuit diagram of one form of yselector circuit which may be used in the circuit of the invention.
In the embodiment of the invention discussed below, a three bit binary word a1, a2, a3 is compared with a second three bit binary word b1, b2, b3. It should be appreciated, however, that this is merely illustrative as the invention is applicable to the comparison of words having any desired number of binary bits. v
In the circuit of the invention, electrical signals represent binary bits. It is arbitrarily assumed that a positive-going signal represents a zero and a negative going signal a one. For the sake of brevity, the bit itself rather than the signal manifesting ythe bit is generally referred to in the discussion.
The circuit of FIG. 1 includes six AND gates 10-15 three EXCLUSIVE-OR gates 16-18 and a selector circuit- 20. Each AND gate receives either an a bit or a b bit. For example, AND gate receives the bit a1 and AND gate 13 receives the bit b1.' Each AND gate also receives a d bit which is fed back from the selector circuit 20. For example, AND gates 10 and 13 receive the bit d1. Each EXCLUSIVE-OR gate receives the two bits of the same rank of the two binary words being compared. For example, EXCLUSIVE-OR gate 16 receives the bits a1 and b1. The bits a1, b1 are the bits of greatest signilicance (the 22 bits) and the bits a3, b3 are the bits of least significance (the 2 bits). The output of the circuit of FIG. 1 is taken from across resistors 22 or 24, or from NOR gate 26.
The operation of the circuit of FIG. 1 may be best understood by specific example. Assume irst that the a word is lll and the b word is 011. Clearly, the a word is larger than the b word so that the answer A B should be produced.v As 11:1 and b1=0, EXCLUSIVE-OR gate 16 produces a one output. The selector circuit 20 in response to a timing pulse TP-l'and a binary word c1, c2, c3, having a one in the c1 position, produces the binary output word d1, d2, :13:100 lregardless of the icevalues of c2 and c3. (Details of this circuit are given shortly.) The d1=1 bit is fed back to the AND gate 10. This input primes the gate, that is, it places the gate in condition to be enabled. As al, the second input to AND gate 10, is also a one, AND gate 10 becomes enabled,
produces a one output and a one appears across re-` sistor 22. b1 is a -fzero, so that AND gate 13 produces a zero output. d2 .and d3 are also zero so that AND gates 14 and 15 both produce Ia zero output. Therefore, a zero output appears across resistor 24 and the a word has been determined as the larger one ofthe two.
As the next example, assume that the a word is 101 and the b word is 110. The two inputs to EXCLUSIVE- OR gate'16 are both one (a1=1 and b1=1) so that c1=0. Under these conditions, the d1 bit produced by the selector circuit 20 when TP-l is applied is also zero so that AND gates 10 and 13 are inhibited.
a2 is zero and b2 is one This causes EXCLUSIVE OR gate 17 to produce a c2=l output. The selector circuit therefore produces an output d2: l, d3=0 when TP-l is applied. The d2=1 output plus the b2=l output enables AND gate 14 and a signal B A appears across resistor 24. It has already beenmentioned that AND gate 10 is disabled. The a2=0 input disables AND gate 11. The d3=0 output disables AND gates 12 and 15. As AND . gates 10, 11 and 12 are disabled, that is, these three AND gates produce a zero output, a zero appears across output resistor 22.
In the next example, assume that the a word equals the b word. Under these conditions, it is apparent that a zero appears at leads 28 and 30. When the TP-l pulse occurs, it causes the logical inverter 32 to Vapply a zero to the NOR gate 26. As the three inputs to the NOR gate are now zero, an output A=B is produced.
A block circuit diagram of the selector circuit is shown in FIG. 2. It includes three AND gates 32, 34 and 36 and an OR gate 38. The purpose of this circuit is'to select the bit of highest wsignicance at the input which has the value one. For example, if the c1 bit is a one the circuit produces a d1=l output and a d2=d3=0 output. If the input word is 0163, then the d output produced should be 010 (regardless whether c3 is 1 or 0). If the input is 001, then the output should be 001 also. Assume first that the input is 1c2c3 (in this example, c2 and c3 can each have any value). When c1 is a one,
AND gate 32 is primed. However, the one is applied via lead 39 to the inhibit terminal 35'of ANDl gate 34 and via lead 40 and 0R gate 38 to the inhibit terminal 37 of AND gate 36. Thus, AND gates 34 and 36 are disabled due to the presence of the inhibit signals. Therefore, when the 'TP-1 pulse occurs, only AND gate 32 becomes enabled and the output word produced is 1 00.
If the input word to the selector circuit is Olea, AND gate 32 is disabled and OR gate 38 disables AND gate 36. Therefore, when a TP-l pulse occurs, the only gate which becomes enabled is 34 and the output word produced is 010.
FIG. 3 is a circuit diagram of one way in which the circuit of FIG. 2 may be implemented. The circuit consists of a matrix which includes diodes 50, 52, 54, 56, 58 and 60, and a number of resistors. The circuit also includes inverters 62 and 64. Assume again that the input word is lc2c3. A one appears as anegative-going voltage. The one on lead c1 back biases diode 50. The logical inverter 62 changes the one to a zero and this zero (which is a positive-going voltage) forward biases diodes 52 and 54. Therefore, when the timing pulse TP-l (a negative-going pulse) occurs, diode 50 does not conduct but diodes 52 and 54 do conduct. Under these conditipns, column 68 carries a negative voltumns 68, 70 and 72 all carry a positive voltage (binary zero) and the a' word produced is 000. The d word is fed back to the circuit shown in FIG. 1 and the NOR gate 26 produces an output 1:17.
An important advantage of the comparator circuit of FIG. 1 is that it is very fast. It is not necessary that a carry signal ripple from stage to stage as in many previous circuits. Instead, as lsoon as the timing pulse TP-l occurs, an output is available indicative of whether the two words being compared are equal or unequal and, if unequal, the sense of the unequality. This is so regardless of the length of the two binary words.
Although only one specific type of selector circuit is illustrated, there are a number of others which are available which can be used instead. As one example, the convergent-divergent tree network of application Serial No. 213,339, filed July 30, 1962 by the present inventor may be employed. In this network, the time required to perform the comparison of two words is one cycle of CP pulses, that is, CPA, CP-Z, CP-3.
What is claimed is:
1. A circuit for comparing two n bit binary words comprising, means responsive to the two words for producing a third n bit word, any bit of which has one value when the corresponding two bits compared are equal and a second value when the corresponding two bits compared are unequal; and means responsive to the bit of highest significance having said second value in the third word, and the two bits of the same significance in the two words being compared, for manifesting which of the two words is the larger.
2. A circuit for comparing two binary words comprising, means responsive to the two words for producing a third word, the bits of which have one value when the two bits compared are equal and a second value when the two bits compared are unequal; means responsive to the bit of highest significance having said second value in `the third word, and the two bits of the same significance in the two words being compared, for manifesting which of the two words is the larger; and means responsive to the absence from the third word of a bit of said second value for indicating that the first and second words are equal.
3. A circuit for comparing two binary words comprising, in combination,
n first lines for respectively supplying manifestations of a first n bit binary word;
n second lines for respectively supplying manifestations of a second n bit binary word;
n EXCLUSIVE-OR gates, each connected to receive a different first and second line, and the first and second line for each gate carrying bits of the same significance;
2n logical product gates, each connected to a different one of said lines; and
means responsive to the output word of the n EXCLU- SIVE-OR gates for priming the two logical product gates which receive bits of the same significance as the EXCLUSIVE-OR gate of highest significance vwhich is enabled, and for disabling all other logicall product gates. 4. A circuit for comparing two binary words comprising, in combination,
n first lines for respectively supplying manifestations of a first n bit binary word;
n second lines for respectively supplying manifestations of a second n bit binary word;
n EXCLUSIVE-OR gates, each connected to receive a different first and second line, and the first and second line for each gate carrying bits of the same significance;
211 AND gates, each connected to a different one of said lines;
selector circuit means responsive to the output word of the n EXCLUSIVE-OR gates for producing a second output word having a one in the same bit position as the one of highest significance in the output word of the EXCLUSIVE-OR gates and a zero in allother bit positions; and
means for applying the bits of the second word to the 2n AND gates, each bit being applied to the two AND gates which receive the bits of the same significance of the first and second words, respectively.
References Cited by the Examiner UNITED STATES PATENTS R. C. BAILEY, Primary Examiner.
I. FAIBISCH, Assistant Examiner.

Claims (1)

1. A CIRCUIT FOR COMPARING TWO N BIT BINARY WORDS COMPRISING, MEANS RESPONSIVE TO THE TWO WORDS FOR PRODUCING A THIRD N BIT WORD, ANY BIT OF WHICH HAS ONE VALUE WHEN THE CORRESPONDING TWO BITS COMPARED ARE EQUAL AND A SECOND VALUE WHEN THE CORRESPONDING TWO BITS COMPARED ARE UNEQUAL; AND MEANS RESPONSIVE TO THE BIT OF HIGHEST SIGNIFICANCE HAVING SAID SECOND VALUE IN THE THIRD WORD, AND THE TWO BITS OF THE SAME SIGNIFICANCE IN THE TWO WORDS BEING COMPARED, FOR M ANIFESTING WHICH OC THE TWO WORDS IS THE LARGER.
US253162A 1963-01-22 1963-01-22 Binary comparator Expired - Lifetime US3251035A (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
GB1050340D GB1050340A (en) 1963-01-22
US253162A US3251035A (en) 1963-01-22 1963-01-22 Binary comparator
FR961160A FR1381717A (en) 1963-01-22 1964-01-22 Circuit for comparing two binary numbers

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
US253162A US3251035A (en) 1963-01-22 1963-01-22 Binary comparator

Publications (1)

Publication Number Publication Date
US3251035A true US3251035A (en) 1966-05-10

Family

ID=22959132

Family Applications (1)

Application Number Title Priority Date Filing Date
US253162A Expired - Lifetime US3251035A (en) 1963-01-22 1963-01-22 Binary comparator

Country Status (2)

Country Link
US (1) US3251035A (en)
GB (1) GB1050340A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3390378A (en) * 1965-10-22 1968-06-25 Nasa Usa Comparator for the comparison of two binary numbers
US3601801A (en) * 1968-01-09 1971-08-24 Snecma Parallel signal logic comparison circuit
US3656109A (en) * 1970-03-13 1972-04-11 Sperry Rand Corp Hamming distance and magnitude detector and comparator
US4316177A (en) * 1979-12-03 1982-02-16 Rca Corporation Data classifier
EP0068678A2 (en) * 1981-06-23 1983-01-05 Northern Telecom Limited Comparator circuit and method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US2923476A (en) * 1957-04-10 1960-02-02 Bell Telephone Labor Inc Signal comparison system
US2923475A (en) * 1957-04-10 1960-02-02 Bell Telephone Labor Inc Signal comparison system
US3000001A (en) * 1957-10-21 1961-09-12 Time Inc Parallel binary comparator circuit
US3011150A (en) * 1956-04-27 1961-11-28 Bell Telephone Labor Inc Signal comparison system
US3011151A (en) * 1956-04-27 1961-11-28 Bell Telephone Labor Inc Signal comparison system
US3102994A (en) * 1960-04-29 1963-09-03 Burroughs Corp Gating circuit

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3011150A (en) * 1956-04-27 1961-11-28 Bell Telephone Labor Inc Signal comparison system
US3011151A (en) * 1956-04-27 1961-11-28 Bell Telephone Labor Inc Signal comparison system
US2923476A (en) * 1957-04-10 1960-02-02 Bell Telephone Labor Inc Signal comparison system
US2923475A (en) * 1957-04-10 1960-02-02 Bell Telephone Labor Inc Signal comparison system
US3000001A (en) * 1957-10-21 1961-09-12 Time Inc Parallel binary comparator circuit
US3102994A (en) * 1960-04-29 1963-09-03 Burroughs Corp Gating circuit

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3390378A (en) * 1965-10-22 1968-06-25 Nasa Usa Comparator for the comparison of two binary numbers
US3601801A (en) * 1968-01-09 1971-08-24 Snecma Parallel signal logic comparison circuit
US3656109A (en) * 1970-03-13 1972-04-11 Sperry Rand Corp Hamming distance and magnitude detector and comparator
US4316177A (en) * 1979-12-03 1982-02-16 Rca Corporation Data classifier
EP0068678A2 (en) * 1981-06-23 1983-01-05 Northern Telecom Limited Comparator circuit and method
EP0068678A3 (en) * 1981-06-23 1983-10-19 Northern Telecom Limited Comparator circuit and method
US4446452A (en) * 1981-06-23 1984-05-01 Northern Telecom Limited Magnitude comparator circuit and method

Also Published As

Publication number Publication date
GB1050340A (en) 1900-01-01

Similar Documents

Publication Publication Date Title
US3247365A (en) Digital function generator including simultaneous multiplication and division
US4477904A (en) Parity generation/detection logic circuit from transfer gates
US3251035A (en) Binary comparator
US3757098A (en) Carry generation means for multiple character adder
US2999637A (en) Transistor majority logic adder
US3732407A (en) Error checked incrementing circuit
US3717755A (en) Parallel adder using a carry propagation bus
US3437801A (en) Carry-borrow system
US4069478A (en) Binary to binary coded decimal converter
US3454310A (en) Boolian connective system
US3126476A (en) Binary rate multiplier
US3249746A (en) Data processing apparatus
US3137789A (en) Digital comparator
US3198939A (en) High speed binary adder-subtractor with carry ripple
US3479644A (en) Binary number comparator circuit
US3390378A (en) Comparator for the comparison of two binary numbers
US3091392A (en) Binary magnitude comparator
US3113273A (en) Plural stage selector system including "not" and "and-not" circuits in each stage thereof
US3308384A (en) One-out-of-n storage circuit employing at least 2n gates for n input signals
US3388239A (en) Adder
US3139523A (en) Digital data comparator utilizing majority-decision logic circuits
US3102994A (en) Gating circuit
US3571615A (en) Logic circuit
US3268820A (en) Timing pulse generator having selective pulse spacing
US3074639A (en) Fast-operating adder circuits