KR20070105415A - Appratus for adding and multipying with sign encoding and method thereof - Google Patents

Appratus for adding and multipying with sign encoding and method thereof Download PDF

Info

Publication number
KR20070105415A
KR20070105415A KR1020060037460A KR20060037460A KR20070105415A KR 20070105415 A KR20070105415 A KR 20070105415A KR 1020060037460 A KR1020060037460 A KR 1020060037460A KR 20060037460 A KR20060037460 A KR 20060037460A KR 20070105415 A KR20070105415 A KR 20070105415A
Authority
KR
South Korea
Prior art keywords
bit
carry
sum
code
value
Prior art date
Application number
KR1020060037460A
Other languages
Korean (ko)
Other versions
KR100805272B1 (en
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 KR1020060037460A priority Critical patent/KR100805272B1/en
Publication of KR20070105415A publication Critical patent/KR20070105415A/en
Application granted granted Critical
Publication of KR100805272B1 publication Critical patent/KR100805272B1/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/60Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers
    • G06F7/72Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic
    • G06F7/728Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic using Montgomery reduction
    • 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/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/52Multiplying; Dividing
    • G06F7/523Multiplying only
    • G06F7/533Reduction of the number of iteration steps or stages, e.g. using the Booth algorithm, log-sum, odd-even
    • G06F7/5334Reduction of the number of iteration steps or stages, e.g. using the Booth algorithm, log-sum, odd-even by using multiple bit scanning, i.e. by decoding groups of successive multiplier bits in order to select an appropriate precalculated multiple of the multiplicand as a partial product
    • G06F7/5336Reduction of the number of iteration steps or stages, e.g. using the Booth algorithm, log-sum, odd-even by using multiple bit scanning, i.e. by decoding groups of successive multiplier bits in order to select an appropriate precalculated multiple of the multiplicand as a partial product overlapped, i.e. with successive bitgroups sharing one or more bits being recoded into signed digit representation, e.g. using the Modified Booth Algorithm
    • 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/74Selecting or encoding within a word the position of one or more bits having a specified value, e.g. most or least significant one or zero detection, priority encoders

Abstract

A multiplier using encoding and a method thereof are provided to improve performance and decrease a manufacturing cost by performing addition with an encoding technique or performing multiplication applying the encoding technique. A first operator(410) generates an i-th bit of the first sum, which is a negative number, and an i+1-th bit of a first carry, which is a sign number, by adding the i-th bit of a first and second sign number. A second operator(420) generates the i-th bit of a second sum converting the i-th bit of the second sum into a binary number having no sign and the i+1-th bit, which is the sign number, by converting the i+1 th bit of the first carry according to the i-th bit of the second sum. A result calculator(430) generates an addition result by adding the i-th bit of the second carry and sum. A converter determines the addition of the second input value by controlling a multiplexer according to the first input value. A shift registers outputs a shift value for the first sign number of the first operator by shifting the addition result. An I/O(Input/Output) buffer generates a multiplication result of the first and second input value by using the shift value.

Description

부호화를 이용하는 덧셈 장치, 부호화를 이용하는 곱셈 장치 및 그 방법 {Appratus for adding and multipying with sign encoding and Method thereof}Adder using coding, multiplication device using coding, and method thereof {Appratus for adding and multipying with sign encoding and Method}

도 1a 및 도 1b는 종래의 곱셈 장치의 블럭도이다.1A and 1B are block diagrams of a conventional multiplication apparatus.

도 2는 본 발명에 따른 덧셈 장치의 블럭도이다.2 is a block diagram of an addition apparatus according to the present invention.

도 3a 및 도 3b는 도 2에 적용되는 부호화 기법을 표로 도시한 것이다.3A and 3B show a coding scheme applied to FIG. 2 as a table.

도 4a는 도 2의 상세 블럭도이다.4A is a detailed block diagram of FIG. 2.

도 4b는 본 발명의 일 실시예에 따른 덧셈 장치의 회로도이다.4B is a circuit diagram of an adder according to an embodiment of the present invention.

도 5a는 본 발명에 따른 곱셈 장치의 블럭도이다.5A is a block diagram of a multiplication apparatus according to the present invention.

도 5b는 도 5a의 변환기에 대한 상세 블럭도이다.FIG. 5B is a detailed block diagram of the converter of FIG. 5A.

도 6a는 본 발명에 따른 덧셈 방법의 흐름도이다.6A is a flowchart of an addition method according to the present invention.

도 6b는 도 6a의 상세 알고리즘을 도시한 것이다.FIG. 6B shows the detailed algorithm of FIG. 6A.

도 6c는 도 6b에 의한 연산 과정의 일 예를 도시한 것이다.FIG. 6C illustrates an example of a calculation process according to FIG. 6B.

도 6d는 종래의 덧셈 방법 및 본 발명에 따른 덧셈 방법의 공간 복잡도와 시간 복잡도를 도시한 표이다.6D is a table showing spatial complexity and time complexity of the conventional addition method and the addition method according to the present invention.

도 7은 본 발명에 따른 곱셈 방법을 도시한 것이다.7 shows a multiplication method according to the present invention.

도 8은 종래의 곱셈 방법 및 본 발명에 따른 곱셈 방법의 지연 시간을 도시한 표이다.8 is a table illustrating a delay time of a conventional multiplication method and a multiplication method according to the present invention.

본 발명은 연산 장치에 관한 것으로, 특히, 부호화를 이용하는 덧셈 장치, 부호화를 이용하는 곱셈 장치 및 그 방법에 관한 것이다.TECHNICAL FIELD The present invention relates to an arithmetic apparatus, and more particularly, to an addition apparatus using coding, a multiplication apparatus using coding, and a method thereof.

RSA(Rivest-Shamir-Adleman) 암호 시스템은 키 분배와 관리의 용이, 인증과 디지털 서명(digital signature)이 가능한 장점으로 인해 널리 이용되고 있다. RSA 암호 시스템은 IC카드, 모바일 및 WPKI, 전자화폐, SET, SSL 시스템 등에 많이 이용된다. RSA 공개키 암호 시스템은 매우 큰 정수에 대한 소인수분해가 어렵고 해를 찾아내는데 많은 시간을 요구한다는 점을 이용한 암호시스템이다. 그러나 최근 연산 환경의 발전 및 알고리즘의 효율성 개선 등으로 인수분해가 가능한 정수의 크기가 점차 커지고 있고 앞으로도 증가할 것이다. 따라서 RSA 암호 시스템의 안전성을 위해서 키 길이는 길어지게 되고 상대적으로 연산량이 증가하게 된다. 그러므로 RSA 암호 시스템의 효율적인 구성은 매우 중요한 연구 과제이다.Rivest-Shamir-Adleman (RSA) cryptographic systems are widely used because of their ease of key distribution and management, authentication, and digital signatures. RSA cryptosystems are widely used for IC cards, mobile and WPKI, electronic money, SET, SSL systems, etc. The RSA public key cryptosystem is a cryptosystem that takes advantage of the difficulty of factoring very large integers and requires a lot of time to find a solution. However, the size of integers that can be factored is gradually increasing due to the development of computing environment and the improvement of algorithm efficiency. Therefore, for the safety of the RSA cryptosystem, the key length becomes longer and the amount of computation increases. Therefore, the efficient configuration of the RSA cryptosystem is a very important research issue.

RSA 암호 시스템은 모듈러 지수승 연산을 통하여 수행이 되고, 모듈러 지수승 연산은 반복적인 모듈러 곱셈연산을 통하여 구성이 된다. 따라서 모듈러 곱셈 장치의 효율적인 구현과 반복 연산의 횟수는 RSA 암호 시스템의 효율성에 있어 중요한 문제이다. The RSA cryptosystem is performed through modular exponential operations, which are constructed through iterative modular multiplication. Therefore, the efficient implementation of the modular multiplier and the number of iterations are important issues in the efficiency of the RSA cryptosystem.

최근 RSA 암호시스템에서 이용되어지는 모듈러 연산을 위해 개발 된 방법 중 에 몽고메리(Montgomery) 모듈러 곱셈 알고리즘이 효율적이라고 알려져 있다. 몽고메리(Montgomery) 곱셈 장치는 세 입력 값의 덧셈 연산이 필요하고, 덧셈 연산의 지연시간이 곱셈 장치의 시간 복잡도를 결정한다.Recently, Montgomery's modular multiplication algorithm is known to be efficient among the methods developed for the modular operation used in the RSA cryptosystem. The Montgomery multiplier requires an addition operation of three input values, and the delay time of the add operation determines the time complexity of the multiplication device.

몽고메리(Montgomery) 모듈러 곱셈 알고리즘의 시간 복잡도는 세 입력 값의 덧셈 과정에서 발생하는 지연시간에 의존하게 되며, 덧셈 연산을 위하여 구성되는 대표적인 덧셈 장치는 캐리 전파 가산기(Carry Propagation Adder; 캐리 전파 가산기(CPA))와 캐리 저장 가산기(Carry Save Adder; CSA)가 있다. 캐리 저장 가산기(CSA)를 이용하여 구성할 경우 캐리 전파 가산기(CPA)의 캐리 전파 지연 시간이 발생하지 않으므로 캐리 전파 가산기(CPA)보다 효율적인 곱셈 장치를 구성할 수 있다. 그러나, 캐리 저장 가산기(CSA)를 이용한 결과 캐리와 합 즉, 두개의 값으로 표현 되므로, 연산의 입력 값의 개수가 증가한다. The time complexity of the Montgomery modular multiplication algorithm depends on the delay incurred during the addition of three input values, and a representative addition device configured for the addition operation is a carry propagation adder (CPA). )) And the Carry Save Adder (CSA). In the case of using the carry storage adder (CSA), the carry propagation delay time of the carry propagation adder (CPA) does not occur, thereby making it possible to construct a multiplication device more efficient than the carry propagation adder (CPA). However, since the result of using the carry storage adder (CSA) is expressed as a carry and a sum, that is, two values, the number of input values of the operation increases.

종래의 캐리 저장 가산기(CSA)를 이용한 몽고메리(Montgomery) 곱셈 장치는 다음과 같다.The Montgomery multiplication apparatus using a conventional carry storage adder (CSA) is as follows.

몽고메리(Montgomery) 곱셈 알고리즘에서, 세 연산자의 덧셈과정에서 발생하는 캐리 전파를 처리하는 과정이 알고리즘 지연 시간의 대부분을 차지하므로, 알고리즘에서 세 입력 값에 대한 덧셈을 수행하는 과정이 알고리즘의 시간 복잡도에서 가장 큰 부분을 차지한다.In the Montgomery multiplication algorithm, the carry propagation in the addition of the three operators takes up most of the algorithm's delay, so the addition of the three inputs in the algorithm takes place in the algorithm's time complexity. Occupies the largest part.

캐리 저장 가산기(CSA) 는 세 개의 입력 값을 갖고, 연산(

Figure 112006029079928-PAT00001
)을 수행하고 두 개의 값(캐리인
Figure 112006029079928-PAT00002
, 합인
Figure 112006029079928-PAT00003
)을 출 력하는 덧셈 장치이다.The Carry Storage Adder (CSA) has three input values,
Figure 112006029079928-PAT00001
) And two values (the carry-in
Figure 112006029079928-PAT00002
, Combined
Figure 112006029079928-PAT00003
It is an adder that outputs).

도 1a 및 도 1b는 종래의 곱셈 장치의 블럭도이다.1A and 1B are block diagrams of a conventional multiplication apparatus.

도 1a는 캐리 저장 가산기(CSA) 덧셈 장치를 이용한 5개의 입력 값과 2개의 출력 값을 가지는 곱셈 장치(종래의(McIvor의 1) 방법)를 도시하고, 도 1b는 4개의 입력 값과 2개의 출력 값을 가지는 곱셈 장치(종래의(McIvor의 2) 방법)를 도시한다.FIG. 1A shows a multiplication device (traditional (McIvor's 1) method) having five input values and two output values using a Carry Storage Adder (CSA) adder, and FIG. 1B shows four input values and two The multiplication apparatus (conventional (McIvor's 2) method) which has an output value is shown.

몽고메리(Montgomery) 곱셈 알고리즘에서

Figure 112006029079928-PAT00004
의 연산 결과는 캐리 저장 가산기(CSA)를 이용하여 합
Figure 112006029079928-PAT00005
과 캐리
Figure 112006029079928-PAT00006
로 나타낼 수 있고,
Figure 112006029079928-PAT00007
는 다음 곱셈의 입력으로 이용되므로 Y 또한
Figure 112006029079928-PAT00008
으로 표현 한다. 따라서
Figure 112006029079928-PAT00009
의 연산은
Figure 112006029079928-PAT00010
를 X의 i번째 비트라 할 때
Figure 112006029079928-PAT00011
으로 나타낼 수 있으므로 다섯 개의 입력 값과 두 개의 출력 값을 갖는 종래의(McIvor의 1) 방법이 된다. 종래의(McIvor의 1) 방법은 도 1a과 같이 3단계의 캐리 저장 가산기(CSA) 지연 시간을 요구한다.In the Montgomery multiplication algorithm
Figure 112006029079928-PAT00004
Operation result is summed using the Carry Storage Adder (CSA).
Figure 112006029079928-PAT00005
And carry
Figure 112006029079928-PAT00006
Can be represented as
Figure 112006029079928-PAT00007
Is used as the input for the next multiplication, so Y
Figure 112006029079928-PAT00008
Express as therefore
Figure 112006029079928-PAT00009
The operation of
Figure 112006029079928-PAT00010
Is the i th bit of X
Figure 112006029079928-PAT00011
Since it can be represented by the conventional method (1 of McIvor) having five input values and two output values. The conventional (McIvor's 1) method requires a three stage Carry Storage Adder (CSA) delay time as shown in FIG. 1A.

이와 같은 지연 시간을 줄이기 위한 종래의(McIvor의 2) 방법은 도 1b와 같은 2단계의 캐리 저장 가산기(CSA)로 구성된다.

Figure 112006029079928-PAT00012
Figure 112006029079928-PAT00013
의 연산에서
Figure 112006029079928-PAT00014
Figure 112006029079928-PAT00015
의 값에 따라 덧셈에 필요한 피 연산자의 조합은 달라진다.
Figure 112006029079928-PAT00016
인 경우 단지
Figure 112006029079928-PAT00017
의 연산이 되고,
Figure 112006029079928-PAT00018
인 경우
Figure 112006029079928-PAT00019
의 연산이 되며,
Figure 112006029079928-PAT00020
의 경우
Figure 112006029079928-PAT00021
의 연산이 된다. 그러나,
Figure 112006029079928-PAT00022
의 경우 다섯 개의 피 연산자로 구성 된
Figure 112006029079928-PAT00023
의 연산을 수행하게 된다. 피 연산자의 항의 개수가 증가하는 것을 방지하기 위하여 곱셈이 시작하기 전 사전 연산을 통하여
Figure 112006029079928-PAT00024
Figure 112006029079928-PAT00025
의 연산을 수행하고 합
Figure 112006029079928-PAT00026
와 캐리
Figure 112006029079928-PAT00027
을 저장한 후 멀티플렉서(MUX)를 이용하여
Figure 112006029079928-PAT00028
Figure 112006029079928-PAT00029
의 모든 경우에 따라서
Figure 112006029079928-PAT00030
와 같이 연산한다.The conventional (McIvor 2) method for reducing such a delay time is composed of a two-stage carry storage adder (CSA) as shown in FIG.
Figure 112006029079928-PAT00012
Figure 112006029079928-PAT00013
In the operation of
Figure 112006029079928-PAT00014
Wow
Figure 112006029079928-PAT00015
The combination of operands for addition depends on the value of.
Figure 112006029079928-PAT00016
If just
Figure 112006029079928-PAT00017
Is the operation of
Figure 112006029079928-PAT00018
If
Figure 112006029079928-PAT00019
Is the operation of
Figure 112006029079928-PAT00020
In the case of
Figure 112006029079928-PAT00021
Is the operation of. But,
Figure 112006029079928-PAT00022
In the case of five operands
Figure 112006029079928-PAT00023
Will perform the operation of. To prevent an increase in the number of terms in the operands, use a dictionary operation before multiplication begins.
Figure 112006029079928-PAT00024
Figure 112006029079928-PAT00025
Performs the operation of and sum
Figure 112006029079928-PAT00026
And carry
Figure 112006029079928-PAT00027
After saving the data using the multiplexer (MUX)
Figure 112006029079928-PAT00028
Wow
Figure 112006029079928-PAT00029
In all cases of
Figure 112006029079928-PAT00030
Calculate as

그러나, 종래의 덧셈 장치 및 곱셈 장치는 캐리 저장 가산기(CSA)를 2단계 이상 요구하고, 1단계의 캐리 저장 가산기(CSA)마다 많은 면적과 게이트 지연시간이 필요하므로, 덧셈 장치 및 곱셈 장치의 성능을 저하시키고, 그 제조 비용을 증가시키는 문제점이 있다.However, conventional adders and multipliers require two or more carry storage adders (CSAs), and require large area and gate delay time for each carry storage adder (CSA). There is a problem of lowering the cost and increasing the manufacturing cost thereof.

따라서, 본 발명이 이루고자 하는 첫번째 기술적 과제는 공간 복잡도와 시간 복잡도를 줄여 성능을 향상시키고, 제조 비용을 감소시킬 수 있는 부호화를 이용하는 덧셈 장치를 제공하는데 있다.Accordingly, the first technical problem to be achieved by the present invention is to provide an addition apparatus using encoding that can improve performance by reducing space complexity and time complexity and reduce manufacturing cost.

본 발명이 이루고자 하는 두번째 기술적 과제는 상기의 덧셈 장치를 이용하여 뎃셈 연산을 수행하는 부호화를 이용하는 곱셈 장치를 제공하는데 있다.A second technical problem to be achieved by the present invention is to provide a multiplication apparatus using encoding that performs a multiplication operation using the addition apparatus.

본 발명이 이루고자 하는 세번째 기술적 과제는 상기의 덧셈 장치에 적용되는 부호화를 이용하는 덧셈 방법을 제공하는데 있다.A third technical problem to be achieved by the present invention is to provide an addition method using coding applied to the above-described addition apparatus.

본 발명이 이루고자 하는 세번째 기술적 과제는 싱기의 곱셈 장치에 적용되는 부호화를 이용하는 곱셈 방법을 제공하는데 있다.A third technical problem to be achieved by the present invention is to provide a multiplication method using coding applied to a multiplication device of a singer.

상기의 첫번째 기술적 과제를 이루기 위하여, 본 발명은 임의의 자리 비트인 i번째 비트가 부호를 나타내는 부호비트와 크기를 나타내는 크기비트로 구성되는 부호수인 제1 부호수 및 제2 부호수에 대하여, 상기 제1 부호수의 i번째 비트와 상기 제2 부호수의 i번째 비트를 합산하여 음의수인 제1 합의 i번째 비트와 부호수인 제1 캐리의 i+1번째 비트를 생성하는 제1연산부, 상기 제1 합의 i번째 비트를 부호를 갖지 않는 이진수로 변환한 제2 합의 i번째 비트를 생성하고, 상기 제2 합의 i번째 비트에 따라 상기 제1 캐리의 i+1번째 비트를 변환시켜 부호수인 제2 캐리의 i+1번째 비트를 생성하는 제2연산부 및 상기 제2 캐리의 i번째 비트와 상기 제2 합의 i번째 비트를 합산하여 덧셈 결과값을 생성하는 결과값 산출부를 포함하는 부호화를 이용하는 덧셈 장치를 제공한다.In order to achieve the above first technical problem, the present invention relates to a first code number and a second code number that are the number of codes consisting of a code bit representing a code and a size bit representing a size. A first operation unit configured to add the i-th bit of the first code number and the i-th bit of the second code number to generate an i-th bit of the first sum that is a negative number and an i + 1th bit of the first carry that is a code number Generate an i-th bit of the second sum obtained by converting the i-th bit of the first sum to an unsigned binary number, and convert the i + 1 th bit of the first carry according to the i-th bit of the second sum Coding including a second operation unit for generating an i + 1 th bit of the second carry, which is a number, and a result value calculating unit for generating an addition result by summing the i th bit of the second carry and the i th bit of the second sum. Addition device using And balls.

상기의 두번째 기술적 과제를 이루기 위하여, 본 발명은 상기 제1 부호수의 i번째 비트와 상기 제2 부호수의 i번째 비트를 합산하여 음의수인 제1 합의 i번째 비트와 부호수인 제1 캐리의 i+1번째 비트를 생성하는 제1연산부, 상기 제1 합의 i 번째 비트를 부호를 갖지 않는 이진수로 변환한 제2 합의 i번째 비트를 생성하고, 상기 제2 합의 i번째 비트에 따라 상기 제1 캐리의 i+1번째 비트를 변환시켜 부호수인 제2 캐리의 i+1번째 비트를 생성하는 제2연산부, 상기 제2 캐리의 i번째 비트와 상기 제2 합의 i번째 비트를 합산하여 덧셈 결과값을 생성하는 결과값 산출부, 제1입력값에 따라, 제2입력값, 상기 제1입력값 및 제2입력값을 이용한 모듈러값, 상기 모듈러값과 제2입력값을 합산한 값 또는 0 중 어느 하나를 선택하여 상기 제1연산부의 제2부호수로 출력하는 멀티플렉서, 상기 제1입력값에 따라 상기 멀티플레서를 제어하여 제2입력값의 덧셈 여부를 결정하는 변환기, 상기 결과값 산출부의 덧셈 결과값을 쉬프트 연산한 쉬프트값을 상기 제1연산부의 제1부호수로 출력하는 쉬프트 레지스터 및 상기 쉬프트값을 이용하여 제1입력값 및 제2입력값의 곱셈 연산 결과를 생성하는 입출력 버퍼부를 포함하는 부호화를 이용하는 곱셈 장치를 제공한다.In order to achieve the above second technical problem, the present invention sums the i-th bit of the first code number and the i-th bit of the second code number to add a first i-th bit that is a negative number and a first number that is a code number. A first operation unit for generating an i + 1 th bit of carry, a second i th bit of the second sum obtained by converting the i th bit of the first sum into an unsigned binary number, and generating the i th bit according to the i th bit of the second sum A second operation unit which converts the i + 1 th bit of the first carry to generate the i + 1 th bit of the second carry, the number of codes, and adds the i th bit of the second carry and the i th bit of the second sum; A result calculation unit for generating an addition result value, a second input value, a modular value using the first input value and the second input value, and a sum of the modular value and the second input value according to the first input value Or selecting one of 0 and outputting it as the second code number of the first operation unit. A multiplexer, a converter configured to control the multiplexer according to the first input value to determine whether to add a second input value, and a shift value obtained by shifting an addition result value of the result value calculator to the first operator of the first operator. A multiplication apparatus using an encoding including a shift register for outputting a number of codes and an input / output buffer unit for generating a multiplication result of a first input value and a second input value using the shift value is provided.

상기의 세번째 기술적 과제를 이루기 위하여, 본 발명은 상기 제1 부호수의 i번째 비트와 상기 제2 부호수의 i번째 비트를 합산하여 음의수인 제1 합의 i번째 비트와 부호수인 제1 캐리의 i+1번째 비트를 생성하는 단계, 상기 제1 합의 i번째 비트를 부호를 갖지 않는 이진수로 변환한 제2 합의 i번째 비트를 생성하고, 상기 제2 합의 i번째 비트에 따라 상기 제1 캐리의 i+1번째 비트를 변환시켜 부호수인 제2 캐리의 i+1번째 비트를 생성하는 단계 및 상기 제2 캐리의 i번째 비트와 상기 제2 합의 i번째 비트를 합산하여 덧셈 결과값을 생성하는 단계를 포함하는 부호화를 이용하는 덧셈 방법을 제공한다.In order to achieve the third technical problem, the present invention sums the i-th bit of the first code number and the i-th bit of the second code number to add the i-th bit of the first sum that is a negative number and the first number that is a code number. Generating an i + 1 th bit of carry, generating an i th bit of the second sum obtained by converting the i th bit of the first sum into an unsigned binary number, and generating the first th bit according to the i th bit of the second sum Converting the i + 1 th bit of the carry to generate the i + 1 th bit of the second carry, the number of codes; and adding the i th bit of the second carry and the i th bit of the second sum to add an addition result value An addition method using encoding comprising generating is provided.

상기의 네번째 기술적 과제를 이루기 위하여, 본 발명은 제1입력값에 따라, 제2입력값, 상기 제1입력값 및 제2입력값을 이용한 모듈러값, 상기 모듈러값과 제2입력값을 합산한 값 또는 0 중 어느 하나를 선택하여 제2부호수로 출력하는 단계, 상기 제1 부호수의 i번째 비트와 상기 제2 부호수의 i번째 비트를 합산하여 음의수인 제1 합의 i번째 비트와 부호수인 제1 캐리의 i+1번째 비트를 생성하는 단계, 상기 제1 합의 i번째 비트를 부호를 갖지 않는 이진수로 변환한 제2 합의 i번째 비트를 생성하고, 상기 제2 합의 i번째 비트에 따라 상기 제1 캐리의 i+1번째 비트를 변환시켜 부호수인 제2 캐리의 i+1번째 비트를 생성하는 단계 및 상기 제2 캐리의 i번째 비트와 상기 제2 합의 i번째 비트를 합산하여 덧셈 결과값을 생성하는 단계를 반복하고, 상기 제1입력값에 따라 제어하여 제2입력값의 덧셈 여부를 결정하고, 상기 덧셈 결과값을 쉬프트 연산한 쉬프트값을 제1부호수로 출력하여 제1입력값 및 제2입력값의 곱셈 연산 결과를 생성하는 단계를 포함하는 부호화를 이용하는 곱셈 방법을 제공한다.In order to achieve the fourth technical problem, the present invention may add a second input value, a modular value using the first input value and a second input value, and the modular value and the second input value according to a first input value. Selecting one of a value or 0 and outputting it as a second code number, i-th bit of a first sum of a first sum that is a negative number by adding the i-th bit of the first code number and the i-th bit of the second code number Generating an i + 1 th bit of the first carry, which is the number of signs, and generating an i th bit of the second sum obtained by converting the i th bit of the first sum into an unsigned binary number; Converting the i + 1 th bit of the first carry according to the bit to generate an i + 1 th bit of the second carry, the number of codes, and the i th bit of the second carry and the i th bit of the second sum Repeat the step of generating the addition result by adding, depending on the first input value D) determining whether to add the second input value, and outputting the shift value obtained by shifting the addition result as a first code to generate a multiplication result of the first input value and the second input value. A multiplication method using encoding is included.

본 발명은 부호화 기법을 이용하여 종래의(McIvor의 2) 방법에 비해 게이트 수와 지연시간을 줄인 덧셈 장치 즉, 덧셈 장치(Nadder)를 제공하고, 본 발명에 따른 덧셈 장치(Nadder)를 이용하여 구성된 새로운 곱셈 장치를 제공한다. 또한, 본 발명은 본 발명에 따른 덧셈 장치(Nadder) 및 본 발명에 따른 곱셈 장치에 적용되는 방법을 제공한다.The present invention provides an adder, that is, an adder (Nadder), which reduces the number of gates and the delay time compared to the conventional (McIvor's 2) method by using an encoding method, and uses the adder according to the present invention. Provide a configured new multiplication device. The present invention also provides an adder according to the invention and a method applied to the multiplication apparatus according to the invention.

이하에서는 도면을 참조하여 본 발명의 바람직한 실시예를 설명하기로 한다. Hereinafter, with reference to the drawings will be described a preferred embodiment of the present invention.

도 2는 본 발명에 따른 덧셈 장치의 블럭도이다.2 is a block diagram of an addition apparatus according to the present invention.

본 발명에 따른 덧셈 장치(Nadder)는 도 2와 같이 두 개의 입력 값과 하나의 출력 값을 가지는 덧셈 장치이다. 몽고메리 곱셈에서

Figure 112006029079928-PAT00031
의 연산은
Figure 112006029079928-PAT00032
을 한 개의 값으로 표현하면 두개의 피 연산자 덧셈으로 표현이 가능하다. 그러나, 양수인 두 값에 대해 캐리 전파 없이 덧셈을 수행하는 것은 불가능하므로, 두 수를 캐리 전파 없이 한 값으로 표현하는 부호화 기법을 이용한다.The adder Nadder according to the present invention is an adder having two input values and one output value as shown in FIG. 2. In Montgomery Multiplication
Figure 112006029079928-PAT00031
The operation of
Figure 112006029079928-PAT00032
If is expressed as one value, it can be expressed by two operand addition. However, since it is impossible to perform addition without carry propagation on two positive values, an encoding method of expressing two numbers as one value without carry propagation is used.

따라서, 본 발명에 따른 덧셈 장치(Nadder)의 두 입력은 부호수가 되고, 출력 역시 부호수가 된다.Therefore, the two inputs of the adder Nadder according to the present invention become the number of codes and the output also becomes the number of codes.

부호화 기법을 이용하기 위해서 n 비트 X와 Y의 덧셈 결과를 (n+1)비트 캐리 C와 n비트 합 S로 나타낸다. C와 S는 각각

Figure 112006029079928-PAT00033
Figure 112006029079928-PAT00034
라고 가정한다. In order to use the coding scheme, the addition result of n bits X and Y is represented by (n + 1) bits carry C and n bits sum S. C and S are each
Figure 112006029079928-PAT00033
Wow
Figure 112006029079928-PAT00034
Assume that

두 비트

Figure 112006029079928-PAT00035
Figure 112006029079928-PAT00036
의 덧셈 결과를 캐리
Figure 112006029079928-PAT00037
와 합
Figure 112006029079928-PAT00038
으로 표현하면 수학식 1과 같이 표현된다.Two bits
Figure 112006029079928-PAT00035
Wow
Figure 112006029079928-PAT00036
Carry the addition result of
Figure 112006029079928-PAT00037
Sum with
Figure 112006029079928-PAT00038
When expressed as shown in equation (1).

Figure 112006029079928-PAT00039
, 0≤ i < n-1
Figure 112006029079928-PAT00039
, 0≤ i <n-1

도 3a 및 도 3b는 도 2에 적용되는 부호화 기법을 표로 도시한 것이다.3A and 3B show a coding scheme applied to FIG. 2 as a table.

도 3a는 부호화 기법을 이용한 두 부호수

Figure 112006029079928-PAT00040
의 덧셈에 대한 표이고, 도 3b는 부호화 기법을 이용한 부호수
Figure 112006029079928-PAT00041
와 음의수
Figure 112006029079928-PAT00042
의 덧셈에 대한 표이다. 이때, 제1 캐리인 C1, 제1 합인 S1, 제2 캐리인 C2, 제2 합인 S2 는 중간 과정에서 제거된다.3A shows two code numbers using an encoding technique.
Figure 112006029079928-PAT00040
Is a table of additions, and FIG. 3B illustrates the number of codes using an encoding technique.
Figure 112006029079928-PAT00041
And negative numbers
Figure 112006029079928-PAT00042
Table of additions. At this time, the first carry C1, the first sum S1, the second carry C2, and the second sum S2 are removed in the intermediate process.

부호수를 표현하기 위해

Figure 112006029079928-PAT00043
,
Figure 112006029079928-PAT00044
를 부호자리와 값의 자리를 이용하여 각각
Figure 112006029079928-PAT00045
Figure 112006029079928-PAT00046
와 같이 표현한다(즉,
Figure 112006029079928-PAT00047
,
Figure 112006029079928-PAT00048
,
Figure 112006029079928-PAT00049
). 연산 과정의
Figure 112006029079928-PAT00050
와 출력 결과인
Figure 112006029079928-PAT00051
또한 부호가 있는 형태로 표현한다.To represent the number of signs
Figure 112006029079928-PAT00043
,
Figure 112006029079928-PAT00044
Using the sign place and the place of the value respectively
Figure 112006029079928-PAT00045
Wow
Figure 112006029079928-PAT00046
(Ie.
Figure 112006029079928-PAT00047
,
Figure 112006029079928-PAT00048
,
Figure 112006029079928-PAT00049
). Computational process
Figure 112006029079928-PAT00050
And the output
Figure 112006029079928-PAT00051
It is also expressed in signed form.

본 발명에 이용되는 부호화 기법부호화 기법을 설명하기 위해 0과

Figure 112006029079928-PAT00052
로 이루어진 수를 음의수라고 가정한다.
Figure 112006029079928-PAT00053
인 경우
Figure 112006029079928-PAT00054
이며, 부호수를 이용하여
Figure 112006029079928-PAT00055
로 표현할 수 있다. 두 양수 X, Y 덧셈의
Figure 112006029079928-PAT00056
에서
Figure 112006029079928-PAT00057
가 1인 경우는
Figure 112006029079928-PAT00058
,
Figure 112006029079928-PAT00059
두 가지가 있고, 이 때 합은
Figure 112006029079928-PAT00060
이 되고,
Figure 112006029079928-PAT00061
는 항상 0이므로 부호수로 표기하는 경우, 캐리 전파 없이
Figure 112006029079928-PAT00062
를 음수로 표현할 수 있다. Encoding Techniques Used in the Present Invention
Figure 112006029079928-PAT00052
Assume that the number consists of negative numbers.
Figure 112006029079928-PAT00053
If
Figure 112006029079928-PAT00054
Using the number of symbols
Figure 112006029079928-PAT00055
Can be expressed as Two positive X and Y additions
Figure 112006029079928-PAT00056
in
Figure 112006029079928-PAT00057
Is 1
Figure 112006029079928-PAT00058
,
Figure 112006029079928-PAT00059
There are two things, and the sum is
Figure 112006029079928-PAT00060
Become,
Figure 112006029079928-PAT00061
Is always 0, so if you write it as a code number,
Figure 112006029079928-PAT00062
Can be expressed as a negative number.

따라서 X+Y=C+S이므로 S를 부호수로 만들면 C+S단계에서 캐리 전파 없이 부호수로 표현된다. 본 발명에 따른 곱셈 장치에서 초기 Y와 M은 양수이지만 Y+M은 부호수가 되므로 곱셈 장치의 모든 입출력 값을 부호수로 고려한다. 종래의(McIvor의 2) 방법에서 A는 캐리를 포함하는

Figure 112006029079928-PAT00063
의 형태인 반면, 본 발명의 A는 두 부호수의 덧셈 결과로써 한 개의 부호수 A로 표현된다.Therefore, if X + Y = C + S, making S the number of codes is expressed as the number of codes without carry propagation in the step C + S. In the multiplication apparatus according to the present invention, since the initial Y and M are positive numbers, Y + M becomes a code number, all input / output values of the multiplication apparatus are considered as the number of codes. In the conventional (2 of McIvor) method, A includes a carry
Figure 112006029079928-PAT00063
In the present invention, A is represented by one code number A as a result of addition of two code numbers.

두 부호수의 덧셈은

Figure 112006029079928-PAT00064
인 경우와
Figure 112006029079928-PAT00065
에서 캐리가 발생할 수 있다. 그러나, 도 3a 및 도 3b의 두 가지 부호화 기법을 이용한 두 부호수의 덧셈은 캐리 전파 없이 하나의 값으로 출력할 수 있다. 본 발명에 따른 방법은 두 부호수의 덧셈을 부호수와 음의수의 덧셈으로 변환하고 그 결과를 부호수와 이진수로 변환시켜 캐리 전파 없이 더하는 방법이다. Addition of two code numbers
Figure 112006029079928-PAT00064
If and
Figure 112006029079928-PAT00065
Carry may occur at However, addition of two code numbers using the two encoding techniques of FIGS. 3A and 3B may be output as one value without carry propagation. The method according to the present invention converts the addition of two code numbers into the addition of the code number and the negative number, and converts the result into the code number and the binary number and adds them without carry propagation.

도 4a는 도 2의 상세 블럭도이다.4A is a detailed block diagram of FIG. 2.

먼저, 임의의 자리 비트인 i번째 비트가 부호를 나타내는 부호비트와 크기를 나타내는 크기비트로 구성되는 부호수인 제1 부호수(X) 및 제2 부호수(Y)를 가정한다.First, it is assumed that the first code number X and the second code number Y, which are the number of codes composed of a code bit representing a code and a size bit representing a size, are specified.

제1연산부(410)는 제1 부호수의 i번째 비트와 제2 부호수의 i번째 비트를 합산하여 음의수인 제1 합의 i번째 비트(

Figure 112006029079928-PAT00066
)와 부호수인 제1 캐리의 i+1번째 비트(
Figure 112006029079928-PAT00067
)를 생성한다.The first operation unit 410 sums the i-th bit of the first code number and the i-th bit of the second code number to add the i-th bit of the first sum, which is a negative number (
Figure 112006029079928-PAT00066
) And the i + 1th bit of the first carry, the number of codes (
Figure 112006029079928-PAT00067
)

제2연산부(420)는 제1 합의 i번째 비트(

Figure 112006029079928-PAT00068
)를 부호를 갖지 않는 이진수로 변환한 제2 합의 i번째 비트(
Figure 112006029079928-PAT00069
)를 생성하고, 제2 합의 i번째 비트(
Figure 112006029079928-PAT00070
)에 따라 제1 캐리의 i+1번째 비트(
Figure 112006029079928-PAT00071
)를 변환시켜 부호수인 제2 캐리의 i+1번째 비트(
Figure 112006029079928-PAT00072
)를 생성한다.The second operation unit 420 is the i-th bit of the first sum (
Figure 112006029079928-PAT00068
) I th bit of the second sum (
Figure 112006029079928-PAT00069
) And the i th bit of the second sum (
Figure 112006029079928-PAT00070
) According to the i + 1th bit of the first carry (
Figure 112006029079928-PAT00071
) Is converted so that the i + 1th bit of the second carry, which is the number of codes,
Figure 112006029079928-PAT00072
)

결과값 산출부(430)는 제2 캐리의 i번째 비트(

Figure 112006029079928-PAT00073
)와 제2 합의 i번째 비트(
Figure 112006029079928-PAT00074
)를 합산하여 덧셈 결과값(A)을 생성한다.The result value calculating unit 430 is the i-th bit of the second carry (
Figure 112006029079928-PAT00073
) And the i-th bit of the second sum (
Figure 112006029079928-PAT00074
) Is added to generate an addition result A.

도 4b는 본 발명의 일 실시예에 따른 덧셈 장치의 회로도이다.4B is a circuit diagram of an adder according to an embodiment of the present invention.

이하에서는, 0≤ i ≤ n+1 인 i에 대하여, i=0인 경우 즉, 0번째 비트를 중심으로 설명한다.Hereinafter, i with 0 ≦ i ≦ n + 1 will be described with respect to the case where i = 0, that is, the 0th bit.

본 발명의 일 실시예에 따르면, 제1연산부(410)는 제1게이트부(411), 제2게이트부(412) 및 제3게이트부(413)를 포함하고, 제2연산부(420)는 제4게이트부(424) 및 제5게이트부(425)를 포함하며, 결과값 산출부(430)는 제6게이트부(436)를 포함한다.According to an embodiment of the present invention, the first operator 410 includes a first gate part 411, a second gate part 412, and a third gate part 413, and the second operator 420 The fourth gate part 424 and the fifth gate part 425 are included, and the result value calculating part 430 includes the sixth gate part 436.

제1게이트부(411)는 제1 부호수의 크기비트 및 제2 부호수의 크기비트의 배타적 논리합 연산을 수행하여 제1 합의 i번째 크기비트 및 부호비트를 생성한다. 바람직하게는, 제1게이트부(411) XOR 게이트를 포함할 수 있다.The first gate unit 411 generates an ith size bit and a code bit of the first sum by performing an exclusive OR operation on the size bits of the first code number and the size bits of the second code number. Preferably, the first gate part 411 may include an XOR gate.

제2게이트부(412)는 제1 부호수의 부호비트 및 제2 부호수의 부호비트의 논리곱을 연산하여 제1 캐리의 i+1번째 부호비트를 생성한다. 바람직하게는, 제2게이트부(412)는 AND 게이트를 포함할 수 있다.The second gate unit 412 generates an i + 1th code bit of the first carry by calculating a logical product of the code bits of the first code number and the code bits of the second code number. Preferably, the second gate portion 412 may include an AND gate.

제3게이트부(413)는 제1 부호수의 부호비트 및 제2 부호수의 부호비트의 배 타적 논리합의 인버스 연산 결과와 제1 부호수의 크기비트 및 제2 부호수의 크기비트의 논리합 연산 결과 사이의 논리곱 연산을 수행하여 제1 캐리의 i+1번째 크기비트를 생성한다. 바람직하게는, 제3게이트부(413)는 OR 게이트, XOR 게이트, NOT 게이트, AND 게이트를 포함할 수 있다.The third gate unit 413 performs an inverse operation result of the exclusive OR of the code bits of the first code number and the code bits of the second code number, and the OR operation of the size bits of the first code number and the size bits of the second code number. By performing the AND operation between the results, the i + 1 th size bits of the first carry are generated. Preferably, the third gate portion 413 may include an OR gate, an XOR gate, a NOT gate, and an AND gate.

제4게이트부(424)는 제2 합의 i번째 부호비트에 비트값 0을 할당하고, 제1 캐리의 크기비트 및 제1 합의 크기비트의 배타적 논리합을 연산하여 제2 합의 i번째 크기비트를 생성한다. 바람직하게는, 제4게이트부(424)는 XOR 게이트를 포함할 수 있다.The fourth gate unit 424 assigns a bit value 0 to the i-th code bit of the second sum, calculates an exclusive OR of the size bit of the first carry and the size bit of the first sum, to generate the i-th size bit of the second sum. do. Preferably, the fourth gate portion 424 may include an XOR gate.

제5게이트부(425)는 제1 캐리의 부호비트 및 제1 캐리의 크기비트의 배타적 논리합의 인버스 연산 결과와 제1 캐리의 부호비트 및 제1 합의 부호비트의 논리합 연산 결과 사이의 논리곱 연산을 수행하여 제2 캐리의 i+1번째 비트를 생성한다. 바람직하게는, 제5게이트부(425)는 OR 게이트, XOR 게이트, NOT 게이트, AND 게이트를 포함할 수 있다.The fifth gate unit 425 performs an AND operation between the result of the inverse operation of the exclusive OR of the sign bit of the first carry and the size bit of the first carry and the result of the OR operation of the sign bit and the first sum of the sign bit of the first carry. To generate the i + 1 th bit of the second carry. Preferably, the fifth gate portion 425 may include an OR gate, an XOR gate, a NOT gate, and an AND gate.

제6게이트부(436)는 제2 캐리의 i번째 비트와 제2 합의 i번째 비트를 합산하여 부호비트와 크기비트로 구성된 덧셈 결과값(A)을 생성한다. 바람직하게는, 제6게이트부(436)는 XOR 게이트, NOT 게이트, AND 게이트를 포함할 수 있다.The sixth gate portion 436 generates an addition result value A consisting of a sign bit and a size bit by adding the i-th bit of the second carry and the i-th bit of the second sum. Preferably, the sixth gate portion 436 may include an XOR gate, a NOT gate, and an AND gate.

1≤ i ≤ n+1 인 경우도 상술한 바와 같은 구성을 갖는다. 다만, i= n+1인 경우, 부호 비트를 입력으로 하지 않는 점, 제1 캐리의 n+2번째 비트와 제2 캐리의 n+2번째 사이의 배타적 논리합 연산에 따라 덧셈 결과값(A)의 n+2번째 크기 비트를 생성하는 점은 나머지 자리 비트와 구별된다.The case of 1 ≦ i ≦ n + 1 also has the above-described configuration. However, in the case of i = n + 1, the sign bit is not input, and the addition result A according to the exclusive OR operation between the n + 2 th bit of the first carry and the n + 2 th of the second carry. The point that produces the n + 2th size bits of is distinct from the remaining digit bits.

도 5a는 본 발명에 따른 곱셈 장치의 블럭도이다.5A is a block diagram of a multiplication apparatus according to the present invention.

본 발명에 따른 덧셈 장치(Nadder)를 이용하는 곱셈 장치는 입력 값을 제어하기 위하여 Y+M의 사전 연산이 요구된다. 이 연산은 곱셈 장치의 반복 연산을 수행하기 전에 연산되어 저장되고

Figure 112006029079928-PAT00075
,
Figure 112006029079928-PAT00076
에 따라 사전 연산 값들을 선택해서 이용해야 하므로 멀티플렉서(MUX, 530)가 필요하다. The multiplication apparatus using the adder according to the present invention requires a pre-computation of Y + M to control the input value. This operation is computed and stored before the iteration of the multiplication device
Figure 112006029079928-PAT00075
,
Figure 112006029079928-PAT00076
In this case, multiplexers (MUX, 530) are needed because the pre-calculated values must be selected and used.

따라서 본 발명에 따른 곱셈 장치는 본 발명에 따른 덧셈 장치(Nadder, 540), 4:1 멀티플렉서(MUX, 530), 1비트 변환기(521)를 포함한다.Therefore, the multiplication apparatus according to the present invention includes an adder (Nadder) 540, a 4: 1 multiplexer (MUX, 530), and a 1-bit converter 521 according to the present invention.

이하에서는, 임의의 자리 비트인 i번째 비트가 부호를 나타내는 부호비트와 크기를 나타내는 크기비트로 구성되는 부호수인 제1 부호수 및 제2 부호수를 가정한다. 또한, 곱셈 연산의 두 입력값을 제1입력값, 제2입력값으로 정의한다.In the following, it is assumed that the first code number and the second code number which are the number of codes composed of a code bit representing a code and a size bit representing a size are the i-th bit, which is an arbitrary digit bit. In addition, two input values of the multiplication operation are defined as a first input value and a second input value.

입출력 버퍼부(500)는 제2입력값, 모듈러값, 미리 연산된 제2입력값과 모듈러값의 덧셈값, 0를 각각 Y 레지스터(511), M 레지스터(512), Y+M 레지스터(513), 0 레지스터(514)에 전송하고, 쉬프트 레지스터(550)에 의한 쉬프트값을 이용하여 제1입력값 및 제2입력값의 곱셈 연산 결과를 생성하여 출력한다.The input / output buffer unit 500 sets a second input value, a modular value, a pre-calculated second input value and a modular value, and zeros to the Y register 511, the M register 512, and the Y + M register 513, respectively. ), And a result of multiplication of the first input value and the second input value is generated and output using the shift value of the shift register 550.

Y 레지스터(511), M 레지스터(512), Y+M 레지스터(513), 0 레지스터(514)는 각각, 제2입력값, 모듈러값, 미리 연산된 제2입력값과 모듈러값의 덧셈값, 0를 저장한다.The Y register 511, the M register 512, the Y + M register 513, and the 0 register 514 respectively include a second input value, a modular value, a pre-calculated second input value and a modular value, Store 0.

변환기(521) 및 컨트롤러(522)는 제1입력값에 따라 멀티플레서(530)를 제어한다. 이에 따라, 제2입력값의 덧셈 여부가 결정된다.The converter 521 and the controller 522 control the multiplexer 530 according to the first input value. Accordingly, whether to add the second input value is determined.

멀티플렉서(530)는 제1입력값에 따라, 제2입력값, 상기 제1입력값 및 제2입력값을 이용한 모듈러값, 상기 모듈러값과 제2입력값을 합산한 값 또는 0 중 어느 하나를 선택하여 본 발명에 따른 덧셈 장치(Nadder, 540)에 제2부호수로 입력한다.The multiplexer 530 may select one of a second input value, a modular value using the first input value and a second input value, a sum of the modular value and the second input value, or 0 according to the first input value. Selected and input to the adder (540) according to the present invention as a second code number.

본 발명에 따른 덧셈 장치(Nadder, 540)는 도 4a의 제1연산부(410), 제2연산부(420) 및 결과값 산출부(430)를 포함한다.The adder 540 according to the present invention includes a first operator 410, a second operator 420, and a result calculator 430 of FIG. 4A.

쉬프트 레지스터(550)는 본 발명에 따른 덧셈 장치(Nadder, 540)의 덧셈 결과값을 쉬프트 연산한 쉬프트값을 본 발명에 따른 덧셈 장치(Nadder, 540)에 제1부호수로 다시 입력한다.The shift register 550 re-inputs the shift value obtained by shifting the addition result of the adder 540 according to the present invention to the adder 540 according to the present invention as a first code number.

곱셈이 시작되기 전 한 번의 연산으로 Y+M을 연산하고 레지스터에 저장한다. 두 (n+1)비트의 덧셈이므로 캐리 전파를 고려하면 (n+2)비트까지 확장된다.

Figure 112006029079928-PAT00077
는 부호수이므로 변환기(521)를 이용해서 한 비트씩 이진수로 표현하고, 이진수
Figure 112006029079928-PAT00078
,
Figure 112006029079928-PAT00079
에 따라 멀티플렉서(MUX, 530)를 이용하여 피 연산자
Figure 112006029079928-PAT00080
중에서 어느 하나를 선택한다. Before the multiplication begins, one operation computes Y + M and stores it in a register. The addition of two (n + 1) bits extends to (n + 2) bits when considering carry propagation.
Figure 112006029079928-PAT00077
Since is the number of signs, it is represented in binary by bit using the converter 521.
Figure 112006029079928-PAT00078
,
Figure 112006029079928-PAT00079
Operand using multiplexer (MUX, 530)
Figure 112006029079928-PAT00080
Choose one.

중간 결과 A와 멀티플렉서(MUX, 530)를 통해

Figure 112006029079928-PAT00081
,
Figure 112006029079928-PAT00082
에 따라
Figure 112006029079928-PAT00083
에서 선택된 피 연산자가 본 발명에 따른 덧셈 장치(Nadder)에 입력된다. Y+M은 최대 (n+2)비트의 크기를 갖고 A는 최대 (n+3)비트까지 확장되어 쉬프트 연산을 수행하면 (n+2)비트가 된다. 또한, 변형 몽고메리(Montgomery) 곱셈 알고리즘을 이용한 본 발명에 따른 곱셈 장치에서 출력 결과 A는 (n+1)비트가 된 다.Through intermediate result A and multiplexer (MUX, 530)
Figure 112006029079928-PAT00081
,
Figure 112006029079928-PAT00082
Depending on the
Figure 112006029079928-PAT00083
The operand selected in is input to the adder according to the present invention. Y + M has a maximum size of (n + 2) bits and A extends up to (n + 3) bits to make (n + 2) bits when the shift operation is performed. Also, in the multiplication apparatus according to the present invention using the modified Montgomery multiplication algorithm, the output result A becomes (n + 1) bits.

본 발명에 따른 곱셈 장치에서, 두 (n+1)비트 피 연산자의 덧셈은 곱셈을 수행하는 동안 (n+3)비트까지 연산이 확장되며 곱셈 수행이 종료되어 출력되는 결과는 2M보다 작은 (n+1)비트 값이 된다.In the multiplication apparatus according to the present invention, the addition of two (n + 1) bit operands extends the operation to (n + 3) bits during the multiplication, and the result of the multiplication is terminated and the output is less than 2M (n +1) bit value.

본 발명에 따른 곱셈 장치에서 입력의 최상위 두 비트는 [1, 1]이 되는 경우가 나타나지 않는다. 따라서 최상위 두 비트가 [1, 1]이 아닌 경우, 즉 [1, 0], [1,

Figure 112006029079928-PAT00084
]은 연산 2단계에서
Figure 112006029079928-PAT00085
,
Figure 112006029079928-PAT00086
가 되므로 XOR 연산을 통해서 0이 된다. 따라서
Figure 112006029079928-PAT00087
은 (n+2)비트가 되고 쉬프트 연산을 통해 (n+1)비트를 유지할 수 있다. In the multiplication apparatus according to the present invention, the two most significant bits of the input do not appear to be [1, 1]. Thus, if the two most significant bits are not [1, 1], that is, [1, 0], [1,
Figure 112006029079928-PAT00084
] Is the second step
Figure 112006029079928-PAT00085
,
Figure 112006029079928-PAT00086
Becomes 0 through XOR operation. therefore
Figure 112006029079928-PAT00087
Becomes (n + 2) bits and can hold (n + 1) bits through the shift operation.

도 5b는 도 5a의 변환기(521)에 대한 상세 블럭도이다.FIG. 5B is a detailed block diagram of the converter 521 of FIG. 5A.

도 5b는 본 발명에 따른 부호수를 이진수로 바꾸는 변환기를 도시한 것이다. 몽고메리(Montgomery) 곱셈에서 Y의 덧셈 여부를 결정하는

Figure 112006029079928-PAT00088
는 부호수를 이용하므로
Figure 112006029079928-PAT00089
이 될 수 있다.
Figure 112006029079928-PAT00090
는 Y의 뺄셈을 의미한다. 따라서, Y의 음수 값을 구하기 위하여 Y의 2의 보수를 연산해야 하는 비용을 추가로 부담해야 하는 문제가 발생한다. 변환기(521)를 본 발명에 따른 곱셈 장치에 적용 가능하면, 추가적인 연산을 줄이고, 효율적인 구성을 가능하게 할 수 있다.5B shows a converter for converting the number of codes to binary in accordance with the present invention. Determining whether to add Y in Montgomery multiplication
Figure 112006029079928-PAT00088
Uses the number of signs
Figure 112006029079928-PAT00089
This can be
Figure 112006029079928-PAT00090
Means the subtraction of Y. Therefore, a problem arises in that the additional cost of calculating two's complement of Y is additionally calculated to obtain a negative value of Y. If the transducer 521 is applicable to the multiplication apparatus according to the present invention, it is possible to reduce further computation and to enable an efficient configuration.

X는 부호수로 표현되지만 양수이므로 X는 부호수에서 이진수로 표현이 가능 하다. 예를 들어, X가

Figure 112006029079928-PAT00091
이라고 가정하면, 최하위 비트가
Figure 112006029079928-PAT00092
이므로
Figure 112006029079928-PAT00093
과 같이 표현 가능하고, 따라서 곱셈 장치에 이용할
Figure 112006029079928-PAT00094
은 1이 되며, 다음 비트로 넘어가는 캐리는
Figure 112006029079928-PAT00095
이 된다. 두 번째 비트가
Figure 112006029079928-PAT00096
이므로 이전 캐리
Figure 112006029079928-PAT00097
과 덧셈을 수행하면 합, 즉 곱셈 장치에 이용되는
Figure 112006029079928-PAT00098
은 0이 되고 캐리는
Figure 112006029079928-PAT00099
이 된다. 이와 같은 방법으로 곱셈 장치가 반복 연산하는 동안 한 비트씩 연산되어 Y의 덧셈 여부를 결정하게 된다.X is expressed as a sign number, but since it is a positive number, X can be represented as a binary number. For example, X
Figure 112006029079928-PAT00091
Let 's assume that the least significant bit
Figure 112006029079928-PAT00092
Because of
Figure 112006029079928-PAT00093
Can be expressed as
Figure 112006029079928-PAT00094
Becomes 1, and the carry to the next bit
Figure 112006029079928-PAT00095
Becomes Second bit
Figure 112006029079928-PAT00096
So carry before
Figure 112006029079928-PAT00097
And addition are sums, i.e. multipliers
Figure 112006029079928-PAT00098
Becomes 0 and Carrie
Figure 112006029079928-PAT00099
Becomes In this way, the multiplication apparatus is operated bit by bit during the iterative operation to determine whether to add Y.

도 6a는 본 발명에 따른 덧셈 방법의 흐름도이다.6A is a flowchart of an addition method according to the present invention.

먼저, 임의의 자리 비트인 i번째 비트가 부호를 나타내는 부호비트와 크기를 나타내는 크기비트로 구성되는 부호수인 제1 부호수 및 제2 부호수를 가정한다.First, it is assumed that the first code number and the second code number, which are the number of codes composed of a code bit representing a code and a size bit representing a size, are specified.

다음, 제1 부호수의 i번째 비트와 제2 부호수의 i번째 비트를 합산하여 음의수인 제1 합의 i번째 비트와 부호수인 제1 캐리의 i+1번째 비트를 생성한다(610 과정).Next, the i-th bit of the first code number and the i-th bit of the second code number are added together to generate the i-th bit of the first sum of the negative number and the i + 1th bit of the first carry of the code number (610). process).

제1 합의 i번째 비트와 제1 캐리의 i+1번째 비트가 생성되면, 제1 합의 i번째 비트를 부호를 갖지 않는 이진수로 변환한 제2 합의 i번째 비트를 생성하고, 제2 합의 i번째 비트에 따라 제1 캐리의 i+1번째 비트를 변환시켜 부호수인 제2 캐리의 i+1번째 비트를 생성한다(620 과정).When the i th bit of the first sum and the i + 1 th bit of the first carry are generated, generate an i th bit of the second sum obtained by converting the i th bit of the first sum to an unsigned binary number, and then the i th th sum of the second sum The i + 1 th bit of the first carry is converted according to the bit to generate the i + 1 th bit of the second carry, which is the number of codes (step 620).

마지막으로, 제2 캐리의 i번째 비트와 제2 합의 i번째 비트를 합산하여 덧셈 결과값을 생성한다(630 과정).Finally, the sum of the i-th bit of the second carry and the i-th bit of the second sum is added to generate an addition result (operation 630).

도 6b는 도 6a의 상세 알고리즘을 도시한 것이다.FIG. 6B shows the detailed algorithm of FIG. 6A.

논리 회로에서 이용하는 기호에 대해 ∨는 OR 연산, ∧는 AND 연산, (+)는 XOR 연산, ∼는 NOT 연산이라 정의한다.For symbols used in logic circuits, ∨ is defined as OR operation, ∧ is AND operation, (+) is defined as XOR operation, and ~ is NOT operation.

Figure 112006029079928-PAT00100
Figure 112006029079928-PAT00101
에 대한 덧셈의 경우의 수는 총 9가지이며 결과는 캐리와 합으로 나타낸다. 논리 회로는 다음과 같이 구성된다.
Figure 112006029079928-PAT00102
Figure 112006029079928-PAT00103
으로 생성되고
Figure 112006029079928-PAT00104
Figure 112006029079928-PAT00105
Figure 112006029079928-PAT00106
으로 생성된다. 합 [
Figure 112006029079928-PAT00107
,
Figure 112006029079928-PAT00108
]은 음의 수 이므로 동일한 값을 갖는다. 따라서
Figure 112006029079928-PAT00109
으로 두 값이 동시에 생성되고,
Figure 112006029079928-PAT00110
을 제외한 나머지 연산은 게이트 지연 시간 1단계에서 수행되고
Figure 112006029079928-PAT00111
의 정확한 값은 게이트 지연 시간 2단계에서 결정된다.
Figure 112006029079928-PAT00100
Wow
Figure 112006029079928-PAT00101
There are 9 total cases for addition and the result is expressed as carry and sum. The logic circuit is constructed as follows.
Figure 112006029079928-PAT00102
Is
Figure 112006029079928-PAT00103
Generated by
Figure 112006029079928-PAT00104
Is
Figure 112006029079928-PAT00105
Figure 112006029079928-PAT00106
Is generated. Sum [
Figure 112006029079928-PAT00107
,
Figure 112006029079928-PAT00108
] Is negative and has the same value. therefore
Figure 112006029079928-PAT00109
Two values are created at the same time,
Figure 112006029079928-PAT00110
Except the operation is performed in the first step of the gate delay time.
Figure 112006029079928-PAT00111
The exact value of is determined in step 2 of the gate delay time.

i번째 비트의 연산에서 연산 2단계의 두 입력은

Figure 112006029079928-PAT00112
Figure 112006029079928-PAT00113
이다.
Figure 112006029079928-PAT00114
는 i번째 비트의 연산 1단계의 결과이고
Figure 112006029079928-PAT00115
는 (i-1)번째 비트에서 연산된 값이다. 연산 2단계의 연산의 논리 회로는 다음과 같이 구성된다. 캐리
Figure 112006029079928-PAT00116
는 음의 수 이므로
Figure 112006029079928-PAT00117
Figure 112006029079928-PAT00118
Figure 112006029079928-PAT00119
의 연산을 통해 동일한 값을 갖는다. 합
Figure 112006029079928-PAT00120
는 이진수이므로 부호 비트는 0이 되고
Figure 112006029079928-PAT00121
Figure 112006029079928-PAT00122
의 연산을 통해 결정된다.In the operation of the i bit, the two inputs of operation 2
Figure 112006029079928-PAT00112
Wow
Figure 112006029079928-PAT00113
to be.
Figure 112006029079928-PAT00114
Is the result of operation 1 of the i bit
Figure 112006029079928-PAT00115
Is the value computed from the (i-1) th bit. The logic circuit of the operation of operation 2 is constructed as follows. Carry
Figure 112006029079928-PAT00116
Is a negative number
Figure 112006029079928-PAT00117
Wow
Figure 112006029079928-PAT00118
this
Figure 112006029079928-PAT00119
Through the operation of has the same value. synthesis
Figure 112006029079928-PAT00120
Is a binary number, so the sign bit is 0.
Figure 112006029079928-PAT00121
silver
Figure 112006029079928-PAT00122
Is determined by the operation of.

연산 3단계는 연산 2단계의 출력들에 대한 XOR 연산을 통해 하나의 값으로 표현한다.

Figure 112006029079928-PAT00123
Figure 112006029079928-PAT00124
의 연산을 통해서 구할 수 있고
Figure 112006029079928-PAT00125
Figure 112006029079928-PAT00126
의 연산을 통해서 구할 수 있다.The operation stage 3 is expressed as one value through the XOR operation on the outputs of the operation stage 2.
Figure 112006029079928-PAT00123
Is
Figure 112006029079928-PAT00124
Can be obtained by
Figure 112006029079928-PAT00125
Is
Figure 112006029079928-PAT00126
It can be obtained by operation of.

피 연산자 X, Y는 2M 보다 작은 범위에 있고 (n+1)비트의 크기이므로 본 발명에 따른 곱셈 장치는 (n+2)번째 자리까지 고려해야 한다. 그러나, 피 연산자는 음수가 아니므로 피 연산자의 최상위 비트는

Figure 112006029079928-PAT00127
이 될 수 없다. 그러므로 부호 비트는 고려하지 않는다.Since the operands X and Y are in the range less than 2M and are (n + 1) bits in size, the multiplication apparatus according to the present invention should consider the (n + 2) th digit. However, the operand is not negative, so the most significant bit of the operand is
Figure 112006029079928-PAT00127
This can't be. Therefore, the sign bit is not taken into account.

최상위 두 비트에 대한 연산 또한 3단계와 지연 시간 5단계로 구성된다. 연산 1단계는 앞에서 언급한 바와 같이 음수가 아니므로 두 이진수의 덧셈에 대한 부호화 기법을 이용한다.

Figure 112006029079928-PAT00128
는 이진수로 표현되고
Figure 112006029079928-PAT00129
는 음의수로 표현되므로
Figure 112006029079928-PAT00130
은 0이 되고
Figure 112006029079928-PAT00131
Figure 112006029079928-PAT00132
Figure 112006029079928-PAT00133
의 연산을 통해 동일한 값을 갖는다.
Figure 112006029079928-PAT00134
Figure 112006029079928-PAT00135
Figure 112006029079928-PAT00136
을 통해 연산된다. 연산 2단계와 3단계는 n번째 자리까지의 연산과 동일하게 수행된다. 연산 1단계에서 발생하는 캐리와 연산 2단계에서 발생하는 캐리는 XOR 연산을 통해
Figure 112006029079928-PAT00137
를 결정한다. The operation on the most significant two bits also consists of three steps and five steps of delay time. As mentioned earlier, the first step is not negative, so we use the coding method for the addition of two binary numbers.
Figure 112006029079928-PAT00128
Is represented in binary
Figure 112006029079928-PAT00129
Is represented by a negative number
Figure 112006029079928-PAT00130
Becomes 0
Figure 112006029079928-PAT00131
and
Figure 112006029079928-PAT00132
silver
Figure 112006029079928-PAT00133
Through the operation of has the same value.
Figure 112006029079928-PAT00134
Is
Figure 112006029079928-PAT00135
Figure 112006029079928-PAT00136
Calculated by Operation steps 2 and 3 are performed in the same way as the operation up to the nth digit. Carry occurs in operation 1 and carry occurs in operation 2 through XOR operation.
Figure 112006029079928-PAT00137
Determine.

도 6c는 도 6b에 의한 연산 과정의 일 예를 도시한 것이다.FIG. 6C illustrates an example of a calculation process according to FIG. 6B.

두 부호수의 덧셈을 단계 1이라 하고 부호수와 음의수의 덧셈을 단계 2라고 가정한다. 또한, 단계 1의 결과를

Figure 112006029079928-PAT00138
이라 하고 단계 2의 결과를
Figure 112006029079928-PAT00139
라고 가정한다. 최종 결과를 A라 할 때, 두 부호수
Figure 112006029079928-PAT00140
Figure 112006029079928-PAT00141
의 덧셈은 도 6c과 같이 수행된다.The addition of the two code numbers is called step 1 and the addition of the signed and negative numbers is called step 2. In addition, the results of step 1
Figure 112006029079928-PAT00138
Called the result of step 2
Figure 112006029079928-PAT00139
Assume that When the final result is called A, both numbers
Figure 112006029079928-PAT00140
Wow
Figure 112006029079928-PAT00141
Addition is performed as shown in FIG. 6C.

Figure 112006029079928-PAT00142
값이
Figure 112006029079928-PAT00143
또는
Figure 112006029079928-PAT00144
인 경우, 출력 결과
Figure 112006029079928-PAT00145
Figure 112006029079928-PAT00146
에서 도 3a와 같이
Figure 112006029079928-PAT00147
로 대체하면,
Figure 112006029079928-PAT00148
은 부호수가 되고
Figure 112006029079928-PAT00149
은 음의수가 된다. 부호수
Figure 112006029079928-PAT00150
와 음의수
Figure 112006029079928-PAT00151
의 덧셈 결과를
Figure 112006029079928-PAT00152
라 할 때, 도 3b와 같이
Figure 112006029079928-PAT00153
Figure 112006029079928-PAT00154
또는
Figure 112006029079928-PAT00155
인 경우 출력 결과의
Figure 112006029079928-PAT00156
에서
Figure 112006029079928-PAT00157
로 대체하면
Figure 112006029079928-PAT00158
는 음의수가 되고
Figure 112006029079928-PAT00159
는 이진수가 된다. 따라서
Figure 112006029079928-PAT00160
Figure 112006029079928-PAT00161
의 덧셈은 캐리 전파 없이 수행된다.
Figure 112006029079928-PAT00142
Value is
Figure 112006029079928-PAT00143
or
Figure 112006029079928-PAT00144
If is output
Figure 112006029079928-PAT00145
To
Figure 112006029079928-PAT00146
As shown in Figure 3a
Figure 112006029079928-PAT00147
If replaced with
Figure 112006029079928-PAT00148
Becomes the sign number
Figure 112006029079928-PAT00149
Is a negative number. Number of signs
Figure 112006029079928-PAT00150
And negative numbers
Figure 112006029079928-PAT00151
Add result
Figure 112006029079928-PAT00152
When we say, as shown in Figure 3b
Figure 112006029079928-PAT00153
end
Figure 112006029079928-PAT00154
or
Figure 112006029079928-PAT00155
If is the output of
Figure 112006029079928-PAT00156
in
Figure 112006029079928-PAT00157
If you substitute
Figure 112006029079928-PAT00158
Is negative
Figure 112006029079928-PAT00159
Is a binary number. therefore
Figure 112006029079928-PAT00160
Wow
Figure 112006029079928-PAT00161
Addition is done without carry propagation.

도 6d는 종래의 덧셈 방법 및 본 발명에 따른 덧셈 방법의 공간 복잡도와 시간 복잡도를 도시한 표이다.6D is a table showing spatial complexity and time complexity of the conventional addition method and the addition method according to the present invention.

도 6d에서와 같이 본 발명에 따른 덧셈 장치(Nadder)의 공간 복잡도는 게이트의 개수는 종래의(McIvor의 2) 방법보다 약 8% 감소하고, 지연 시간은 종래의(McIvor의 2) 방법보다 약 17% 줄어든다.As shown in FIG. 6D, the spatial complexity of the adder according to the present invention is reduced by about 8% in the number of gates compared with the conventional (McIvor's 2) method, and the delay time is lower than that of the conventional (McIvor's 2) method. 17% less.

도 7은 본 발명에 따른 곱셈 방법을 도시한 것이다.7 shows a multiplication method according to the present invention.

입력으로 n+1비트의 제1입력값(X) 및 제2입력값(Y), 제1입력값(X) 및 제2입력값(Y)에 따른 n비트의 모듈러 값(M)을 가정한다.Assume n + 1 bits of first input value X and second input value Y, n-bit modular value M according to first input value X and second input value Y as inputs. do.

먼저, 곱셈 연산 결과 변수 A를 0으로 초기화시킨다(1).First, the multiplication result variable A is initialized to 0 (1).

다음, 본 발명에 따른 덧셈 방법(Nadder)을 이용하여 Y와 M을 더한 값을 변수 D에 저장한다(2).Next, a value obtained by adding Y and M is stored in the variable D by using an adder method according to the present invention (2).

다음의 과정은 제1입력값(X) 및 제2입력값(Y)의 0번째 비트부터 n+1번째 비트까지 반복하여 수행한다(3).The following process is repeatedly performed from the 0 th bit to the n + 1 th bit of the first input value X and the second input value Y (3).

곱셈 연산 결과 변수 A의 0번째 비트, 제1입력값의 i번째 비트, 제2입력값의 0번째 비트를 이용하여 변수 ui를 결정한다(3.1).As a result of the multiplication operation, the variable ui is determined using the 0 th bit of the variable A, the i th bit of the first input value, and the 0 th bit of the second input value (3.1).

제1입력값의 i번째 비트값과 변수 ui의 값에 다라 결과 변수 A를 갱신한다(3.2). The resultant variable A is updated according to the i-th bit value of the first input value and the value of the variable ui (3.2).

이때, 제1입력값의 i번째 비트값이 0이고 변수 ui의 값이 0이면, A+0을 본 발명에 따른 덧셈 방법(Nadder)을 이용하여 연산한 결과를 쉬프트 시킨 값을 A에 저장한다.At this time, if the i-th bit value of the first input value is 0 and the value of the variable ui is 0, the shifted value of A + 0 using the adder according to the present invention is stored in A. .

이때, 제1입력값의 i번째 비트값이 1이고 변수 ui의 값이 0이면, A+Y를 본 발명에 따른 덧셈 방법(Nadder)을 이용하여 연산한 결과를 쉬프트 시킨 값을 A에 저장한다.In this case, when the i-th bit value of the first input value is 1 and the value of the variable ui is 0, the shifted value of A + Y using the adder according to the present invention is stored in A. .

이때, 제1입력값의 i번째 비트값이 0이고 변수 ui의 값이 1이면, A+M을 본 발명에 따른 덧셈 방법(Nadder)을 이용하여 연산한 결과를 쉬프트 시킨 값을 A에 저장한다.In this case, when the i-th bit value of the first input value is 0 and the value of the variable ui is 1, the shifted value of A + M using the addition method according to the present invention is stored in A. .

이때, 제1입력값의 i번째 비트값이 1이고 변수 ui의 값이 1이면, A+D를 본 발명에 따른 덧셈 방법(Nadder)을 이용하여 연산한 결과를 쉬프트 시킨 값을 A에 저장한다.In this case, when the i-th bit value of the first input value is 1 and the value of the variable ui is 1, the shifted value of A + D using the addition method according to the present invention is stored in A. .

위의 과정을 제1입력값(X) 및 제2입력값(Y)의 0번째 비트부터 n+1번째 비트까지 반복하여 수행한다.The above process is repeatedly performed from the 0 th bit to the n + 1 th bit of the first input value X and the second input value Y.

도 8은 종래의 곱셈 방법 및 본 발명에 따른 곱셈 방법의 지연 시간을 도시한 표이다.8 is a table illustrating a delay time of a conventional multiplication method and a multiplication method according to the present invention.

캐리 저장 가산기(CSA)를 이용하는 전형적인 알고리즘 종래의 방법 1은 클럭사이클이 n+34로 길고, 32개의 전가산기에 의한 지연시간을 필요로 한다. 또한, 캐리 저장 가산기(CSA)와 멀티플렉서를 이용하는 종래의 방법 2는 캐리 전파에 의한 지연 시간을 필요로 한다.Typical Algorithm Using Carry Storage Adder (CSA) Conventional method 1 has a long clock cycle of n + 34 and requires delay by 32 full adders. In addition, the conventional method 2 using a carry storage adder (CSA) and a multiplexer requires a delay time due to carry propagation.

종래의 방법 3(McIvor의 2)을 이용하는 곱셈 장치 본 발명에 따른 덧셈 장치(Nadder)를 이용한 곱셈 장치를 비교하여 효율성을 알아보면 다음과 같다. 이때, 곱셈 장치의 다른 부분을 제외하고 덧셈 부분만 비교 하여 두 곱셈 장치의 효율성 비교가 가능하다. 본 발명에 따른 덧셈 장치(Nadder)를 이용한 곱셈 장치는 종래의 방법 3(McIvor의 2)을 이용한 곱셈 장치의 덧셈 연산 부분과 비교하여 공간 복잡도는 8% 감소한고, 시간 복잡도는 17% 감소한다. Multiplication Device Using Conventional Method 3 (2 of McIvor) The efficiency of the multiplication device using an adder according to the present invention (Nadder) is compared. In this case, it is possible to compare the efficiency of the two multiplication devices by comparing only the addition part except for the other parts of the multiplication device. In the multiplication apparatus using the adder according to the present invention, the space complexity is reduced by 8% and the time complexity is reduced by 17% compared with the addition operation part of the multiplication apparatus using the conventional method 3 (2 of McIvor).

따라서 본 발명에 따른 덧셈 장치(Nadder)를 이용한 곱셈 장치는 종래의 곱셈 방법 중 고비도에서 효율적인 종래의(McIvor의 2) 방법을 이용한 곱셈 장치보다 효율적이다.Therefore, the multiplication apparatus using the adder according to the present invention is more efficient than the multiplication apparatus using the conventional (McIvor's 2) method which is efficient at high ratio among the conventional multiplication methods.

특히, 복잡도를 줄이기 위해서 연산을 수행하는 동안, 부호수의 특징을 이용하여 하이 래딕스(High-radix) 연산에 적용할 경우, 2의 보수 연산에서 이진수로 표현할 때 고려해야 하는 캐리 전파를 고려하지 않아도 되는 추가적인 성능 향상을 갖는다. 부호수를 이용한 다양한 부호화 기법은 여러 분야에 적용될 수 있다.In particular, during the operation to reduce the complexity, when applying to the high-radix operation using the characteristic of the number of codes, the carry propagation that must be considered when representing in binary in the two's complement operation is not considered. Has an additional performance improvement. Various coding techniques using the number of codes can be applied to various fields.

바람직하게는, 본 발명의 부호화를 이용하는 덧셈 방법을 컴퓨터에서 실행시키기 위한 프로그램을 컴퓨터로 읽을 수 있는 기록매체에 기록하여 제공할 수 있다.Preferably, a program for executing the addition method using the encoding of the present invention on a computer can be recorded and provided on a computer-readable recording medium.

바람직하게는, 본 발명의 부호화를 이용하는 곱셈 방법을 컴퓨터에서 실행시키기 위한 프로그램을 컴퓨터로 읽을 수 있는 기록매체에 기록하여 제공할 수 있다.Preferably, a program for executing the multiplication method using the encoding of the present invention on a computer can be recorded and provided on a computer-readable recording medium.

본 발명은 소프트웨어를 통해 실행될 수 있다. 소프트웨어로 실행될 때, 본 발명의 구성 수단들은 필요한 작업을 실행하는 코드 세그먼트들이다. 프로그램 또는 코드 세그먼트들은 프로세서 판독 가능 매체에 저장되거나 전송 매체 또는 통신망에서 반송파와 결합된 컴퓨터 데이터 신호에 의하여 전송될 수 있다. The invention can be implemented via software. When implemented in software, the constituent means of the present invention are code segments that perform the necessary work. The program or code segments may be stored on a processor readable medium or transmitted by a computer data signal coupled with a carrier on a transmission medium or network.

본 발명은 도면에 도시된 일 실시예를 참고로 하여 설명하였으나 이는 예시적인 것에 불과하며 당해 분야에서 통상의 지식을 가진 자라면 이로부터 다양한 변형 및 실시예의 변형이 가능하다는 점을 이해할 것이다. 그러나, 이와 같은 변형은 본 발명의 기술적 보호범위내에 있다고 보아야 한다. 따라서, 본 발명의 진정한 기술적 보호범위는 첨부된 특허청구범위의 기술적 사상에 의해서 정해져야 할 것이다.Although the present invention has been described with reference to one embodiment shown in the drawings, this is merely exemplary and will be understood by those of ordinary skill in the art that various modifications and variations can be made therefrom. However, such modifications should be considered to be within the technical protection scope of the present invention. Therefore, the true technical protection scope of the present invention will be defined by the technical spirit of the appended claims.

상술한 바와 같이, 본 발명에 의하면, 부호와 기법을 적용하여 덧셈 연산을 하거나 부호와 기법을 적용한 덧셈 연산을 이용하여 곱셈 연산을 수행함으로써, 공간 복잡도와 시간 복잡도를 줄여 성능을 향상시키고, 제조 비용을 감소시킬 수 있는 효과가 있다. 또한, 또한, 부호수의 특징을 이용하여 하이 래딕스(High-radix) 연산을 적용 할 경우, 2의 보수 연산에서 고려해야 하는 캐리 전파를 고려하지 않아도 되는 추가적인 성능 향상을 가능하게 하는 효과가 있다. As described above, according to the present invention, by performing the addition operation by applying the sign and technique, or by performing the multiplication operation using the addition operation by applying the sign and technique, to improve the performance by reducing the space complexity and time complexity, manufacturing cost There is an effect that can reduce. In addition, when the high-radix operation is applied using the feature of the number of codes, there is an effect of enabling an additional performance improvement without having to consider the carry propagation that must be considered in the two's complement operation.

Claims (9)

임의의 자리 비트인 i번째 비트가 부호를 나타내는 부호비트와 크기를 나타내는 크기비트로 구성되는 부호수인 제1 부호수 및 제2 부호수에 대하여,For the first code number and the second code number, which is the number of codes consisting of a code bit representing a code and a size bit representing a size, the i-th bit, which is an arbitrary digit bit, 상기 제1 부호수의 i번째 비트와 상기 제2 부호수의 i번째 비트를 합산하여 음의수인 제1 합의 i번째 비트와 부호수인 제1 캐리의 i+1번째 비트를 생성하는 제1연산부;A first sum of the i th bit of the first code number and the i th bit of the second code number to generate an i th bit of a first sum of a negative number and an i + 1 th bit of a first carry of a number of codes A calculator; 상기 제1 합의 i번째 비트를 부호를 갖지 않는 이진수로 변환한 제2 합의 i번째 비트를 생성하고, 상기 제2 합의 i번째 비트에 따라 상기 제1 캐리의 i+1번째 비트를 변환시켜 부호수인 제2 캐리의 i+1번째 비트를 생성하는 제2연산부; 및Generate an i-th bit of the second sum obtained by converting the i-th bit of the first sum to an unsigned binary number, and convert the i + 1 th bit of the first carry according to the i-th bit of the second sum; A second operation unit generating an i + 1 th bit of the second carry; And 상기 제2 캐리의 i번째 비트와 상기 제2 합의 i번째 비트를 합산하여 덧셈 결과값을 생성하는 결과값 산출부를 포함하는 부호화를 이용하는 덧셈 장치.And a result value calculator for generating an addition result value by adding the i-th bit of the second carry and the i-th bit of the second sum. 제 1 항에 있어서,The method of claim 1, 상기 제1연산부는The first operation unit 상기 제1 부호수의 크기비트 및 제2 부호수의 크기비트의 배타적 논리합 연산을 수행하여 상기 제1 합의 i번째 크기비트 및 부호비트를 생성하는 제1게이트부를 포함하는 것을 특징으로 하는 부호화를 이용하는 덧셈 장치.And a first gate portion configured to perform an exclusive OR operation on the size bits of the first code number and the size bits of the second code number to generate the i-th size bit and the code bit of the first sum. Addition device. 제 1 항에 있어서,The method of claim 1, 상기 제1연산부는The first operation unit 상기 제1 부호수의 부호비트 및 제2 부호수의 부호비트의 논리곱을 연산하여 상기 제1 캐리의 i+1번째 부호비트를 생성하는 제2게이트부; 및A second gate unit configured to generate an i + 1th code bit of the first carry by calculating a logical product of the code bits of the first code number and the code bits of the second code number; And 상기 제1 부호수의 부호비트 및 제2 부호수의 부호비트의 배타적 논리합의 인버스 연산 결과와 상기 제1 부호수의 크기비트 및 제2 부호수의 크기비트의 논리합 연산 결과 사이의 논리곱 연산을 수행하여 상기 제1 캐리의 i+1번째 크기비트를 생성하는 제3게이트부를 포함하는 것을 특징으로 하는 부호화를 이용하는 덧셈 장치.An inverse operation result of the inverse operation of the exclusive OR of the code bits of the first code number and the code bit of the second code number and the result of the OR operation of the size bits of the first code number and the size bits of the second code number And a third gate unit configured to generate an i + 1 th size bit of the first carry. 제 1 항에 있어서,The method of claim 1, 상기 제2연산부는The second operation unit 상기 제2 합의 i번째 부호비트에 비트값 0을 할당하고, 상기 제1 캐리의 크기비트 및 제1 합의 크기비트의 배타적 논리합을 연산하여 상기 제2 합의 i번째 크기비트를 생성하는 제4게이트부; 및A fourth gate unit configured to allocate a bit value 0 to the i-th code bit of the second sum, and compute an exclusive OR of the size bit of the first carry and the size bit of the first sum to generate the i-th size bit of the second sum ; And 상기 제1 캐리의 부호비트 및 제1 캐리의 크기비트의 배타적 논리합의 인버스 연산 결과와 상기 제1 캐리의 부호비트 및 제1 합의 부호비트의 논리합 연산 결과 사이의 논리곱 연산을 수행하여 상기 제2 캐리의 i+1번째 비트를 생성하는 제5게이트부를 포함하는 것을 특징으로 하는 부호화를 이용하는 덧셈 장치.Performing an AND operation between the result of the inverse operation of the exclusive OR of the sign bit of the first carry and the size bit of the first carry and the result of the OR operation of the sign bit of the first carry and the sign of the first consensus; And a fifth gate portion for generating the i + 1th bit of the carry. 임의의 자리 비트인 i번째 비트가 부호를 나타내는 부호비트와 크기를 나타 내는 크기비트로 구성되는 부호수인 제1 부호수 및 제2 부호수에 대하여,For the first code number and the second code number, which is the number of codes composed of a code bit representing a code and a size bit representing a size, the i-th bit, which is an arbitrary digit bit, 상기 제1 부호수의 i번째 비트와 상기 제2 부호수의 i번째 비트를 합산하여 음의수인 제1 합의 i번째 비트와 부호수인 제1 캐리의 i+1번째 비트를 생성하는 제1연산부;A first sum of the i th bit of the first code number and the i th bit of the second code number to generate an i th bit of a first sum of a negative number and an i + 1 th bit of a first carry of a number of codes A calculator; 상기 제1 합의 i번째 비트를 부호를 갖지 않는 이진수로 변환한 제2 합의 i번째 비트를 생성하고, 상기 제2 합의 i번째 비트에 따라 상기 제1 캐리의 i+1번째 비트를 변환시켜 부호수인 제2 캐리의 i+1번째 비트를 생성하는 제2연산부;Generate an i-th bit of the second sum obtained by converting the i-th bit of the first sum to an unsigned binary number, and convert the i + 1 th bit of the first carry according to the i-th bit of the second sum; A second operation unit generating an i + 1 th bit of the second carry; 상기 제2 캐리의 i번째 비트와 상기 제2 합의 i번째 비트를 합산하여 덧셈 결과값을 생성하는 결과값 산출부;A result value calculator configured to add an i-th bit of the second carry and an i-th bit of the second sum to generate an addition result value; 제1입력값에 따라, 제2입력값, 상기 제1입력값 및 제2입력값을 이용한 모듈러값, 상기 모듈러값과 제2입력값을 합산한 값 또는 0 중 어느 하나를 선택하여 상기 제1연산부의 제2부호수로 출력하는 멀티플렉서;According to a first input value, one of a second input value, a modular value using the first input value and the second input value, a sum of the modular value and the second input value, or one selected from zero is selected. A multiplexer outputting the second coder of the operation unit; 상기 제1입력값에 따라 상기 멀티플레서를 제어하여 제2입력값의 덧셈 여부를 결정하는 변환기;A converter to determine whether to add a second input value by controlling the multiplexer according to the first input value; 상기 결과값 산출부의 덧셈 결과값을 쉬프트 연산한 쉬프트값을 상기 제1연산부의 제1부호수로 출력하는 쉬프트 레지스터; 및A shift register configured to output a shift value obtained by shifting an addition result value of the result value calculator as a first code number of the first calculator; And 상기 쉬프트값을 이용하여 제1입력값 및 제2입력값의 곱셈 연산 결과를 생성하는 입출력 버퍼부를 포함하는 부호화를 이용하는 곱셈 장치.And an input / output buffer unit configured to generate a multiplication result of a first input value and a second input value by using the shift value. 임의의 자리 비트인 i번째 비트가 부호를 나타내는 부호비트와 크기를 나타 내는 크기비트로 구성되는 부호수인 제1 부호수 및 제2 부호수에 대하여,For the first code number and the second code number, which is the number of codes composed of a code bit representing a code and a size bit representing a size, the i-th bit, which is an arbitrary digit bit, 상기 제1 부호수의 i번째 비트와 상기 제2 부호수의 i번째 비트를 합산하여 음의수인 제1 합의 i번째 비트와 부호수인 제1 캐리의 i+1번째 비트를 생성하는 단계;Adding the i-th bit of the first code number and the i-th bit of the second code number to generate an i-th bit of the first sum, which is a negative number, and an i + 1th bit of the first carry, which is a code number; 상기 제1 합의 i번째 비트를 부호를 갖지 않는 이진수로 변환한 제2 합의 i번째 비트를 생성하고, 상기 제2 합의 i번째 비트에 따라 상기 제1 캐리의 i+1번째 비트를 변환시켜 부호수인 제2 캐리의 i+1번째 비트를 생성하는 단계; 및Generate an i-th bit of the second sum obtained by converting the i-th bit of the first sum to an unsigned binary number, and convert the i + 1 th bit of the first carry according to the i-th bit of the second sum; Generating an i + 1 th bit of the second carry; And 상기 제2 캐리의 i번째 비트와 상기 제2 합의 i번째 비트를 합산하여 덧셈 결과값을 생성하는 단계를 포함하는 부호화를 이용하는 덧셈 방법.And adding an i th bit of the second carry and an i th bit of the second sum to generate an addition result value. 제 6 항에 있어서,The method of claim 6, 상기 제1 캐리의 i+1번째 비트를 생성하는 단계는Generating the i + 1 th bit of the first carry 상기 제1 부호수의 크기비트 및 제2 부호수의 크기비트의 배타적 논리합 연산을 수행하여 상기 제1 합의 i번째 크기비트 및 부호비트를 생성하는 단계;Generating an ith size bit and a sign bit of the first sum by performing an exclusive OR operation on the size bits of the first code number and the size bits of the second code number; 상기 제1 부호수의 부호비트 및 제2 부호수의 부호비트의 논리곱을 연산하여 상기 제1 캐리의 i+1번째 부호비트를 생성하는 단계; 및Generating an i + 1th code bit of the first carry by calculating a logical product of the code bits of the first code number and the code bits of the second code number; And 상기 제1 부호수의 부호비트 및 제2 부호수의 부호비트의 배타적 논리합의 인버스 연산 결과와 상기 제1 부호수의 크기비트 및 제2 부호수의 크기비트의 논리합 연산 결과 사이의 논리곱 연산을 수행하여 상기 제1 캐리의 i+1번째 크기비트를 생성하는 단계를 포함하는 것을 특징으로 하는 부호화를 이용하는 덧셈 방법.An inverse operation result of the inverse operation of the exclusive OR of the code bits of the first code number and the code bit of the second code number and the result of the OR operation of the size bits of the first code number and the size bits of the second code number And performing an operation to generate an i + 1 th size bit of the first carry. 제 6 항에 있어서,The method of claim 6, 상기 제2 캐리의 i+1번째 비트를 생성하는 단계는Generating the i + 1 th bit of the second carry 상기 제2 합의 i번째 부호비트에 비트값 0을 할당하고, 상기 제1 캐리의 크기비트 및 제1 합의 크기비트의 배타적 논리합을 연산하여 상기 제2 합의 i번째 크기비트를 생성하는 단계; 및Allocating a bit value 0 to the i-th code bit of the second sum and calculating an exclusive OR of the size bit of the first carry and the size bit of the first sum to generate the i-th size bit of the second sum; And 상기 제1 캐리의 부호비트 및 제1 캐리의 크기비트의 배타적 논리합의 인버스 연산 결과와 상기 제1 캐리의 부호비트 및 제1 합의 부호비트의 논리합 연산 결과 사이의 논리곱 연산을 수행하여 상기 제2 캐리의 i+1번째 비트를 생성하는 단계를 포함하는 것을 특징으로 하는 부호화를 이용하는 덧셈 방법.Performing an AND operation between the result of the inverse operation of the exclusive OR of the sign bit of the first carry and the size bit of the first carry and the result of the OR operation of the sign bit of the first carry and the sign of the first consensus; And generating an i + 1 th bit of the carry. 임의의 자리 비트인 i번째 비트가 부호를 나타내는 부호비트와 크기를 나타내는 크기비트로 구성되는 부호수에 대하여,Regarding the number of codes composed of a sign bit representing a sign and a size bit representing a size, the i-th bit, which is an arbitrary digit 제1입력값에 따라, 제2입력값, 상기 제1입력값 및 제2입력값을 이용한 모듈러값, 상기 모듈러값과 제2입력값을 합산한 값 또는 0 중 어느 하나를 선택하여 제2부호수로 출력하는 단계;According to a first input value, a second code is selected by selecting one of a second input value, a modular value using the first input value and a second input value, a sum of the modular value and the second input value, or zero. Outputting the number; 상기 제1 부호수의 i번째 비트와 상기 제2 부호수의 i번째 비트를 합산하여 음의수인 제1 합의 i번째 비트와 부호수인 제1 캐리의 i+1번째 비트를 생성하는 단계;Adding the i-th bit of the first code number and the i-th bit of the second code number to generate an i-th bit of the first sum, which is a negative number, and an i + 1th bit of the first carry, which is a code number; 상기 제1 합의 i번째 비트를 부호를 갖지 않는 이진수로 변환한 제2 합의 i 번째 비트를 생성하고, 상기 제2 합의 i번째 비트에 따라 상기 제1 캐리의 i+1번째 비트를 변환시켜 부호수인 제2 캐리의 i+1번째 비트를 생성하는 단계; 및Generate an i-th bit of the second sum obtained by converting the i-th bit of the first sum to an unsigned binary number, and convert the i + 1 th bit of the first carry according to the i-th bit of the second sum; Generating an i + 1 th bit of the second carry; And 상기 제2 캐리의 i번째 비트와 상기 제2 합의 i번째 비트를 합산하여 덧셈 결과값을 생성하는 단계를 반복하고,Repeating adding the i th bit of the second carry and the i th bit of the second sum to generate an addition result value; 상기 제1입력값에 따라 제어하여 제2입력값의 덧셈 여부를 결정하고,Determine whether to add the second input value by controlling according to the first input value, 상기 덧셈 결과값을 쉬프트 연산한 쉬프트값을 제1부호수로 출력하여 제1입력값 및 제2입력값의 곱셈 연산 결과를 생성하는 단계를 포함하는 부호화를 이용하는 곱셈 방법.And outputting a shift value obtained by shifting the addition result value as a first sign to generate a multiplication result of a first input value and a second input value.
KR1020060037460A 2006-04-26 2006-04-26 Appratus for multipying with sign encoding and Method thereof KR100805272B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020060037460A KR100805272B1 (en) 2006-04-26 2006-04-26 Appratus for multipying with sign encoding and Method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020060037460A KR100805272B1 (en) 2006-04-26 2006-04-26 Appratus for multipying with sign encoding and Method thereof

Publications (2)

Publication Number Publication Date
KR20070105415A true KR20070105415A (en) 2007-10-31
KR100805272B1 KR100805272B1 (en) 2008-02-20

Family

ID=38818861

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020060037460A KR100805272B1 (en) 2006-04-26 2006-04-26 Appratus for multipying with sign encoding and Method thereof

Country Status (1)

Country Link
KR (1) KR100805272B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20190022023A (en) * 2017-08-25 2019-03-06 국방과학연구소 Hardware-implemented modular inversion module

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20190022023A (en) * 2017-08-25 2019-03-06 국방과학연구소 Hardware-implemented modular inversion module

Also Published As

Publication number Publication date
KR100805272B1 (en) 2008-02-20

Similar Documents

Publication Publication Date Title
Miyamoto et al. Systematic design of RSA processors based on high-radix Montgomery multipliers
Kwon et al. Two implementation methods of a 1024-bit RSA cryptoprocessor based on modified Montgomery algorithm
Erdem et al. A general digit-serial architecture for montgomery modular multiplication
JP4554239B2 (en) Montgomery type modular multiplication apparatus and method
US11816448B2 (en) Compressing like-magnitude partial products in multiply accumulation
Timarchi et al. Arithmetic circuits of redundant SUT-RNS
Sutikno et al. Simplified VHDL coding of modified non-restoring square root calculator
KR20040092376A (en) Montgomery modular multiplier and method thereof using carry save addition
JP4273071B2 (en) Divide and square root calculator
US7318080B2 (en) Split radix multiplication
KR100805272B1 (en) Appratus for multipying with sign encoding and Method thereof
US6684236B1 (en) System of and method for efficiently performing computations through extended booth encoding of the operands thereto
Basha et al. Design and Implementation of Radix-4 Based High Speed Multiplier for ALU's Using Minimal Partial Products
Mohan et al. Evaluation of Mixed-Radix Digit Computation Techniques for the Three Moduli RNS {2 n− 1, 2 n, 2 n+ 1− 1}
Son et al. Design and implementation of scalable low-power Montgomery multiplier
Verma et al. FPGA implementation of RSA based on carry save Montgomery modular multiplication
US7051062B2 (en) Apparatus and method for adding multiple-bit binary-strings
Zhao et al. An efficient signed digit montgomery modular multiplication algorithm
Kwak et al. High-speed CORDIC based on an overlapped architecture and a novel σ-prediction method
Iyer et al. Generalised Algorithm for Multiplying Binary Numbers Via Vedic Mathematics
Kang et al. A novel systolic VLSI architecture for fast RSA modular multiplication
Timarchi et al. Maximally redundant high-radix signed-digit residue number system
Wei New residue signed-digit addition algorithm
Artem et al. Area&power optimized modulo (2 n±2 p±1) multiplier
CN117938347A (en) Secure encryption system and method for resisting side channel attack

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
G170 Publication of correction
FPAY Annual fee payment

Payment date: 20111209

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20130111

Year of fee payment: 6

LAPS Lapse due to unpaid annual fee