CN102226885A - Modulo 2n-2k-1 adder and design method thereof - Google Patents

Modulo 2n-2k-1 adder and design method thereof Download PDF

Info

Publication number
CN102226885A
CN102226885A CN2011101370159A CN201110137015A CN102226885A CN 102226885 A CN102226885 A CN 102226885A CN 2011101370159 A CN2011101370159 A CN 2011101370159A CN 201110137015 A CN201110137015 A CN 201110137015A CN 102226885 A CN102226885 A CN 102226885A
Authority
CN
China
Prior art keywords
carry
information
mould
totalizer
prefix
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2011101370159A
Other languages
Chinese (zh)
Inventor
马上
胡剑浩
凌翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
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 University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN2011101370159A priority Critical patent/CN102226885A/en
Publication of CN102226885A publication Critical patent/CN102226885A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Complex Calculations (AREA)

Abstract

The present invention provides a kind of moulds
Figure 2011101370159100004DEST_PATH_IMAGE001
Adder and design method, the mould
Figure 668931DEST_PATH_IMAGE001
Adder includes data pre-processing unit, carry generation unit, carry amending unit and summation unit. The mould Adder designs method correspondingly includes data prediction step, carry generation step, carry amendment step and summation step. Mould provided by the present invention
Figure 622160DEST_PATH_IMAGE001
Adder and design method are corrected using carry twice, duplicate carry information is avoided to calculate, data prediction and carry correction algorithm special simultaneously allows using any existing quick prefix operating structure for calculating carry information, to increase design flexibility, arithmetic speed can be greatly improved.

Description

A kind of mould 2 n-2 k-1 totalizer and method for designing
Technical field
The present invention relates to the signal Processing field, specifically, relate to and a kind ofly be used for communicating by letter and the mould adder and the method for designing based on residue number system (RNS) of signal Processing.
Background technology
At present, along with the development of large scale integrated circuit,, generally believe that in the integrated circuit (IC) design in future large-scale parallel processing technique will replace traditional serial processing mode for satisfying the requirement that integrated circuit processing power and processing speed are improved day by day.Wherein adopting parallel numerical representation method system to replace traditional numerical representation method system is a direction of development, mainly is to realize parallel the carrying out of calculating and handling in the numerical representation method mode, improves the speed of computing thereby start with from front-end algorithm.
System (RNS:Residue Number System) is exactly a parallel numerical characterization system, be characterized in the complex calculation of traditional long number (Bit) is realized with the simple operation of a plurality of parallel less figure places, thereby reduced the complexity of single computing.Therefore, " residue number system " obtained widespread use in digital signal processing (DSP:Digital Signal Processing).In the digital signal processing method based on residue number system, in Fourier transform, digital filter, matrix inversion etc., mould adder is the basic processing unit that makes up other computing module.The mould adder design of optimizing is that residue number system is applied to the key point in the digital signal processing.
Mould 2 of the present invention n-2 k-1 totalizer has adopted twice carry correction, avoided the carry information calculations that repeats, simultaneously special data pre-service and carry correction algorithm allow to use any quick prefix computing of existing scale-of-two structure and are used to calculate carry information, thereby increased the flexible design degree, be easy to realize the balance between time delay, power consumption and area.
Summary of the invention
The purpose of this invention is to provide a kind of mould 2 n-2 k-1 (totalizer and the method for designing of 1≤k≤n-2), this totalizer have been avoided the carry information calculations that repeats by adopting the method for twice carry correction.Mould 2 of the present invention n-2 k-1 totalizer can be widely used in can significantly improving arithmetic speed in each arithmetic element in signal Processing field.
An object of the present invention is to provide a kind of mould 2 n-2 k-1 (totalizer of 1≤k≤n-2) comprises the data pretreatment unit, be used to finish the required carry of Parallel Prefix computing generates and carry propagation information to (g i, p i); The carry generation unit is used to finish the high-speed carry calculating of A+B+T to obtain
Figure BDA0000063434070000021
And c Out, its core is a Parallel Prefix arithmetic element, and wherein A, B are two addends, and T is a correction, T=2 k+ 1; The carry amending unit is used for according to c OutRight
Figure BDA0000063434070000022
Revise to obtain finishing the required carry of modulo addition
Figure BDA0000063434070000023
Sum unit, according to everybody carry information and part and information calculations obtains corresponding and a s i
Mould 2 of the present invention n-2 k-1 totalizer, further, it is right that described data pretreatment unit generates the required prefix computing of prefix computing according to addend A and B step-by-step G wherein iAnd p iRepresent respectively the i position (i=0,1 ..., carry n-1) generates and the carry propagation position, g i=a ib i(be a iAnd b iCarry out scale-of-two " with " logical operation), produce a carry to the i+1 position when two addends of expression and if only if i position are " 1 ";
Figure BDA0000063434070000025
("
Figure BDA0000063434070000026
" computing of expression scale-of-two XOR), have only in two addends of expression and if only if i position one could be during for " 1 " with the carry propagation of i-1 position to the i+1 position.
Mould 2 of the present invention n-2 k-1 totalizer, further, described carry amending unit is according to c OutRight
Figure BDA0000063434070000027
Revise to obtain finishing the required carry of modulo addition
Figure BDA0000063434070000028
Described carry correction makes two bites at a cherry, the carry information that obtains after revising for the first time
Figure BDA0000063434070000029
As many as
Figure BDA00000634340700000210
Perhaps Be the carry information of A+B+T or A+B+T-1; Revising for the second time is according to c OutValue right
Figure BDA00000634340700000212
Revise, obtain final revised carry information
Figure BDA00000634340700000213
Mould 2 of the present invention n-2 k-1 totalizer, further, described summation operation unit calculates
Figure BDA00000634340700000214
The time consider c OutCorrection result under the control, i.e. c Out=0 o'clock,
Figure BDA0000063434070000031
Carry information for A+B; Otherwise, then be the carry information of A+B+T.
Another object of the present invention provides a kind of mould 2 n-2 k-1 (method for designing of totalizer of 1≤k≤n-2) comprises step: the data pre-treatment step, finish that the required carry of Parallel Prefix computing generates and carry propagation information to (g i, p i); Carry generates step, calculates the high-speed carry of finishing A+B+T by Parallel Prefix and calculates to obtain
Figure BDA0000063434070000032
And c Out, wherein A, B are two addends, T is a correction, T=2 k+ 1; Carry correction step is according to c OutRight
Figure BDA0000063434070000033
Revise to obtain finishing the required carry of modulo addition Summation step, according to everybody carry information and part and information calculations obtains corresponding and a s i
Mould 2 of the present invention n-2 kThe method for designing of-1 totalizer, further, wherein in the data pre-treatment step, it is right that addend A and B step-by-step generate the required prefix computing of prefix computing
Figure BDA0000063434070000035
G wherein iAnd p iRepresent respectively the i position (i=0,1 ..., carry n-1) generates and the carry propagation position, g i=a ib i(be a iAnd b iCarry out scale-of-two " with " logical operation), produce a carry to the i+1 position when two addends of expression and if only if i position are " 1 ";
Figure BDA0000063434070000036
("
Figure BDA0000063434070000037
" computing of expression scale-of-two XOR), have only in two addends of expression and if only if i position one could be during for " 1 " with the carry propagation of i-1 position to the i+1 position.
Mould 2 of the present invention n-2 kThe method for designing of-1 totalizer, further, wherein in the carry correction step, according to c OutRight
Figure BDA0000063434070000038
Revise to obtain finishing the required carry of modulo addition
Figure BDA0000063434070000039
Described carry correction makes two bites at a cherry, the carry information that obtains after revising for the first time As many as
Figure BDA00000634340700000311
Perhaps
Figure BDA00000634340700000312
Be the carry information of A+B+T or A+B+T-1; Revising for the second time is according to c OutValue right
Figure BDA00000634340700000313
Revise, obtain final revised carry information
Figure BDA00000634340700000314
Mould 2 of the present invention n-2 kThe method for designing of-1 totalizer further, wherein in the summation step, is calculated
Figure BDA00000634340700000315
The time, consider c OutCorrection result under the control, i.e. c Out=0 o'clock,
Figure BDA00000634340700000316
Carry information for A+B; Otherwise, then be the carry information of A+B+T.
Mould adder of the present invention is the basic processing unit of residue number system, and it designs efficiently and realizes is the assurance of the good parallel characteristics of RNS.Mould 2 provided by the present invention n-2 k-1 totalizer and method for designing have adopted twice carry correction, avoided the carry information calculations that repeats, simultaneously special data pre-service and carry correction algorithm allow to use any existing quick prefix computing structure and are used to calculate carry information, thereby increased design flexibility, can significantly improve arithmetic speed.
Description of drawings
Fig. 1 is a mould 2 n-2 kThe structural drawing of-1 totalizer;
Fig. 2 is a specific embodiment mould 2 8-2 4The specific implementation structure of-1 totalizer;
Fig. 3 has showed mould 2 8-2 4Each processing unit function of-1 totalizer.
Embodiment
Below in conjunction with embodiment foregoing invention content of the present invention is described in further detail.
But this should be interpreted as that the scope of the above-mentioned theme of the present invention only limits to following embodiment.Not breaking away under the above-mentioned technological thought situation of the present invention, according to ordinary skill knowledge and customary means, make various replacements and change, all should comprise within the scope of the invention.
A kind of mould 2 n-2 k-1 totalizer (1≤k≤n-2), comprising:
The data pretreatment unit is used to finish required carry generation of Parallel Prefix computing and carry propagation information to (g i, p i);
The carry generation unit is used to finish the high-speed carry calculating of A+B+T to obtain
Figure BDA0000063434070000041
And c Out, its core is a Parallel Prefix arithmetic element; Wherein A, B are two addends, and T is a correction, T=2 k+ 1;
The carry amending unit is used for according to c OutRight Revise to obtain finishing the required carry of modulo addition And,
Sum unit, according to everybody carry information and part and information calculations obtains corresponding and a s i
It is right that described data pretreatment unit generates the required prefix computing of prefix computing according to addend A and B step-by-step
Figure BDA0000063434070000044
G wherein iAnd p iRepresent respectively the i position (i=0,1 ..., carry n-1) generates and the carry propagation position, g i=a ib i(be a iAnd b iCarry out scale-of-two " with " logical operation), produce a carry to the i+1 position when two addends of expression and if only if i position are " 1 ";
Figure BDA0000063434070000051
("
Figure BDA0000063434070000052
" computing of expression scale-of-two XOR), have only in two addends of expression and if only if i position one could be during for " 1 " with the carry propagation of i-1 position to the i+1 position.
Described carry amending unit is according to c OutRight
Figure BDA0000063434070000053
Revise to obtain finishing the required carry of modulo addition
Figure BDA0000063434070000054
Described carry correction makes two bites at a cherry, the carry information that obtains after revising for the first time
Figure BDA0000063434070000055
As many as Perhaps
Figure BDA0000063434070000057
Be the carry information of A+B+T or A+B+T-1; Revising for the second time is according to c OutValue right
Figure BDA0000063434070000058
Revise, obtain final revised carry information
Figure BDA0000063434070000059
Described sum unit is calculated
Figure BDA00000634340700000510
The time consider c OutCorrection result under the control, i.e. c Out=0 o'clock,
Figure BDA00000634340700000511
Carry information for A+B; Otherwise, then be the carry information of A+B+T.
A kind of mould 2 n-2 k-1 totalizer (method for designing of 1≤k≤n-2) may further comprise the steps:
The data pre-treatment step is finished required carry generation of Parallel Prefix computing and carry propagation information to (g i, p i);
Carry generates step, calculates the high-speed carry of finishing A+B+T by Parallel Prefix and calculates to obtain And c Out, wherein A, B are two addends, T is a correction, T=2 k+ 1;
Carry correction step is according to c OutRight
Figure BDA00000634340700000513
Revise to obtain finishing the required carry of modulo addition
Figure BDA00000634340700000514
And,
Summation step, according to everybody carry information and part and information calculations obtains corresponding and a s i
A kind of mould 2 n-2 kThe method for designing of-1 totalizer, wherein in the data pre-treatment step, it is right that addend A and B step-by-step generate the required prefix computing of prefix computing
Figure BDA00000634340700000515
G wherein iAnd p iRepresent respectively the i position (i=0,1 ..., carry n-1) generates and the carry propagation position, g i=a ib i(be a iAnd b iCarry out scale-of-two " with " logical operation), produce a carry to the i+1 position when two addends of expression and if only if i position are " 1 "; ("
Figure BDA00000634340700000517
" computing of expression scale-of-two XOR), have only in two addends of expression and if only if i position one could be during for " 1 " with the carry propagation of i-1 position to the i+1 position.
A kind of mould 2 n-2 kThe method for designing of-1 totalizer is wherein in the carry correction step, according to c OutRight
Figure BDA0000063434070000061
Revise to obtain finishing the required carry of modulo addition
Figure BDA0000063434070000062
Described carry correction makes two bites at a cherry, the carry information that obtains after revising for the first time
Figure BDA0000063434070000063
As many as
Figure BDA0000063434070000064
Perhaps
Figure BDA0000063434070000065
Be the carry information of A+B+T or A+B+T-1; Revising for the second time is according to c OutValue right
Figure BDA0000063434070000066
Revise, obtain final revised carry information
Figure BDA0000063434070000067
A kind of mould 2 n-2 kThe method for designing of-1 totalizer wherein in the summation step, is calculated The time, consider c OutCorrection result under the control, i.e. c Out=0 o'clock,
Figure BDA0000063434070000069
Carry information for A+B; Otherwise, then be the carry information of A+B+T.
Fig. 1 shows mould 2 n-2 kThe structural drawing of-1 totalizer.It is made of data pretreatment unit 101, carry generation unit 102, carry amending unit 103 and sum unit 104 etc.Different with the ordinary binary additive operation, modulo addition does not have final carry output.The mould m of additive operation carry out to(for) two integer A, B (A, B ∈ [0, m)) is defined as:
C = < A + B > m
= A + B A + B < m A + B - m A + B &GreaterEqual; m - - - ( 1 )
Be A and B's and if less than m, then directly get itself and operation result as the modulo addition result.Otherwise, deduct the net result of m as modulo addition.In fact, formula (1) and following formula equivalence:
C = A + B A + B + T < 2 n < A + B + T > 2 n A + B + T &GreaterEqual; 2 n - - - ( 2 )
Wherein
Figure BDA00000634340700000613
Be that n is greater than log 2The smallest positive integral of m, T=2 n-m.Formula (2) shows that if the carry of A+B+T is output as " 1 ", then the result of modulo addition is the low n bit of A+B+T; Otherwise, be A+B.
Usually, the realization of mould adder all needs to calculate respectively the value of A+B+T and A+B, compares judgement at last again, thereby obtains the result of final modulo addition.The present invention makes full use of mould 2 n-2 kThe characteristics of the correction T of-1 totalizer by suitable data pre-service, make each bit carry information of A+B+T
Figure BDA00000634340700000614
And c OutCalculating can use the structure of prefix computing arbitrarily.Then, according to the highest carry c of A+B+T OutRight
Figure BDA0000063434070000071
Revise each the required bit true carry information of modulo addition that obtains
Figure BDA0000063434070000072
Thereby avoided the carry information of independent calculating A+B+T and A+B.
It is right to generate the required prefix computing of prefix computing according to addend A, B step-by-step:
( g i , p i ) = ( a i b i , a i &CirclePlus; b i ) - - - ( 3 )
Wherein, g iAnd p iRepresent respectively the i position (i=0,1 ..., n-1) carry generates and carry propagation position information, p iBe also referred to as part and information.g i=a ib i(be a iSame b iCarry out scale-of-two " with " logical operation) produce a carry to the i+1 position when two addends of expression and if only if i position are " 1 ";
Figure BDA0000063434070000074
("
Figure BDA0000063434070000075
" computing of expression scale-of-two XOR) and have only in two addends of expression and if only if i position one could be during for " 1 " with the carry propagation of i-1 position to the i+1 position.
The prefix arithmetic element is used to generate each required bit carry information of sum unit, and the computing of binary addition prefix is:
( G i : i 0 , P i : i 0 ) = ( g i , p i ) ( G i : k l , P i : k l ) = ( G i : j + 1 l - 1 , P i : j + 1 l - 1 ) &CenterDot; ( G j : k l - 1 , P j : k l - 1 ) = ( G i : j + 1 l - 1 + P i : j + 1 l - 1 G j : k l - 1 , P i : j + 1 l - 1 P j : k l - 1 ) - - - ( 4 )
Wherein, i=0,1 ..., n-1,0≤k≤j≤i, l=1,2 ..., m, the l little then carry propagation time delay that heals is littler, the computing of " " expression prefix.The 0th grade prefix operation result is (g i, p i), in fact the data pre-service also can be considered the part of prefix computing, promptly
Figure BDA0000063434070000077
Be illustrated in k position that the l level calculates to i position prefix operation result, be also referred to as the computing of prefix group.
Formula (4) shows
Figure BDA0000063434070000079
("+" expression scale-of-two " or " logical operation), promptly the k position to the carry of i position by the group carry of j+1 position to the i position
Figure BDA00000634340700000710
Decision, or by the group carry propagation of j+1 position to the i position Determine whether carry output with a last group (the k position is to the j position)
Figure BDA00000634340700000712
Output as this prefix computing; And
Figure BDA00000634340700000713
Only show when the k position to j position and j+1 position to the i position this two group carry propagate the carry that all allows low level by the time, the k position just allows other carry by its propagation to the i position.In fact, work as i=0,1 ..., when n-1,0≤k≤j≤i and v≤j, formula (5) is also set up.
( G i : k l , P i : k l ) = ( G i : v l - 1 , P i : v l - 1 ) &CenterDot; ( G j : k l - 1 , P j : k l - 1 ) = ( G i : v l - 1 + P i : v l - 1 G j : k l - 1 , P i : v l - 1 P j : k l - 1 ) - - - ( 5 )
For data pretreatment unit 101, because the present invention has adopted the carry information to A+B+T The method of revising has obtained the required carry information of modulo addition, therefore, the carry that the data pretreatment unit only needs to produce A+B+T generate and carry propagation information to (g i, p i).By formula (2), work as m=2 n-2 k-1 o'clock,
Figure BDA0000063434070000083
Make the binary representation of A and B be respectively a N-1A ka K-1A 1a 0And b N-1B kb K-1B 1b 0, the binary form of correction T is shown Shown in 102 among Fig. 1, the calculating of A+B+T be can be considered the totalizer A1 of two cascades and the additive operation that A2 finishes low k bit and high n-k bit respectively.Order
Figure BDA0000063434070000085
Figure BDA0000063434070000086
Then the additive operation finished of totalizer A1 and A2 is as the formula (6):
S A 1 = a k - 1 . . . a 1 a 0 + b k - 1 . . . b 1 b 0 + T A 1 S A 2 = a n - 1 . . . a k + b n - 1 . . . b k + T A 2 + c A 1 - - - ( 6 )
C wherein A1The final carry output of expression totalizer A1.
For the T among the totalizer A1 A1, only lowest order is " 1 ", and is therefore visual for the acquiescence lowest order is the k bit adder computing of " 1 ", this and ordinary binary addition are in full accord.Its data preprocessing method that is used for the prefix computing is identical with the traditional binary totalizer, only need consider its lowest order for " 1 ", its carry generate and diffuse information into:
( g 0 , p 0 ) = ( a 0 + b 0 , a 0 &CirclePlus; b 0 &OverBar; ) , i = 0 ( g i , p i ) = ( a i b i , a i &CirclePlus; b i ) , i = 1,2 , . . . , k - 1 - - - ( 7 )
By formula (6) as can be known, for totalizer A2, not only need to add constant T A2, also need to handle the carry output c that totalizer A1 is produced A1Therefore, this totalizer can be thought the binary adder of one three input, and these three inputs are respectively a N-1A k, b N-1B kAnd T A2Usually, three-input adder can be obtained by two-stage two input summers.Therefore,, three-input adder can be become two input summers and handle, promptly work as i=k by following mode, k+1 ..., during n-1, at first calculate a iAnd b iCarry generate and carry propagation information (g ' i, p ' i):
( g i &prime; , p i &prime; ) = ( a i b i , a i &CirclePlus; b i ) , i = k , k + 1 , . . . , n - 1 - - - ( 8 )
To then, (g ' i, p ' i) and As partial input, obtain final data pre-service result:
( g k , p k ) = ( g k &prime; , p k &prime; &OverBar; ) , i = k ( g i , p i ) = ( i i &prime; g i - 1 &prime; , p i &prime; &CirclePlus; g i - 1 &prime; ) , i = k + 1 , . . . , n - 1 - - - ( 9 )
In addition, the final carry output c of A2 A2Calculate by following formula:
c A2=a n-1b n-1=g′ n-1 (10)
For carry generation unit 102, according to n (g of data pretreatment unit 101 outputs i, p i) information is right, generates the carry of each bit fast
Figure BDA0000063434070000094
It can adopt the prefix algorithm of existing any one n bit width to realize, as SK, BK, KS, HC and ELM prefix trees etc.Carry
Figure BDA0000063434070000095
Calculate by following formula:
c i + 1 T = G i : 0 + P i : 0 c in - - - ( 11 )
In addition, the Parallel Prefix unit has only calculated n (g i, p i) information is right, but because the highest carry c of data preprocessing part A2And have neither part nor lot in the prefix computing.Therefore, need be with its highest carry with prefix trees Computing is to obtain the carry output c of A+B+T OutThen, by It is right whether decision needs
Figure BDA0000063434070000099
Correction is to obtain the carry of A+B.Consider in 101 (g 0, p 0) given tacit consent to minimum carry and be input as c In=1, therefore, c OutCan calculate by following formula:
c out = c A 2 + c n T = c A 2 + G n - 1 : 0 = c A 2 + G n - 1 : l + P n - 1 : l G l - 1 : 0 = c A 2 + G n - 1 : l + P n - 1 : l c l T - - - ( 12 )
0≤l≤n-1 wherein.
For the carry amending unit, its major function is, the highest carry c of the A+B+T that calculates according to the carry generation unit Out, to each bit carry information of A+B+T Revise, to obtain the required carry information of addition
Figure BDA00000634340700000912
To avoid the carry information of double counting A+B.For the mould adder among the present invention, T=2 k+ 1, its binary form is shown Can think that the transportation of A+B+T is broken down into two ones: at first calculate
Figure BDA0000063434070000102
Calculate then
Figure BDA0000063434070000103
Two " 1 " in the binary representation of T can be considered as the minimum carry of 102 totalizer A1 and A2.Corresponding therewith, can obtain each bit carry information of A+B by twice correction.Correction result obtains for the first time
Figure BDA0000063434070000104
Carry information, revise for the second time and then can obtain the carry information of A+B, and whether revise the highest carry c by A+B+T OutDecision.
Revise for the first time: because the binary form of T is shown Can with
Figure BDA0000063434070000106
Be considered as (A+B+T-1)+c In(c In=1) each bit carry output, therefore, the output of the carry of A+B+T-1
Figure BDA0000063434070000107
(i=0,1,2 ..., the following formula that passes through n-2) calculates:
c i + 1 T - 1 = P i : 0 &OverBar; c i + 1 T - - - ( 13 )
Basic theories by mould adder knows that the prerequisite that the carry of A+B+T is revised is c Out=0.Here can equivalence be an alternative logic, c OutAs the control end of selector switch, and
Figure BDA0000063434070000109
With Be data input pin, output is correction result for the first time, makes it be
Figure BDA00000634340700001011
c i + 1 c 1 = c out &OverBar; c i + 1 T - 1 + c out c i + 1 T
= c out &OverBar; P i : 0 &OverBar; c i + 1 T + c out c i + 1 T - - - ( 14 )
= c i + 1 T ( c out + P i : 0 &OverBar; )
Revise for the second time:, after revising for the first time, obtain by formula (14)
Figure BDA00000634340700001015
As many as Or Be the carry information of A+B+T or A+B+T-1.And then according to c OutValue right
Figure BDA00000634340700001018
Carry out the second time and revise, the carry information that order obtains after revising for the second time is
Figure BDA00000634340700001019
Adopt and revise for the first time identical disposal route, as if c Out=0
Figure BDA00000634340700001020
Be A+B+T-1-2 kThe carry information of (being A+B), otherwise
Figure BDA00000634340700001021
Be the carry information of A+B+T, promptly
Figure BDA00000634340700001022
Be the needed actual carry information of mould adder.Revising for the second time fundamental purpose is to eliminate T A2In the influence of lowest order " 1 ".
Because T=2 k+ 1, work as i=1,2 ..., during k, T A2In " 1 " no longer influence
Figure BDA00000634340700001023
Therefore:
c i real = c i c 1 ( i = 1,2 , . . . , k ) - - - ( 15 )
Work as i=k+1 ..., during n-1, reply
Figure BDA0000063434070000112
Correction is to eliminate T A2The influence that is brought.By the analysis of data preprocessing part as can be known, totalizer A2 is two addend p ' that bring the position input among Fig. 1 this moment N-1P ' K+1P ' kAnd g ' N-2G ' K+1G ' k1 sum operation, A1 exports through revised carry among Fig. 1 and the carry of A2 is input as
Figure BDA0000063434070000113
Notice g ' N-2G ' K+1G ' k1 lowest order is " 1 ", therefore can think that A2 has finished minimum carry and has been input as " 1 ", and addend is p ' N-1P ' K+1P ' kWith
Figure BDA0000063434070000114
Additive operation, promptly two kinds of operation results of the (a) and (b) of formula (16) are identical, have identical carry information.In other words, can be once more to the carry information of totalizer A2
Figure BDA0000063434070000115
(i=k+1 .. n-1) revise to obtain the carry of A+B, again in conjunction with c OutThen can obtain the final carry information of each required bit of modulo addition
Figure BDA0000063434070000116
Figure BDA0000063434070000117
Noting, is to carry out under the minimum carry of considering totalizer A2 is the situation of constant " 1 " owing to revise for the second time, so all should be by p ' with the carry propagation information that uses in the makeover process N-1P ' K+1P ' kWith
Figure BDA0000063434070000118
Calculate.Can find lowest order difference only under this dual mode, addend g ' (a) by the addend in two kinds of additive operations of comparison expression (16) N-2G ' K+1G ' k1 lowest order is " 1 ", and addend (b)
Figure BDA0000063434070000119
Lowest order be
Figure BDA00000634340700001110
The i.e. lowest order difference only of carry propagation information under two kinds of situations.(a) carry propagation information is tried to achieve by formula (8) and (9), and the carry propagation information that makes (b) is p " k, then:
p k &prime; &prime; = p k &prime; &CirclePlus; c k c 1 = c k c 1 &CirclePlus; p k &OverBar; i = k p i &prime; &prime; = p i i = k + 1 , . . . , n - 1 - - - ( 17 )
Make its group propagate the position and be P " I:k, then:
P″ i:k=P i:k+1p″ k (18)
Work as i=k+1, k+2 ..., during n-2, by formula (14), revised carry information is for the second time:
c i + 1 real = ( P i : k &prime; &prime; &OverBar; + c out ) c i + 1 c 1
= ( P i : k + 1 p k &prime; &prime; &OverBar; + c out ) c i + 1 c 1 - - - ( 19 )
= c i + 1 T ( c out + P i : 0 &OverBar; ) ( P i : k + 1 p k &prime; &prime; &OverBar; + c out )
With formula (17) substitution (19), then:
c i + 1 real = c i + 1 T ( c out + P i : 0 &OverBar; ) ( P i : k + 1 ( c k c 1 &CirclePlus; p k &OverBar; ) &OverBar; + c out )
= c i + 1 T ( c out + ( P i : k + 1 &OverBar; + c k c 1 p k &OverBar; + c k c 1 &OverBar; p k ) ( c out + P i : 0 &OverBar; ) )
= c i + 1 T ( c out + P i : 0 &OverBar; P i : k + 1 &OverBar; + ( P i : k + 1 &OverBar; + p k &OverBar; + P k - 1 : 0 &OverBar; ) ( c k c 1 p k &OverBar; + c k c 1 &OverBar; p k ) ) (20)
= c i + 1 T c out + P i : 0 &OverBar; P i : k + 1 &OverBar; + P i : k + 1 &OverBar; p k &OverBar; c k c 1 + P i : k + 1 &OverBar; p k c k c 1 &OverBar; + p k &OverBar; c k c 1 + P k - 1 : 0 &OverBar; p k &OverBar; c k c 1 + P k - 1 : 0 &OverBar; p k c k c 1 &OverBar;
= c i + 1 T ( c out + P i : 0 &OverBar; P i : k + 1 &OverBar; + p k &OverBar; c k c 1 + P i : k + 1 &OverBar; c k c 1 &OverBar; p k + P k - 1 : 0 &OverBar; c k c 1 &OverBar; p k )
= c i + 1 T ( c out + P i : k + 1 &OverBar; + p k &OverBar; c k c 1 + p k P k - 1 : 0 &OverBar; c k c 1 &OverBar; )
With formula (14) substitution formula (20), then:
c i + 1 real = c i + 1 T ( c out + P i : k + 1 &OverBar; + P k - 1 : 0 &OverBar; p k &OverBar; c k T + P k - 1 : 0 &OverBar; p k c k T &OverBar; ) (21)
= c i + 1 T ( c out + P i : k + 1 &OverBar; + P k - 1 : 0 &OverBar; ( p k &CirclePlus; c k T ) )
When i=k, P " I:k=P " K:k=p " k, in like manner can get:
c i + 1 real = c i + 1 T ( c out + P k - 1 : 0 &OverBar; ( p k &CirclePlus; c k T ) ) - - - ( 22 )
Can get by formula (14), (15), (21) and (22), by c OutThe mould after revising of control adds each required bit carry information of computing:
c i + 1 real = c i + 1 T ( c out + P i : 0 &OverBar; ) i = 0,1 , . . . , k - 1 c i + 1 T ( c out + P k - 1 : 0 &OverBar; ( p k &CirclePlus; c k T ) ) i = k c i + 1 T ( c out + P i : k + 1 &OverBar; + P k - 1 : 0 &OverBar; ( p k &CirclePlus; c k T ) ) i = k + 1 , . . . , n - 2 - - - ( 23 )
Order:
z 1 = P k - 1 : 0 &OverBar; ( p k &CirclePlus; c k T ) z 2 i = P i : k + 1 &OverBar; + P k - 1 : 0 &OverBar; ( p k &CirclePlus; c k T ) - - - ( 24 )
Then:
c i + 1 real = c i + 1 T ( c out + P i : 0 &OverBar; ) i = 0,1 , . . . , k - 1 c i + 1 T ( c out + z 1 ) i = k c i + 1 T ( c out + z 2 i ) i = k + 1 , . . . , n - 2 - - - ( 25 )
So far, obtained each bit carry output of mould adder, for follow-up summation operation provides necessary information.
For summation operation unit 104, basic identical with general binary adder based on the prefix computing, but
Figure BDA0000063434070000132
Be to consider c OutCorrection result under the control, i.e. c Out=0 o'clock
Figure BDA0000063434070000133
Be the carry information of A+B, otherwise then be the carry information of A+B+T, therefore when summation, also should use corresponding A+B or part and the information of A+B+T.Order With
Figure BDA0000063434070000135
Part and the information of representing A+B and A+B+T respectively what the data pretreatment unit calculated are
Figure BDA0000063434070000136
, promptly
Figure BDA0000063434070000137
Simultaneously as can be known, only work as i=0, during k by the data pretreatment unit
Figure BDA0000063434070000138
Therefore, have
p 0 0 = p 0 &OverBar; , p 0 1 = p 0 i = 0 p k 0 = p k &OverBar; , p k 1 = p k i = k p i 0 = p i 1 = p i i = 1 , . . . , k - 1 , k + 1 , . . . , n - 1 - - - ( 26 )
And then have
s 0 = c out &OverBar; p 0 0 + c out p 0 1
= c out &OverBar; p 0 &OverBar; + c out p 0 - - - ( 27 )
= c out &CirclePlus; p 0 &OverBar;
s k = c k real &CirclePlus; ( c out &OverBar; p k 0 + c out p k 1 )
= c k real &CirclePlus; ( c out &OverBar; p k &OverBar; + c out p k ) - - - ( 28 )
= c k real &CirclePlus; c out &CirclePlus; p k &OverBar;
s i = c i real &CirclePlus; p i - - - ( 29 )
Last summation output can be expressed as:
s i = c out &CirclePlus; p 0 &OverBar; i = 0 c k real &CirclePlus; c out &CirclePlus; p k &OverBar; i = k c i real &CirclePlus; p i i=1,...,k-1,k+1,...,n-1 - - - ( 30 )
In formula (30),
Figure BDA0000063434070000142
Can with Calculate simultaneously, therefore can not introduce extra time delay.
Fig. 2 shows mould 2 8-2 4The specific implementation structure of-1 totalizer.Existing n=8, k=4.201 is the data pretreatment unit, and Unit 101 in the corresponding diagram 1 produce the required information of 8 prefix computings to (g i, p i).Carry generation unit 102 in 202 corresponding diagram 1 utilizes the prefix computing to produce the carry information of each bit
Figure BDA0000063434070000144
And c Out, and with P I:0(i=1,2,3), z 1,
Figure BDA0000063434070000145
Be stored in 205 etc. intermediate information.Carry amending unit 103 in 203 corresponding diagram 1 is according to 202 c that generate OutAnd in conjunction with the P that is stored in 205 I:0, z 1,
Figure BDA0000063434070000146
Etc. intermediate information, right
Figure BDA0000063434070000147
Revise, thereby obtain the carry information that needs At last, the sum unit 104 of 204 corresponding diagram 1 according to formula (30), is done operations such as some simple NOT sum distances and is realized last summation operation, thereby obtain the result of final modular arithmetic.
Fig. 3 shows mould 2 among Fig. 2 8-2 4Each processing unit function of-1 totalizer.In data pretreatment unit 201,301,302 and 303 these three functional units have been used.Wherein, 301 and 303 is to produce the required information of prefix computing to (g according to formula (7) i, p i), and generating (g i, p i) process in, only need use simple " with ", " or ", operations such as NOT sum distance.Because T A1Only lowest order is " 1 ", by formula (7), (g 0, p 0) generation meeting and other (g i, p i) the generation difference, therefore produce (g 0, p 0) time will be with 301 but not 303.In addition, (g 4, p 4) generation to consider T A2Only lowest order is " 1 " this fact, and therefore, the method for its generation is different from other (g i, p i), as the formula (9).The 302nd, to the p ' in the formula (9) kDo the operation of a negate.Carry generation unit 202 is prefix arithmetic elements, according to information to (g i, p i), generate carry information
Figure BDA0000063434070000149
And c OutIn this process, use 304,305 and 306 these three functional units.The 304th, the prefix operator of standard, by formula (4) by earlier " with " back " or " computing obtain new information to (G ", P "), and
Figure BDA00000634340700001410
Directly from (G ", the G among the P ") ", promptly
Figure BDA00000634340700001411
The 305th, on 304 bases, done the prefix operator of simplifying, it only need obtain G " and, need not to calculate P ", 305 output result is
Figure BDA0000063434070000151
Unit 306 calculate c according to formula (12) Out, n=7 wherein, l=4, x=g ' 7,
Figure BDA0000063434070000152
(G 7:4, P 7:4) directly from a prefix operator on the crown.Though in Fig. 2, be grouped into 307 in Unit 203, because it does not participate in the calculating of carry correction, but participated in summation operation, therefore, in carry amending unit 203, only used 308 these functional units.It utilizes c Out, the output in conjunction with 205 is P as a result I:0(i=1,2,3), z 1With Right
Figure BDA0000063434070000154
Revise one by one.At last, in sum unit 204, used 308 and 309 two unit, they all are nonequivalence operations.Wherein, 308 is relative 309, just one of them input done the operation of a negate.

Claims (8)

1. mould 2 n-2 k-1 totalizer is characterized in that, comprising:
The data pretreatment unit is used to finish required carry generation of Parallel Prefix computing and carry propagation information to (g i, p i);
The carry generation unit is used to finish the high-speed carry calculating of A+B+T to obtain
Figure FDA0000063434060000011
And c Out, its core is a Parallel Prefix arithmetic element; Wherein A, B are two addends, and T is a correction, T=2 k+ 1;
The carry amending unit is used for according to c OutRight
Figure FDA0000063434060000012
Revise to obtain finishing the required carry of modulo addition
Figure FDA0000063434060000013
And,
Sum unit, according to everybody carry information and part and information calculations obtains corresponding and a s i
2. mould 2 as claimed in claim 1 n-2 k-1 totalizer is characterized in that, it is right that described data pretreatment unit generates the required prefix computing of prefix computing according to addend A and B step-by-step
Figure FDA0000063434060000014
G wherein iAnd p iRepresent respectively the i position (i=0,1 ..., carry n-1) generates and the carry propagation position, g i=a ib i, produce a carry to the i+1 position when two addends of expression and if only if i position are " 1 ";
Figure FDA0000063434060000015
Have only in two addends of expression and if only if i position one could be during for " 1 " with the carry propagation of i-1 position to the i+1 position.
3. mould 2 as claimed in claim 1 n-2 k-1 totalizer is characterized in that, described carry amending unit is according to c OutRight
Figure FDA0000063434060000016
Revise to obtain finishing the required carry of modulo addition
Figure FDA0000063434060000017
Described carry correction makes two bites at a cherry, the carry information that obtains after revising for the first time
Figure FDA0000063434060000018
As many as
Figure FDA0000063434060000019
Perhaps
Figure FDA00000634340600000110
Be the carry information of A+B+T or A+B+T-1; Revising for the second time is according to c OutValue right
Figure FDA00000634340600000111
Revise, obtain final revised carry information
Figure FDA00000634340600000112
4. mould 2 as claimed in claim 1 n-2 k-1 totalizer is characterized in that, described sum unit is calculated
Figure FDA00000634340600000113
The time consider c OutCorrection result under the control, i.e. c Out=0 o'clock,
Figure FDA00000634340600000114
Carry information for A+B; Otherwise, then be the carry information of A+B+T.
5. mould 2 n-2 kThe method for designing of-1 totalizer is characterized in that, may further comprise the steps:
The data pre-treatment step is finished required carry generation of Parallel Prefix computing and carry propagation information to (g i, p i);
Carry generates step, calculates the high-speed carry of finishing A+B+T by Parallel Prefix and calculates to obtain
Figure FDA0000063434060000021
And c Out, wherein A, B are two addends, T is a correction, T=2 k+ 1;
Carry correction step is according to c OutRight
Figure FDA0000063434060000022
Revise to obtain finishing the required carry of modulo addition
Figure FDA0000063434060000023
And,
Summation step, according to everybody carry information and part and information calculations obtains corresponding and a s i
6. mould 2 as claimed in claim 5 n-2 kThe method for designing of-1 totalizer is characterized in that, wherein in the data pre-treatment step, it is right that addend A and B step-by-step generate the required prefix computing of prefix computing
Figure FDA0000063434060000024
G wherein iAnd p iRepresent respectively the i position (i=0,1 ..., carry n-1) generates and the carry propagation position, g i=a ib i, produce a carry to the i+1 position when two addends of expression and if only if i position are " 1 ";
Figure FDA0000063434060000025
Have only in two addends of expression and if only if i position one could be during for " 1 " with the carry propagation of i-1 position to the i+1 position.
7. mould 2 as claimed in claim 5 n-2 kThe method for designing of-1 totalizer is characterized in that, wherein in the carry correction step, according to c OutRight
Figure FDA0000063434060000026
Revise to obtain finishing the required carry of modulo addition
Figure FDA0000063434060000027
Described carry correction makes two bites at a cherry, the carry information that obtains after revising for the first time
Figure FDA0000063434060000028
As many as
Figure FDA0000063434060000029
Perhaps
Figure FDA00000634340600000210
Be the carry information of A+B+T or A+B+T-1; Revising for the second time is according to c OutValue right
Figure FDA00000634340600000211
Revise, obtain final revised carry information
Figure FDA00000634340600000212
8. mould 2 as claimed in claim 5 n-2 kThe method for designing of-1 totalizer is characterized in that, wherein in the summation step, calculates
Figure FDA00000634340600000213
The time, consider c OutCorrection result under the control, i.e. c Out=0 o'clock,
Figure FDA00000634340600000214
Carry information for A+B; Otherwise, then be the carry information of A+B+T.
CN2011101370159A 2011-05-24 2011-05-24 Modulo 2n-2k-1 adder and design method thereof Pending CN102226885A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011101370159A CN102226885A (en) 2011-05-24 2011-05-24 Modulo 2n-2k-1 adder and design method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011101370159A CN102226885A (en) 2011-05-24 2011-05-24 Modulo 2n-2k-1 adder and design method thereof

Publications (1)

Publication Number Publication Date
CN102226885A true CN102226885A (en) 2011-10-26

Family

ID=44807855

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011101370159A Pending CN102226885A (en) 2011-05-24 2011-05-24 Modulo 2n-2k-1 adder and design method thereof

Country Status (1)

Country Link
CN (1) CN102226885A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102880445A (en) * 2012-07-27 2013-01-16 电子科技大学 Modulo subtracter
CN103324785A (en) * 2013-05-31 2013-09-25 电子科技大学 Modulus summator
CN111857651A (en) * 2020-06-16 2020-10-30 眸芯科技(上海)有限公司 Method for parallel carrying out a plurality of few-bit addition by using multi-bit adder and application
CN113419704A (en) * 2021-07-23 2021-09-21 北京源启先进微电子有限公司 49-bit adder, implementation method thereof, arithmetic circuit and chip

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
马上 等: "模2n-2k-1加法器高效VLSI设计与实现", 《微电子学与计算机》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102880445A (en) * 2012-07-27 2013-01-16 电子科技大学 Modulo subtracter
CN102880445B (en) * 2012-07-27 2015-03-11 电子科技大学 Modulo subtracter
CN103324785A (en) * 2013-05-31 2013-09-25 电子科技大学 Modulus summator
CN103324785B (en) * 2013-05-31 2016-04-06 电子科技大学 A kind of mould adder
CN111857651A (en) * 2020-06-16 2020-10-30 眸芯科技(上海)有限公司 Method for parallel carrying out a plurality of few-bit addition by using multi-bit adder and application
CN111857651B (en) * 2020-06-16 2023-06-16 眸芯科技(上海)有限公司 Method for parallel addition of multiple small bits by multi-bit adder and application thereof
CN113419704A (en) * 2021-07-23 2021-09-21 北京源启先进微电子有限公司 49-bit adder, implementation method thereof, arithmetic circuit and chip

Similar Documents

Publication Publication Date Title
CN102722352B (en) Booth multiplier
CN102103479B (en) Floating point calculator and processing method for floating point calculation
US9146707B2 (en) Generating a fast 3x multiplicand term for radix-8 booth multiplication
CN102226885A (en) Modulo 2n-2k-1 adder and design method thereof
CN107092462B (en) 64-bit asynchronous multiplier based on FPGA
Das et al. Hardware design of optimized large integer schoolbook polynomial multiplications on FPGA
Simson et al. Design and implementation of high speed hybrid carry select adder
Villalba et al. Radix-2 multioperand and multiformat streaming online addition
Haritha et al. Design of an enhanced array based approximate arithmetic computing model for multipliers and squarers
Feng et al. A high performance FPGA implementation of 256-bit elliptic curve cryptography processor over GF (p)
CN108809323A (en) The generation method and device of cyclic redundancy check code
Daud et al. Hybrid modified booth encoded algorithm-carry save adder fast multiplier
Piestrak Design of multi-residue generators using shared logic
RU2666303C1 (en) Method and device for calculating hash function
Wu et al. Efficient High-Radix GF (p) Montgomery Modular Multiplication Via Deep Use Of Multipliers
CN101944009B (en) Device for processing quotient of divider in integrated circuit
CN102214083B (en) Backward conversion method and device for residue number system
US9389835B2 (en) Finite field inverter
Armand et al. Low power design of binary signed digit residue number system adder
US7840628B2 (en) Combining circuitry
Taheri et al. A high speed residue-to-binary converter for balanced 4-moduli set
Ragunath et al. Delay optimized binary to BCD converter for multi-operand parallel decimal adder
Indu et al. Energy efficient carry skip adder using skip logic in various voltage levels
Giri et al. Pipelined floating-point arithmetic unit (fpu) for advanced computing systems using fpga
CN116149599B (en) Step-by-step carry processing method, system and adder

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20111026