KR101540539B1 - Magnitude Comparator Using Logic Gates - Google Patents

Magnitude Comparator Using Logic Gates Download PDF

Info

Publication number
KR101540539B1
KR101540539B1 KR1020140077312A KR20140077312A KR101540539B1 KR 101540539 B1 KR101540539 B1 KR 101540539B1 KR 1020140077312 A KR1020140077312 A KR 1020140077312A KR 20140077312 A KR20140077312 A KR 20140077312A KR 101540539 B1 KR101540539 B1 KR 101540539B1
Authority
KR
South Korea
Prior art keywords
bit
gates
gate
bits
digit
Prior art date
Application number
KR1020140077312A
Other languages
Korean (ko)
Inventor
정기석
조걸
Original Assignee
한양대학교 산학협력단
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
Application filed by 한양대학교 산학협력단 filed Critical 한양대학교 산학협력단
Priority to KR1020140077312A priority Critical patent/KR101540539B1/en
Application granted granted Critical
Publication of KR101540539B1 publication Critical patent/KR101540539B1/en

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
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K19/00Logic circuits, i.e. having at least two inputs acting on one output; Inverting circuits
    • H03K19/20Logic circuits, i.e. having at least two inputs acting on one output; Inverting circuits characterised by logic function, e.g. AND, OR, NOR, NOT circuits

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Manipulation Of Pulses (AREA)
  • Logic Circuits (AREA)

Abstract

Disclosed is a magnitude comparator using a logic gate. The disclosed comparator, which compares N-bit binary data a and b, comprises: N AND gates which receive a Nth bit of the a and the b; (N-1) XNOR gates which receive Nth bit, except the least digit in the a and the b; and an OR gate which receives an output bit of the N AND gates. According to the disclosed invention, the binary data magnitude comparator can be implemented in much smaller area and reduce an operation which is required for a comparison operation.

Description

논리 게이트를 이용한 크기 비교기{Magnitude Comparator Using Logic Gates}[0001] Magnitude Comparator Using Logic Gates [

본 발명은 비교기에 관한 것으로서, 더욱 상세하게는 논리 게이트를 이용한 크기 비교기에 관한 것이다. The present invention relates to a comparator, and more particularly, to a size comparator using a logic gate.

이진 데이터의 크기를 비교하는 비교기는 다양한 디지털 회로에서 사용되는 회로로 값 정렬, 최소값, 최대값 찾기 등에 사용되고 있다. 비교기는 LDPC 디코더의 부호화 연산 중 최소합 알고리즘에도 사용된다. Comparators that compare the sizes of binary data are circuits used in various digital circuits, and are used to sort values, find minimum values, and find maximum values. The comparator is also used for the least sum algorithm during the encoding operation of the LDPC decoder.

최소합 알고리즘에서는 주어진 입력들 중에서 최소값과 그 다음으로 작은값들을 찾는 연산이 필요한데 이를 위해 많은 수의 비교기들을 필요로 한다. In the least sum algorithm, it is necessary to find the minimum value and the next smallest value among the given inputs, which requires a large number of comparators.

디코더뿐만 아니라 다양한 디지털 회로에서 많은 수의 비교기가 사용되기 때문에 비교기는 전체 디지털 회로의 속도, 전력 소모 및 면적에 상당한 영향을 미친다. Because a large number of comparators are used in various digital circuits as well as decoders, the comparator has a significant impact on the speed, power consumption and area of the entire digital circuit.

도 1은 종래의 일반적인 4비트 비교기를 도시한 도면이다. 1 is a diagram illustrating a conventional 4-bit comparator.

도 1을 참조하면, 종래의 일반적인 비교기는 이진 데이터 A, B에 대해 A=B임을 나타내는 EQ 신호, A>B임을 나타내는 GT 신호 및 A<B임을 나타내는 LT 신호를 출력한다. Referring to FIG. 1, a conventional general comparator outputs an EQ signal indicating A = B, a GT signal indicating A> B, and an LT signal indicating A < B, for binary data A and B, respectively.

이와 같은 비교기 구조는 정렬이나 최소값, 최대값을 찾는 회로에서는 비효율적일 수 있었는데, 정렬이나 최소값, 최대값을 찾는 회로에서는 GT 신호를 출력하는 것만으로 충분하기 때문이다. Such a comparator structure could be inefficient in a circuit that finds an alignment, a minimum value, and a maximum value. In a circuit that finds an alignment, a minimum value, and a maximum value, it is sufficient to output a GT signal.

또한, 종래의 비교기는 GT 신호만을 출력한다고 할지라도 많은 수의 논리 게이트를 필요로 하여 그 면적이 증가하고 많은 전력이 소모되는 문제점이 있었다. Further, even if the conventional comparator outputs only the GT signal, a large number of logic gates are required, which increases the area and consumes a lot of power.

발명은 작은 면적으로 구현될 수 있는 이진 데이터 크기 비교기를 제안한다. The invention proposes a binary data size comparator that can be implemented with a small area.

또한, 본 발명은 전력 소모를 감소시킬 수 있는 이진 데이터 크기 비교기를 제안한다. The present invention also proposes a binary data size comparator that can reduce power consumption.

상기한 목적을 달성하기 위해 본 발명의 일 실시예에 따르면, N비트의 이진 데이터 a 및 b를 비교하는 비교기로서, 상기 a 및 b의 N번째 자릿수의 비트를 각각 입력받는 N개의 AND 게이트; 상기 a 및 b에서 최하위 자릿수를 제외한 N번째 자릿수의 비트를 각각 입력받는 (N-1)개의 XNOR 게이트; 및 상기 N개의 AND 게이트들의 출력 비트를 입력받는 OR 게이트를 포함하는 비교기가 제공된다. According to an embodiment of the present invention, there is provided a comparator for comparing N bits of binary data a and b, comprising: N AND gates receiving N bits of the a and b bits, respectively; (N-1) XNOR gates receiving the bits of the N-th digit excluding the least significant digit from the a and b, respectively; And an OR gate receiving the output bits of the N AND gates.

상기 비교기는 상기 N개의 AND 게이트들의 입력단들 중 적어도 하나의 입력단에 각각 결합되는 N개의 인버터를 더 포함한다.The comparator further includes N inverters each coupled to at least one input of the N input AND gates.

상기 N개의 AND 게이트들 중 제1 AND 게이트에는 a 및 b의 최상위 자릿수 비트가 입력되며, 제N AND 게이트에는 a 및 b의 N번째 자릿수 비트들과 제1 XNOR 게이트 내지 제(N-1) XNOR 게이트의 출력 비트가 입력된다. The most significant bit of a and b are input to the first AND gate of the N AND gates. The Nth AND gate of a and b and the first XNOR gate to (N-1) XNOR The output bit of the gate is input.

상기 (N-1)개의 XNOR 게이트들은 상기 a 및 b에서 N번째 자릿수의 비트들이 동일한지 여부를 나타내는 비트를 출력한다.The (N-1) XNOR gates output a bit indicating whether the N-th bit of the bits a and b are the same.

상기 N개의 AND 게이트들은 a 및 b에서 (N-1)번째 자릿수까지 비트가 동일하고 a의 N번째 자릿수의 비트가 b의 N번째 자릿수의 비트보다 클 경우 미리 설정된 비트를 출력한다.The N AND gates output a predetermined bit if the bits are the same up to the (N-1) th digit in a and b and the N-th bit of a is greater than the N-th bit of b.

상기 OR 게이트는 상기 N개의 AND 게이트들 중 적어도 하나가 a의 N번째 자릿수 비트가 b보다 크다는 것을 의미하는 비트를 출력할 경우 a가 b보다 큰 것을 의미하는 비트를 출력한다.The OR gate outputs a bit indicating that a is greater than b when at least one of the N AND gates outputs a bit indicating that the N-th order bit of a is larger than b.

본 발명의 다른 측면에 따르면, N비트의 이진 데이터 a 및 b를 비교하는 비교기로서, 상기 a 및 b의 N번째 자릿수의 비트를 각각 입력받는 N개의 NAND 게이트; 상기 a 및 b에서 최하위 자릿수를 제외한 N번째 자릿수의 비트를 각각 입력받는 (N-1)개의 XNOR 게이트; 및 상기 N개의 NAND 게이트들의 출력 비트를 입력받는 NAND 게이트를 포함하는 비교기가 제공된다. According to another aspect of the present invention, there is provided a comparator for comparing binary data a and b of N bits, comprising: N NAND gates receiving N bits of bits a and b respectively; (N-1) XNOR gates receiving the bits of the N-th digit excluding the least significant digit from the a and b, respectively; And a NAND gate receiving the output bits of the N NAND gates.

상기 비교기는 상기 N개의 NAND 게이트들의 입력단들 중 적어도 하나의 입력단에 각각 결합되는 N개의 인버터를 더 포함한다.The comparator further includes N inverters each coupled to at least one of the inputs of the N NAND gates.

상기 N개의 NAND 게이트들 중 제1 NAND 게이트에는 a 및 b의 최상위 자릿수 비트가 입력되며, 제N NAND 게이트에는 a 및 b의 N번째 자릿수 비트들과 제1 XNOR 게이트 내지 제(N-1) XNOR 게이트의 출력 비트가 입력된다. The most significant bits of a and b are input to the first NAND gate of the N NAND gates, and the N-th NOR gate of a and b and the first XNOR gate to (N-1) XNOR The output bit of the gate is input.

상기 (N-1)개의 XNOR 게이트들은 상기 a 및 b에서 N번째 자릿수의 비트들이 동일한지 여부를 나타내는 비트를 출력한다.The (N-1) XNOR gates output a bit indicating whether the N-th bit of the bits a and b are the same.

상기 N개의 NAND 게이트들은 a 및 b에서 (N-1)번째 자릿수까지 비트가 동일하고 a의 N번째 자릿수의 비트가 b의 N번째 자릿수의 비트보다 클 경우 미리 설정된 비트를 출력한다.The N NAND gates output predetermined bits when the bits from a and b to the (N-1) th digit are the same and the N-th bit of a is larger than the N-th bit of b.

상기 N개의 NAND 게이트들의 출력을 입력받는 NAND 게이트는 상기 N개의 NAND 게이트들 중 적어도 하나가 a의 N번째 자릿수 비트가 b보다 크다는 것을 의미하는 비트를 출력할 경우 a가 b보다 큰 것을 의미하는 비트를 출력한다.A NAND gate receiving the output of the N NAND gates outputs a bit indicating that a is greater than b when at least one of the N NAND gates outputs a bit indicating that the Nth order bit of a is larger than b .

본 발명에 의하면, 이진 데이터 크기 비교기가 보다 작은 면적으로 구현될 수 있으며, 비교 연산에 소요되는 연산을 절감할 수 있는 장점이 있다. According to the present invention, the binary data size comparator can be implemented with a smaller area, and there is an advantage that the operation required for the comparison operation can be reduced.

도 1은 종래의 일반적인 4비트 비교기를 도시한 도면.
도 2는 종래의 일반적인 비교기 회로에서 GT(Greater Than) 신호만을 출력하는 회로 부분을 나타낸 도면.
도 3은 본 발명이 일 실시예에 따른 비교기의 구조를 도시한 도면.
도 4는 본 발명의 일 실시예에 따른 2비트 비교기에서 제1 AND 게이트의 동작 및 출력값을 도시한 도면.
도 5는 본 발명의 일 실시예에 따른 2비트 비교기에서 XNOR 게이트의 동작 및 출력값을 도시한 도면.
도 6은 본 발명의 일 실시예에 따른 2비트 비교기에서 제2 AND 게이트의 동작 및 출력값을 도시한 도면.
도 7은 본 발명의 일 실시예에 따른 4비트 비교기의 구조를 도시한 도면.
도 8은 본 발명의 일 실시예에 따른 8비트 비교기의 구조를 도시한 도면.
도 9는 본 발명의 다른 실시예에 따른 4비트 비교기의 구조를 도시한 도면.
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a diagram illustrating a conventional 4-bit comparator. FIG.
Fig. 2 is a circuit diagram showing a circuit section for outputting only a GT (Greater Than) signal in a conventional comparator circuit. Fig.
3 is a diagram illustrating the structure of a comparator according to an embodiment of the present invention.
4 illustrates operation and output values of a first AND gate in a 2-bit comparator according to one embodiment of the present invention.
5 illustrates operation and output values of an XNOR gate in a 2-bit comparator in accordance with an embodiment of the present invention.
6 illustrates the operation and output values of a second AND gate in a 2-bit comparator in accordance with an embodiment of the present invention.
FIG. 7 illustrates a structure of a 4-bit comparator according to an embodiment of the present invention; FIG.
8 illustrates a structure of an 8-bit comparator according to an embodiment of the present invention.
9 is a diagram illustrating a structure of a 4-bit comparator according to another embodiment of the present invention.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다. While the invention is susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will herein be described in detail. It should be understood, however, that the invention is not intended to be limited to the particular embodiments, but includes all modifications, equivalents, and alternatives falling within the spirit and scope of the invention. Like reference numerals are used for like elements in describing each drawing.

이하에서, 본 발명에 따른 실시예들을 첨부된 도면을 참조하여 상세하게 설명한다.Hereinafter, embodiments according to the present invention will be described in detail with reference to the accompanying drawings.

도 2는 종래의 일반적인 비교기 회로에서 GT(Greater Than) 신호만을 출력하는 회로 부분을 나타낸 도면이다. FIG. 2 is a diagram showing a circuit section for outputting only a GT (Greater Than) signal in a conventional general comparator circuit.

도 2는 2비트 신호의 크기를 비교하기 위한 회로로서, 도 2를 참조하면, 종래의 일반적인 비교기 회로에서 GT(Greater Than) 신호만을 출력하는 회로 부분은 입력 2비트 신호가 입력되는 4개의 AND 게이트(200, 202, 204, 206), AND 게이트들(200, 202, 204, 206)의 출력신호를 입력받는 2개의 OR 게이트(210, 212), OR 게이트들(210, 212)의 출력 신호를 입력받는 AND 게이트(220) 및 OR 게이트(230)를 포함한다. FIG. 2 is a circuit for comparing the magnitudes of 2-bit signals. Referring to FIG. 2, in a conventional general comparator circuit, a circuit portion for outputting only a GT (Greater Than) signal includes four AND gates The output signals of the OR gates 210 and 212 and the OR gates 210 and 212 receiving the output signals of the AND gates 200, 202, 204, And includes an AND gate 220 and an OR gate 230 receiving an input.

종래의 일반적인 비교기 회로는 GT 신호만을 출력한다고 할지라도 다수의 AND 게이트 및 OR 게이트를 구비하고 있어 그 면적이 크고 많은 전력이 소모되는 문제점이 있었다. The conventional general comparator circuit has a plurality of AND gates and OR gates even though it outputs only a GT signal, which has a problem that the area is large and power is consumed.

도 3은 본 발명이 일 실시예에 따른 비교기의 구조를 도시한 도면이다. 3 is a diagram illustrating a structure of a comparator according to an embodiment of the present invention.

도 3의 비교기는 2비트 신호의 크기를 비교하기 위한 회로로서, 두 개의 AND 게이트(300, 302), XNOR 게이트(304), OR 게이트(306) 및 두 개의 인버터(310, 312)를 포함한다. 3 includes two AND gates 300 and 302, an XNOR gate 304, an OR gate 306 and two inverters 310 and 312 for comparing the magnitudes of the 2-bit signals .

도 3에 도시된 본 발명의 일 실시예에 따른 비교기는 GT(Greater Than) 신호만을 출력하는 비교기로서, 이진 데이터 a와 b를 비교할 때 a가 크면 이진 비트 중 1을 출력하도록 동작한다. The comparator shown in FIG. 3 is a comparator that outputs only a GT (Greater Than) signal. When comparing a binary data a and b, it operates to output one of the binary bits if a is large.

도 3에 도시된 본 발명의 일 실시예에 따른 비교기는 도 2에 도시된 종래의 비교기와 비교할 때 논리 게이트의 숫자가 현저하게 줄어든 것을 확인할 수 있으며, 줄어든 논리 게이트의 숫자로 인해 비교기 회로의 면적을 줄이고 비교 연산에 소요되는 전력을 절감할 수 있는 장점이 있다. The comparator according to an embodiment of the present invention shown in FIG. 3 has a significantly reduced number of logic gates compared to the conventional comparator shown in FIG. 2, And the power required for the comparison operation can be reduced.

이하에서는 도 3에 도시된 바와 같은 본 발명의 비교기의 동작 구조를 상세히 설명한다. Hereinafter, the operation structure of the comparator of the present invention as shown in FIG. 3 will be described in detail.

도 4는 본 발명의 일 실시예에 따른 2비트 비교기에서 제1 AND 게이트의 동작 및 출력값을 도시한 도면이다. 4 is a diagram illustrating operation and output values of a first AND gate in a 2-bit comparator according to an embodiment of the present invention.

도 4를 참조하면, 제1 AND 게이트(300)로는 두 개의 이진 데이터 a, b 중 a의 최상위 자릿수 비트인 a[1]과 b의 최상위 자릿수 비트인 b[1]이 각각 입력되며, b의 최상위 자릿수 비트 b[1]은 제1 인버터(310)에 의해 반전되어 입력된다. Referring to FIG. 4, the most significant bit a [1] of a of the two binary data a and b and the most significant bit b [1] of b are input to the first AND gate 300, The most significant digit bit b [1] is inverted by the first inverter 310 and input.

도 4를 참조하면, 제1 AND 게이트(300)는 a의 최상위 자릿수 비트인 a[1]이 1이고 b의 최상위 비트인 b[1]이 0인 경우에만 1을 출력한다. 제1 AND 게이트(300)는 a[1]과 b[1]이 동일하거나 b[1]이 1이고 a[1]이 0인 경우에는 0을 출력한다. Referring to FIG. 4, the first AND gate 300 outputs 1 only when a [1], which is the most significant bit of a, is 1 and b [1], which is the most significant bit of b, is 0. The first AND gate 300 outputs 0 when a [1] and b [1] are the same or b [1] is 1 and a [1] is 0.

즉, 제1 AND 게이트(300)는 a[1] > b[1]인 경우에만 1을 출력하게 된다. That is, the first AND gate 300 outputs 1 only when a [1]> b [1].

도 5는 본 발명의 일 실시예에 따른 2비트 비교기에서 XNOR 게이트의 동작 및 출력값을 도시한 도면이다. 5 is a diagram illustrating operation and output values of an XNOR gate in a 2-bit comparator according to an embodiment of the present invention.

도 5를 참조하면, XNOR 게이트(304) 신호 a, b 중 a, b의 최상위 비트인 a[1] 및 b[1]이 입력된다. XNOR 게이트는 a[1]이 0이고 b[1]이 0인 경우 및 a[1]이 1이고 b[1]이 1인 경우에 1을 출력한다. 5, a [1] and b [1], which are the most significant bits of a and b, of XNOR gate 304 signals a and b are input. The XNOR gate outputs 1 when a [1] is 0, b [1] is 0, and a [1] is 1 and b [1] is 1.

XNOR 게이트(304)는 a[1]과 b[1]이 다를 경우에는 0을 출력하고, a[1]과 b[1]이 동일한 경우에만 1을 출력하는 것이다. The XNOR gate 304 outputs 0 when a [1] and b [1] are different, and outputs 1 only when a [1] and b [1] are the same.

도 6은 본 발명의 일 실시예에 따른 2비트 비교기에서 제2 AND 게이트의 동작 및 출력값을 도시한 도면이다. 6 is a diagram illustrating operation and output values of a second AND gate in a 2-bit comparator according to an embodiment of the present invention.

도 6을 참조하면, 제2 AND 게이트(302)로는 XNOR 게이트(304)의 출력 및 두 개의 신호 a, b 중 최하위 자릿수 비트인 a[0]와 b[0]가 입력된다. 이때, b[0]는 제2 인버터(312)에 의해 반전된 값이 제2 AND 게이트(302)로 입력된다. Referring to FIG. 6, the output of the XNOR gate 304 and a [0] and b [0], which are the least significant bits of the two signals a and b, are input to the second AND gate 302. At this time, the value inverted by the second inverter 312 is inputted to the second AND gate 302 of b [0].

제2 AND 게이트(302)는 XNOR 게이트의 출력이 1이고 a[0]의 값이 1이며, b[0]의 값이 0인 경우에만 1을 출력한다. 즉, 제2 AND 게이트(302)는 최상위 자릿수 비트 값이 동일하고 최하위 비트에서 a[0]가 b[0]보다 클 경우 1을 출력하는 것이다. The second AND gate 302 outputs 1 only when the output of the XNOR gate is 1, the value of a [0] is 1, and the value of b [0] is 0. That is, the second AND gate 302 outputs 1 when the most significant bit value is the same and a [0] is greater than b [0] in the least significant bit.

결국, 제1 AND 게이트(300)는 이진 데이터 a, b 중 a의 최상위 비트가 b의 최상위 비트보다 클 경우 1을 출력하고, 제2 AND 게이트(302)는 a, b의 최상위 비트가 동일하고 a의 최하위 비트가 b의 최하위 비트보다 클 경우 1을 출력하는 것이다. As a result, the first AND gate 300 outputs 1 when the most significant bit of a in the binary data a and b is larger than the most significant bit of b, and the second AND gate 302 outputs and outputs 1 when the least significant bit of a is larger than the least significant bit of b.

제1 AND 게이트(300) 또는 제2 AND 게이트(302)에서 1이 출력되는 경우가 a가 b보다 큰 경우이다. OR 게이트(306)는 제1 AND 게이트(300) 또는 제2 AND 게이트(302) 중 어느 하나의 출력이 1인 경우에 1을 출력하여 a가 b보다 클 때 1을 출력하게 된다. The case where a is outputted from the first AND gate 300 or the second AND gate 302 is a case where a is greater than b. The OR gate 306 outputs 1 when the output of either the first AND gate 300 or the second AND gate 302 is 1, and outputs 1 when a is greater than b.

도 7은 본 발명의 일 실시예에 따른 4비트 비교기의 구조를 도시한 도면이다. 7 is a diagram illustrating a structure of a 4-bit comparator according to an embodiment of the present invention.

도 7을 참조하면, 본 발명의 일 실시예에 따른 4비트 비교기는 다수의 AND 게이트(700, 702, 704, 706), 다수의 XNOR 게이트(710, 712, 714), OR 게이트(720) 및 다수의 인버터(730, 732, 734, 736)를 포함한다. 7, a 4-bit comparator according to an embodiment of the present invention includes a plurality of AND gates 700, 702, 704 and 706, a plurality of XNOR gates 710, 712 and 714, an OR gate 720, And includes a plurality of inverters 730, 732, 734, and 736.

도 7을 참조하면, AND 게이트들(700, 702, 704, 706)은 4비트 비교기에서 이진 데이터 a, b의 각 N번째 자릿수 비트의 비트값을 비교한 결과를 출력한다. 또한 각 AND 게이트에서 b 신호가 입력되는 단자에는 인버터(730, 732, 734, 736)가 결합된다. Referring to FIG. 7, the AND gates 700, 702, 704 and 706 output the result of comparing the bit values of the N-th order bits of the binary data a and b in the 4-bit comparator. Inverters 730, 732, 734, and 736 are coupled to terminals to which the b signal is input in each AND gate.

제1 AND 게이트(700)는 최상위 자릿수 비트의 비트값을 비교한 결과를 출력하며, a의 최상위 비트 a[3]가 b의 최상위 비트 b[3]보다 클 경우 1을 출력한다. The first AND gate 700 outputs the result of comparing the bit values of the most significant bits and outputs 1 when the most significant bit a [3] of a is larger than the most significant bit b [3] of b.

제2 AND 게이트(702)는 2번째 자릿수의 a 데이터 비트와 2번째 자릿수의 b 데이터 비트를 입력받아 2번째 자릿수의 a 데이터 비트인 a[2]가 2번째 자릿수의 b 데이터 비트인 b[2]보다 크며 최상위 자릿수의 비트가 동일할 경우 1을 출력한다. The second AND gate 702 receives a second data bit a and a second data b data bit and receives a second data bit a [2] as a second data bit b [2 ] And outputs 1 when the most significant bit is the same.

제3 AND 게이트(704)는 3번째 자릿수의 a 데이터 비트와 3번째 자릿수의 b 데이터 비트를 입력받아 3번째 자릿수의 a 데이터 비트인 a[1]이 3번째 자릿수의 b 데이터 비트인 b[1]보다 크며 상위 자릿수(첫번째 및 2번째)의 비트가 동일할 경우 1을 출력한다. The third AND gate 704 receives the a data bit of the third digit and the b data bit of the third digit and receives a [1] a data bit of the third digit is b [1 ] And outputs 1 when the bits of the high order (first and second) bits are the same.

제4 AND 게이트(706)는 4번째 자릿수의 a 데이터 비트와 4번째 자릿수의 b 데이터 비트를 입력받아 4번째 자릿수의 a 데이터 비트인 a[0]가 4번째 자릿수의 b 데이터 비트인 b[0]보다 크며 상위 자릿수(첫번째, 2번째 및 3번째)의 비트가 동일할 경우 1을 출력한다. The fourth AND gate 706 receives the a data bit of the fourth digit and the b data bit of the fourth digit and receives a [0], a data bit of the fourth digit, from the b data bit b [0] of the fourth digit ] And outputs 1 when the bits of the high order (first, second and third) bits are the same.

세 개의 XNOR 게이트들(710, 712, 714)은 최하위 자릿수를 제외한 (2-4)번째 자릿수의 비트가 동일한지 여부에 대한 신호를 출력한다. 제1 XNOR 게이트는 a 데이터의 최상위(첫번째 자릿수) 비트 a[3]와 b 데이터의 최상위(첫번째 자릿수) 비트 b[3]가 동일할 경우 1을 출력하며, 동일하지 않을 경우 0을 출력한다. The three XNOR gates 710, 712, and 714 output a signal as to whether or not the bits of the (2-4) th digits except the least significant digit are the same. The first XNOR gate outputs 1 when the highest (first digit) bit a [3] of a data is the same as the highest (first digit) bit b [3] of b data, and outputs 0 when it is not the same.

제2 XNOR 게이트(712)는 a 데이터의 2번째 자릿수 비트 a[2]와 b 데이터의 2번째 자릿수 비트 b[2]가 동일할 경우 1을 출력하며, 동일하지 않을 경우 0을 출력한다. The second XNOR gate 712 outputs 1 when the second digit bit a [2] of the a data is the same as the second digit bit b [2] of the b data, and outputs 0 when it is not the same.

제3 XNOR 게이트(714)는 a 데이터의 3번째 자릿수 비트 a[1]과 b 데이터의 3번째 자릿수 비트 b[1]이 동일할 경우 1을 출력하며, 동일하지 않을 경우 0을 출력한다. The third XNOR gate 714 outputs 1 if the third bit a [1] of the a data is the same as the third bit b [1] of the b data, and outputs 0 if it is not the same.

제1 XNOR 게이트 내지 제3 XNOR 게이트(710, 712, 714)의 출력값은 각각 제2 AND 게이트 내지 제4 AND 게이트(702, 704, 706)로 입력된다. 제1 XNOR 게이트 내지 제3 XNOR 게이트(710, 712, 714)의 출력값이 1이어야, 제2 AND 게이트 내지 제4 AND 게이트(702, 704, 706)은 1을 출력할 수 있다. The output values of the first to third XNOR gates 710, 712, and 714 are input to the second to fourth AND gates 702, 704, and 706, respectively. The second to fourth AND gates 702, 704 and 706 can output 1 if the output values of the first to third XNOR gates 710, 712 and 714 are 1, respectively.

제1 AND 게이트 내지 제4 AND 게이트(700, 702, 704, 706)의 출력값들 중 적어도 하나가 1일 경우 a가 b보다 크다는 것을 의미하며, 제1 AND 게이트 내지 제4 AND 게이트(700, 702, 704, 706)의 출력값들은 OR 게이트(720)로 입력된다. If at least one of the output values of the first to fourth AND gates 700, 702, 704, and 706 is 1, it means that a is greater than b, and the first to fourth AND gates 700 and 702 , 704, and 706 are input to the OR gate 720.

OR 게이트(720)는 제1 AND 게이트 내지 제4 AND 게이트(700, 702, 704, 706) 중 적어도 하나가 1을 출력할 경우 1을 출력한다. The OR gate 720 outputs 1 when at least one of the first to fourth AND gates 700, 702, 704, and 706 outputs 1.

도 8은 본 발명의 일 실시예에 따른 8비트 비교기의 구조를 도시한 도면이다. 8 is a diagram illustrating a structure of an 8-bit comparator according to an embodiment of the present invention.

도 8을 참조하면, 8비트 비교기는 8개의 AND 게이트들과, 7개의 XNOR 게이트들, 하나의 OR 게이트 및 8개의 인버터를 포함한다. Referring to FIG. 8, an 8-bit comparator includes eight AND gates, seven XNOR gates, one OR gate, and eight inverters.

도 8에 도시된 8비트 비교기는 4비트 비교기와 비교할 때 더 많은 수의 비트를 비교하기 위해 AND 게이트 및 XNOR 게이트가 4개 더 추가된 구조라는 점을 확인할 수 있다. It can be seen that the 8-bit comparator shown in FIG. 8 is a structure in which four AND gates and XNOR gates are added to compare a larger number of bits as compared with a 4-bit comparator.

각 AND 게이트들은 해당 자릿수의 비트값을 비교하여 a가 더 크고 상위 자릿수의 비트값이 동일할 경우 1을 출력한다. 각 XNOR 게이트들은 해당 자릿수의 비트값이 동일할 경우 1을 출력한다. Each AND gate compares the bit value of the corresponding digit and outputs 1 when a is larger and the bit value of the higher digit is the same. Each XNOR gate outputs 1 if the bit value of the corresponding digit is the same.

OR 게이트는 다수의 AND 게이트 중 적어도 하나가 1을 출력할 경우 a가 b보다 더 크다는 것을 의미하는 1을 출력한다. The OR gate outputs 1, which means that if at least one of the plurality of AND gates outputs 1, a is greater than b.

도 9는 본 발명의 다른 실시예에 따른 4비트 비교기의 구조를 도시한 도면이다. 9 is a diagram illustrating a structure of a 4-bit comparator according to another embodiment of the present invention.

도 9에 도시된 4비트 비교기는 도 7에 도시된 4비트 비교기에서 AND 게이트들 및 OR 게이트를 NAND 게이트로 치환한 구조를 가진다. The 4-bit comparator shown in FIG. 9 has a structure in which AND gates and OR gates are replaced with NAND gates in the 4-bit comparator shown in Fig.

도 9를 참조하면, 본 발명의 다른 실시예에 따른 4비트 비교기는 a 데이터와 b 데이터에서 각 자릿수의 비트가 입력되는 제1 내지 제4 NAND 게이트(1000, 1002, 1004), 다수의 XNOR 게이트(1010, 1012, 1014), 제1 내지 제4 NAND 게이트들(1000, 1002, 1004, 1006)의 출력 신호가 입력되는 제5 NAND 게이트(1020) 및 다수의 인버터(1030, 1032, 1034, 1036)를 포함한다. 9, a 4-bit comparator according to another embodiment of the present invention includes first to fourth NAND gates 1000, 1002, and 1004 to which bits of each digit are input in a data and b data, a plurality of XNOR gates A fifth NAND gate 1020 to which the output signals of the first to fourth NAND gates 1000, 1002, 1004 and 1006 are inputted and a plurality of inverters 1030, 1032, 1034 and 1036 ).

제1 NAND 게이트 내지 제4 NAND 게이트(1000, 1002, 1004, 1006)로는 a 및 b의 각 N번째 자릿수 비트가 입력된다. 제1 NAND 게이트로는 최상위 자릿수(첫번째 자리수)의 비트가 입력되며, 제2 NAND 게이트로는 2번째 자릿수의 비트가 입력된다. Nth order bits of a and b are input to the first to fourth NAND gates 1000, 1002, 1004, and 1006, respectively. The most significant digit (first digit) is input to the first NAND gate, and the second digit is input to the second NAND gate.

제1 내지 제4 인버터(1030, 1032, 1034, 1036)는 각 NAND 게이트(1000, 1002, 1004, 1006)로 입력되는 b 데이터 비트의 값을 반전시킨다. The first to fourth inverters 1030, 1032, 1034 and 1036 invert the values of the b data bits input to the NAND gates 1000, 1002, 1004 and 1006, respectively.

제1 XNOR 게이트 내지 제3 XNOR 게이트(1010, 1012, 1014)로는 a 및 b의 N번째 자릿수 비트가 입력된다. 제1 XNOR 게이트 내지 제3 XNOR 게이트(1010, 1012, 1014)는 각 자릿수의 a 및 b 데이터 비트가 동일할 경우 1을 출력한다. Nth order bits of a and b are input to the first to third XNOR gates 1010, 1012, and 1014. The first to third XNOR gates 1010, 1012, and 1014 output 1 when the a and b data bits of each digit are the same.

제1 내지 제4 NAND 게이트들(1000, 1002, 1004, 1006)은 각 자릿수 비트에서 a가 b보다 더 클 경우 0을 출력한다. The first through fourth NAND gates 1000, 1002, 1004, and 1006 output 0 when a is greater than b at each digit.

제1 내지 제4 NAND 게이트들의 출력이 입력되는 NAND 게이트(1020)는 a가 b보다 더 클 경우 1을 출력한다. The NAND gate 1020 receiving the outputs of the first through fourth NAND gates outputs 1 when a is greater than b.

이상과 같이 본 발명에서는 구체적인 구성 요소 등과 같은 특정 사항들과 한정된 실시예 및 도면에 의해 설명되었으나 이는 본 발명의 보다 전반적인 이해를 돕기 위해서 제공된 것일 뿐, 본 발명은 상기의 실시예에 한정되는 것은 아니며, 본 발명이 속하는 분야에서 통상적인 지식을 가진 자라면 이러한 기재로부터 다양한 수정 및 변형이 가능하다. 따라서, 본 발명의 사상은 설명된 실시예에 국한되어 정해져서는 아니되며, 후술하는 특허청구범위뿐 아니라 이 특허청구범위와 균등하거나 등가적 변형이 있는 모든 것들은 본 발명 사상의 범주에 속한다고 할 것이다.As described above, the present invention has been described with reference to particular embodiments, such as specific elements, and specific embodiments and drawings. However, it should be understood that the present invention is not limited to the above- And various modifications and changes may be made thereto by those skilled in the art to which the present invention pertains. Accordingly, the spirit of the present invention should not be construed as being limited to the embodiments described, and all of the equivalents or equivalents of the claims, as well as the following claims, belong to the scope of the present invention .

Claims (12)

N비트의 이진 데이터 a 및 b를 비교하는 비교기로서,
상기 a 및 b의 N번째 자릿수의 비트를 각각 입력받는 N개의 AND 게이트;
상기 a 및 b에서 최하위 자릿수를 제외한 N번째 자릿수의 비트를 각각 입력받는 (N-1)개의 XNOR 게이트; 및
상기 N개의 AND 게이트들의 출력 비트를 입력받는 OR 게이트를 포함하는 것을 특징으로 하는 비교기.
A comparator for comparing binary data a and b of N bits,
N AND gates receiving N bits of bits a and b respectively;
(N-1) XNOR gates receiving the bits of the N-th digit excluding the least significant digit from the a and b, respectively; And
And an OR gate receiving an output bit of the N AND gates.
제1항에 있어서,
상기 N개의 AND 게이트들의 입력단들 중 적어도 하나의 입력단에 각각 결합되는 N개의 인버터를 더 포함하는 것을 특징으로 하는 비교기.
The method according to claim 1,
Further comprising N inverters each coupled to at least one of the inputs of the N AND gates.
제1항에 있어서,
상기 N개의 AND 게이트들 중 제1 AND 게이트에는 a 및 b의 최상위 자릿수 비트가 입력되며, 제N AND 게이트에는 a 및 b의 N번째 자릿수 비트들과 제1 XNOR 게이트 내지 제(N-1) XNOR 게이트의 출력 비트가 입력되는 것을 특징으로 하는 비교기.
The method according to claim 1,
The most significant bit of a and b are input to the first AND gate of the N AND gates. The Nth AND gate of a and b and the first XNOR gate to (N-1) XNOR And the output bit of the gate is input.
제1항에 있어서,
상기 (N-1)개의 XNOR 게이트들은 상기 a 및 b에서 N번째 자릿수의 비트들이 동일한지 여부를 나타내는 비트를 출력하는 것을 특징으로 하는 비교기.
The method according to claim 1,
Wherein the (N-1) XNOR gates output a bit indicating whether the bits of the N-th digit in the a and b are the same.
제4항에 있어서,
상기 N개의 AND 게이트들은 a 및 b에서 (N-1)번째 자릿수까지 비트가 동일하고 a의 N번째 자릿수의 비트가 b의 N번째 자릿수의 비트보다 클 경우 미리 설정된 비트를 출력하는 것을 특징으로 하는 비교기.
5. The method of claim 4,
Wherein the N AND gates output a predetermined bit when the bits are the same up to the (N-1) th digit in a and b and the Nth digit bit of a is larger than the Nth digit bit of b Comparator.
제5항에 있어서,
상기 OR 게이트는 상기 N개의 AND 게이트들 중 적어도 하나가 a의 N번째 자릿수 비트가 b보다 크다는 것을 의미하는 비트를 출력할 경우 a가 b보다 큰 것을 의미하는 비트를 출력하는 것을 특징으로 하는 비교기.
6. The method of claim 5,
Wherein the OR gate outputs a bit that indicates that a is greater than b when at least one of the N AND gates outputs a bit that signifies that the Nth digit bit of a is greater than b.
N비트의 이진 데이터 a 및 b를 비교하는 비교기로서,
상기 a 및 b의 N번째 자릿수의 비트를 각각 입력받는 N개의 NAND 게이트;
상기 a 및 b에서 최하위 자릿수를 제외한 N번째 자릿수의 비트를 각각 입력받는 (N-1)개의 XNOR 게이트; 및
상기 N개의 NAND 게이트들의 출력 비트를 입력받는 NAND 게이트를 포함하는 것을 특징으로 하는 비교기.
A comparator for comparing binary data a and b of N bits,
N NAND gates receiving N bits of bits a and b, respectively;
(N-1) XNOR gates receiving the bits of the N-th digit excluding the least significant digit from the a and b, respectively; And
And a NAND gate receiving an output bit of the N NAND gates.
제7항에 있어서,
상기 N개의 NAND 게이트들의 입력단들 중 적어도 하나의 입력단에 각각 결합되는 N개의 인버터를 더 포함하는 것을 특징으로 하는 비교기.
8. The method of claim 7,
Further comprising N inverters coupled to at least one of the inputs of the N NAND gates, respectively.
제7항에 있어서,
상기 N개의 NAND 게이트들 중 제1 NAND 게이트에는 a 및 b의 최상위 자릿수 비트가 입력되며, 제N NAND 게이트에는 a 및 b의 N번째 자릿수 비트들과 제1 XNOR 게이트 내지 제(N-1) XNOR 게이트의 출력 비트가 입력되는 것을 특징으로 하는 비교기.
8. The method of claim 7,
The most significant bits of a and b are input to the first NAND gate of the N NAND gates, and the N-th NOR gate of a and b and the first XNOR gate to (N-1) XNOR And the output bit of the gate is input.
제1항에 있어서,
상기 (N-1)개의 XNOR 게이트들은 상기 a 및 b에서 N번째 자릿수의 비트들이 동일한지 여부를 나타내는 비트를 출력하는 것을 특징으로 하는 비교기.
The method according to claim 1,
Wherein the (N-1) XNOR gates output a bit indicating whether the bits of the N-th digit in the a and b are the same.
제10항에 있어서,
상기 N개의 NAND 게이트들은 a 및 b에서 (N-1)번째 자릿수까지 비트가 동일하고 a의 N번째 자릿수의 비트가 b의 N번째 자릿수의 비트보다 클 경우 미리 설정된 비트를 출력하는 것을 특징으로 하는 비교기.
11. The method of claim 10,
Wherein the N NAND gates are configured to output a predetermined bit when the bits are the same up to the (N-1) th digit in a and b and the N-th bit of a is greater than the N-th bit of b. Comparator.
제11항에 있어서,
상기 N개의 NAND 게이트들의 출력을 입력받는 NAND 게이트는 상기 N개의 NAND 게이트들 중 적어도 하나가 a의 N번째 자릿수 비트가 b보다 크다는 것을 의미하는 비트를 출력할 경우 a가 b보다 큰 것을 의미하는 비트를 출력하는 것을 특징으로 하는 비교기.
















12. The method of claim 11,
A NAND gate receiving the output of the N NAND gates outputs a bit indicating that a is greater than b when at least one of the N NAND gates outputs a bit indicating that the Nth order bit of a is larger than b And outputs the comparison result.
















KR1020140077312A 2014-06-24 2014-06-24 Magnitude Comparator Using Logic Gates KR101540539B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020140077312A KR101540539B1 (en) 2014-06-24 2014-06-24 Magnitude Comparator Using Logic Gates

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020140077312A KR101540539B1 (en) 2014-06-24 2014-06-24 Magnitude Comparator Using Logic Gates

Publications (1)

Publication Number Publication Date
KR101540539B1 true KR101540539B1 (en) 2015-07-31

Family

ID=53877338

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020140077312A KR101540539B1 (en) 2014-06-24 2014-06-24 Magnitude Comparator Using Logic Gates

Country Status (1)

Country Link
KR (1) KR101540539B1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2762621C1 (en) * 2020-10-28 2021-12-21 федеральное государственное бюджетное образовательное учреждение высшего образования "Ульяновский государственный технический университет" Binary number comparison device
WO2023025829A1 (en) 2021-08-27 2023-03-02 International Business Machines Corporation True complement dynamic circuit and method for combining binary data
US11881853B2 (en) 2021-08-27 2024-01-23 International Business Machines Corporation True complement dynamic circuit and method for combining binary data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR930005361A (en) * 1991-08-16 1993-03-23 김광호 Serial comparator
JPH11102284A (en) * 1997-09-26 1999-04-13 Sony Corp Method and circuit for selection
KR19990070858A (en) * 1998-02-25 1999-09-15 구본준 Comparator
KR20040019193A (en) * 2002-08-26 2004-03-05 삼성전자주식회사 High speed binary comparator circuit and High speed binary data comparison method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR930005361A (en) * 1991-08-16 1993-03-23 김광호 Serial comparator
JPH11102284A (en) * 1997-09-26 1999-04-13 Sony Corp Method and circuit for selection
KR19990070858A (en) * 1998-02-25 1999-09-15 구본준 Comparator
KR20040019193A (en) * 2002-08-26 2004-03-05 삼성전자주식회사 High speed binary comparator circuit and High speed binary data comparison method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2762621C1 (en) * 2020-10-28 2021-12-21 федеральное государственное бюджетное образовательное учреждение высшего образования "Ульяновский государственный технический университет" Binary number comparison device
WO2023025829A1 (en) 2021-08-27 2023-03-02 International Business Machines Corporation True complement dynamic circuit and method for combining binary data
US11881853B2 (en) 2021-08-27 2024-01-23 International Business Machines Corporation True complement dynamic circuit and method for combining binary data

Similar Documents

Publication Publication Date Title
JP2009232461A (en) Method and apparatus for reducing crosstalk on bus, and method for converting dataword into codeword
Kong et al. Efficient sorting architecture for successive-cancellation-list decoding of polar codes
US20070025146A1 (en) Sensing circuit for multi-level flash memory
US10879907B2 (en) Gray code counter
KR101540539B1 (en) Magnitude Comparator Using Logic Gates
US8234320B1 (en) Bitwise comparator for selecting two smallest numbers from a set of numbers
KR0156152B1 (en) Maximum value selecting circuit
US20200004501A1 (en) Analog Sorter
CN103746698A (en) Analog-digital converter
US5321640A (en) Priority encoder and method of operation
US7550997B2 (en) 4-level logic decoder
US8185572B2 (en) Data correction circuit
US7352275B2 (en) Device for comparing two words of n bits each
US8005880B2 (en) Half width counting leading zero circuit
Chen et al. An image recognition processor with time-domain accelerators using efficient time encoding and non-linear logic operation
US7221188B2 (en) Logic circuitry
CN102064836B (en) Special comparing unit and low density parity check (LDPC) code check node arithmetic circuit
CN111061335A (en) Clock network circuit, circuit system, chip and electronic equipment
US11146272B2 (en) Comparator
JPH10154066A (en) N-bit comparator
US7349937B2 (en) Fast incrementer using zero detection and increment method thereof
US20030146860A1 (en) Exponent encoder circuit and mask circuit
US9405860B1 (en) Content addressable memory in which keys are embedded in comparators
US10951230B1 (en) Method and apparatus for ternary mapping
US20040243658A1 (en) High speed adder

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
LAPS Lapse due to unpaid annual fee