CN113419704B - 49-Bit adder and implementation method thereof, operation circuit and chip - Google Patents
49-Bit adder and implementation method thereof, operation circuit and chip Download PDFInfo
- Publication number
- CN113419704B CN113419704B CN202110838058.3A CN202110838058A CN113419704B CN 113419704 B CN113419704 B CN 113419704B CN 202110838058 A CN202110838058 A CN 202110838058A CN 113419704 B CN113419704 B CN 113419704B
- Authority
- CN
- China
- Prior art keywords
- carry
- bit
- addend
- module
- gate
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 21
- 238000007781 pre-processing Methods 0.000 claims abstract description 118
- 101100134058 Caenorhabditis elegans nth-1 gene Proteins 0.000 claims 1
- 238000004904 shortening Methods 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 7
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 4
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 4
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 3
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 3
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 2
- 239000013256 coordination polymer Substances 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000004148 unit process Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods 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/50—Adding; Subtracting
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Pure & Applied Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Mathematical Optimization (AREA)
- General Engineering & Computer Science (AREA)
- Complex Calculations (AREA)
- Design And Manufacture Of Integrated Circuits (AREA)
Abstract
本申请实施例提供了一种49位加法器及其实现方法、运算电路和芯片,该49位加法器包括N个进位模块和求和模块;每个进位模块对应第一加数和第二加数中的多个比特位,且包括预处理单元和多个进位计算单元;第n个进位模块包含的预处理单元,用于对对应的第一加数和第二加数中的多个比特位进行预处理;第n个进位模块包含的多个进位计算单元,用于根据预处理的结果和第n‑1个进位模块的级间进位参数进行运算,生成第n个进位模块对应的每个比特位的进位输出和第n个进位模块的级间进位参数,基本上实现了并行计算49位二进制数据中每个比特位的进位输出,以用于求和运算,由此可以缩短整个计算过程的时长,提高计算速度。
The embodiment of the present application provides a 49-bit adder and its implementation method, operation circuit and chip, the 49-bit adder includes N carry modules and a summation module; each carry module corresponds to multiple bits in a first addend and a second addend, and includes a preprocessing unit and multiple carry calculation units; the preprocessing unit included in the nth carry module is used to preprocess multiple bits in the corresponding first addend and the second addend; the multiple carry calculation units included in the nth carry module are used to perform operations based on the preprocessing results and the inter-stage carry parameters of the n-1th carry module to generate the carry output of each bit corresponding to the nth carry module and the inter-stage carry parameters of the nth carry module, basically realizing parallel calculation of the carry output of each bit in 49-bit binary data for summation operation, thereby shortening the duration of the entire calculation process and improving the calculation speed.
Description
技术领域Technical Field
本申请实施例涉及电路领域,尤其涉及一种49位加法器及其实现方法、运算电路及芯片。Embodiments of the present application relate to the field of circuits, and in particular to a 49-bit adder and an implementation method thereof, a computing circuit, and a chip.
背景技术Background technique
49位加法器是数字电路设计中常用电路之一,例如,49位加法器常常用于中央处理器(central processing unit,CPU)、图形处理器(graphics processing unit,GPU)等复杂逻辑芯片,也常常用于微控制单元(Microcontroller Unit,MCU)、现场可编程门阵列(Field Programmable Gate Array,FPGA)等综合性设计芯片。The 49-bit adder is one of the commonly used circuits in digital circuit design. For example, the 49-bit adder is often used in complex logic chips such as central processing unit (CPU) and graphics processing unit (GPU). It is also often used in comprehensive design chips such as microcontroller unit (MCU) and field programmable gate array (FPGA).
相关技术中,49位加法器在计算每个比特位的求和结果时,通常需要先获取相邻前一比特位的进位输出,例如,在计算第2比特位的求和结果时需要先获取第1比特位的进位输出,在计算第3比特位的求和结果时需要先完获取进位链中第2比特位的进位输出。以此类推,计算第48比特位的求和结果时先获取进位链中第47比特位的进位输出,整个计算过程耗时较长,且计算速度较低。In the related art, when a 49-bit adder calculates the sum of each bit, it is usually necessary to first obtain the carry output of the adjacent previous bit. For example, when calculating the sum of the second bit, it is necessary to first obtain the carry output of the first bit, and when calculating the sum of the third bit, it is necessary to first obtain the carry output of the second bit in the carry chain. Similarly, when calculating the sum of the 48th bit, the carry output of the 47th bit in the carry chain is first obtained. The entire calculation process takes a long time and has a low calculation speed.
发明内容Summary of the invention
有鉴于此,本申请实施例提供了一种49位加法器及其实现方法、运算电路及芯片,用以克服上述全部或部分技术缺陷。In view of this, an embodiment of the present application provides a 49-bit adder and its implementation method, operation circuit and chip to overcome all or part of the above-mentioned technical defects.
第一方面,本申请实施例提供了一种49位加法器,其包括:In a first aspect, an embodiment of the present application provides a 49-bit adder, comprising:
N个进位模块,每个进位模块对应第一加数和第二加数中的多个比特位,其中,第n个进位模块与第n-1个进位模块连接,以用于接收所述第n-1进位模块输出的级间进位参数,所述第一加数和所述第二加数为49位二进制数,N为大于1且小于48的整数,n为大于1且小于或等于N的整数;每个进位模块包括预处理单元和多个进位计算单元,一个进位计算单元对应所述第一加数和所述第二加数的一个比特位;N carry modules, each carry module corresponds to a plurality of bits in a first addend and a second addend, wherein the nth carry module is connected to the n-1th carry module to receive an inter-stage carry parameter output by the n-1th carry module, the first addend and the second addend are 49-bit binary numbers, N is an integer greater than 1 and less than 48, and n is an integer greater than 1 and less than or equal to N; each carry module includes a preprocessing unit and a plurality of carry calculation units, and one carry calculation unit corresponds to one bit of the first addend and the second addend;
其中,所述第n个进位模块包含的预处理单元,用于对对应的所述第一加数和第二加数中的多个比特位进行预处理;The preprocessing unit included in the n-th carry module is used to preprocess a plurality of bits in the corresponding first addend and second addend;
所述第n个进位模块包含的多个进位计算单元,用于根据所述预处理的结果和所述第n-1个进位模块的级间进位参数进行运算,生成所述第n个进位模块对应的每个比特位的进位输出和所述第n个进位模块的级间进位参数;The n-th carry module comprises a plurality of carry calculation units, which are used to perform calculations according to the preprocessing result and the inter-stage carry parameter of the n-1-th carry module to generate the carry output of each bit corresponding to the n-th carry module and the inter-stage carry parameter of the n-th carry module;
求和模块,所述求和模块与所述N个进位模块电连接,以用于根据所述第一加数和第二加数中的每个比特位、以及对应的进位输出进行运算,得到对应的求和结果。A summation module is electrically connected to the N carry modules to perform calculations according to each bit of the first addend and the second addend, and the corresponding carry outputs to obtain a corresponding summation result.
第二方面,本申请提供了一种49位加法器的实现方法,其包括:In a second aspect, the present application provides a method for implementing a 49-bit adder, which includes:
接收第一加数和第二加数,所述第一加数和第二加数按照比特位从低到高的顺序划分为N个数据组,每个数据组包括所述第一加数和所述第二加数中的多个比特位,N为大于1且小于48的整数;Receive a first addend and a second addend, wherein the first addend and the second addend are divided into N data groups in order of bits from low to high, each data group includes a plurality of bits in the first addend and the second addend, and N is an integer greater than 1 and less than 48;
对所述每个数据组包含的多个比特位进行预处理;Preprocessing the multiple bits contained in each data group;
计算所述每个数据组包含的多个比特位的进位输出,其中,对于N个数据组中的第n个数据组,根据所述第n个数据组的预处理结果和第n-1个数据组的级间进位参数进行运算,生成所述第n个数据组对应的每个比特位的进位输出和所述第n个进位模块的级间进位参数,n为大于1且小于或等于N的整数;Calculating the carry output of multiple bits contained in each data group, wherein for the nth data group among the N data groups, performing calculations according to the preprocessing result of the nth data group and the inter-stage carry parameter of the n-1th data group, generating the carry output of each bit corresponding to the nth data group and the inter-stage carry parameter of the nth carry module, where n is an integer greater than 1 and less than or equal to N;
根据所述第一加数和第二加数中的每个比特位、以及对应的进位输出进行运算,得到对应的求和结果。An operation is performed according to each bit of the first addend and the second addend, and the corresponding carry output, to obtain a corresponding sum result.
第三方面,本申请提供了一种运算电路,所述运算电路包括根据第一方面任一实施例提供的加法器。In a third aspect, the present application provides an operation circuit, which includes an adder provided according to any embodiment of the first aspect.
第四方面,本申请提供了一种芯片,所述芯片包括根据第二方面任一实施例提供的运算电路。In a fourth aspect, the present application provides a chip, comprising an operation circuit provided according to any embodiment of the second aspect.
本申请实施例提供了一种49位加法器及其实现方法、运算电路和芯片,由于加法器包括N个进位模块,每个进位模块对应第一加数和第二加数中的多个比特位,且每个进位模块包括预处理单元和多个进位计算单元,第n个进位模块包含的预处理单元用于对对应的第一加数和第二加数中的多个比特位进行预处理,第n个进位模块包含的多个进位计算单元,用于根据预处理的结果和第n-1个进位模块的级间进位参数进行运算,生成第n个进位模块对应的每个比特位的进位输出和第n个进位模块的级间进位参数,这使得在获取到第n-1个进位模块输出的级间进位参数时,第n个进位模块中的每个进位计算单元可以直接利用预处理结果和第n-1个进位模块输出的级间进位参数并行计算对应的每个比特位的进位输出,由此基本上实现了并行计算49位二进制数据中每个比特位的进位输出,以用于求和运算,由此可以缩短整个计算过程的时长,提高计算速度。The embodiment of the present application provides a 49-bit adder and its implementation method, operation circuit and chip. Since the adder includes N carry modules, each carry module corresponds to multiple bits in the first addend and the second addend, and each carry module includes a preprocessing unit and multiple carry calculation units, the preprocessing unit included in the nth carry module is used to preprocess the multiple bits in the corresponding first addend and the second addend, and the multiple carry calculation units included in the nth carry module are used to perform operations based on the preprocessing results and the inter-stage carry parameters of the n-1th carry module to generate The carry output of each bit corresponding to the n-th carry module and the inter-stage carry parameter of the n-th carry module, when the inter-stage carry parameter output by the n-1-th carry module is obtained, each carry calculation unit in the n-th carry module can directly use the preprocessing result and the inter-stage carry parameter output by the n-1-th carry module to parallelly calculate the carry output of each corresponding bit, thereby basically realizing the parallel calculation of the carry output of each bit in the 49-bit binary data for the sum operation, thereby shortening the duration of the entire calculation process and improving the calculation speed.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
后文将参照附图以示例性而非限制性的方式详细描述本申请实施例的一些具体实施例。附图中相同的附图标记标示了相同或类似的部件或部分。本领域技术人员应该理解,这些附图未必是按比值绘制的。附图中:Hereinafter, some specific embodiments of the present application will be described in detail in an exemplary and non-limiting manner with reference to the accompanying drawings. The same reference numerals in the accompanying drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the accompanying drawings:
图1为本申请实施例提供的一种49位加法器的结构示意图;FIG1 is a schematic diagram of the structure of a 49-bit adder provided in an embodiment of the present application;
图2为本申请实施例提供的一种49位加法器的进位模块中的第一预处理单元的电路示意图;FIG2 is a circuit diagram of a first preprocessing unit in a carry module of a 49-bit adder provided in an embodiment of the present application;
图3为本申请实施例提供的一种49位加法器的进位模块中的第二预处理单元的电路示意图;3 is a circuit diagram of a second preprocessing unit in a carry module of a 49-bit adder provided in an embodiment of the present application;
图4位本申请实施例提供的一种49位加法器的一个示例性进位模块的电路图;FIG4 is a circuit diagram of an exemplary carry module of a 49-bit adder provided in an embodiment of the present application;
图5为本申请实施例提供了一种49位加法器的进位链的示意图;FIG5 is a schematic diagram of a carry chain of a 49-bit adder provided in an embodiment of the present application;
图6为本申请实施例提供的一种49位加法器的实现方法的示意性流程图。FIG6 is a schematic flowchart of a method for implementing a 49-bit adder provided in an embodiment of the present application.
具体实施方式Detailed ways
下面结合本发明实施例附图进一步说明本发明实施例具体实现。The specific implementation of the embodiment of the present invention is further described below in conjunction with the accompanying drawings of the embodiment of the present invention.
实施例一Embodiment 1
图1为本申请实施例提供的一种加法器的结构示意图。本实施例的加法器可以为独立的硬件电路结构,也可以为芯片或微处理器等其他器件的基础电路单元结构。如图1所示,本申请实施例提供的49位加法器包括N个进位模块10,N为大于1且小于48的整数。每个进位模块对应第一加数和第二加数中的多个比特位,其中,第一加数和第二加数为49位二进制数。例如,一个进位模块可以对应第一加数和第二加数中的2个比特位、3个比特位或更多个比特位等。应理解,N个进位模块10中的每个进位模块对应的第一加数和第二加数中的比特位的数量可以相同,也可以不同。FIG. 1 is a schematic diagram of the structure of an adder provided in an embodiment of the present application. The adder of the present embodiment can be an independent hardware circuit structure, or it can be a basic circuit unit structure of other devices such as a chip or a microprocessor. As shown in FIG. 1 , the 49-bit adder provided in an embodiment of the present application includes N carry modules 10, where N is an integer greater than 1 and less than 48. Each carry module corresponds to a plurality of bits in a first addend and a second addend, wherein the first addend and the second addend are 49-bit binary numbers. For example, a carry module can correspond to 2 bits, 3 bits or more bits in the first addend and the second addend, etc. It should be understood that the number of bits in the first addend and the second addend corresponding to each carry module in the N carry modules 10 can be the same or different.
其中,第n个进位模块与第n-1个进位模块连接,以用于接收第n-1进位模块输出的级间进位参数,由此,基于第n-1个进位模块输出的级间进位参数,计算第n个进位模块的级间进位参数和第n个进位模块对应的每个比特位的进位输出。其中,n为大于1且小于或等于N的整数。The nth carry module is connected to the n-1th carry module to receive the inter-stage carry parameter output by the n-1th carry module, thereby calculating the inter-stage carry parameter of the nth carry module and the carry output of each bit corresponding to the nth carry module based on the inter-stage carry parameter output by the n-1th carry module. Where n is an integer greater than 1 and less than or equal to N.
每个进位模块包括预处理单元和多个进位计算单元,一个进位计算单元对应第一加数和第二加数的一个比特位。Each carry module includes a preprocessing unit and a plurality of carry calculation units, and one carry calculation unit corresponds to one bit of the first addend and the second addend.
本实施例中,第n个进位模块包含的预处理单元,用于对对应的第一加数和第二加数中的多个比特位进行预处理。In this embodiment, the preprocessing unit included in the n-th carry module is used to preprocess multiple bits in the corresponding first addend and second addend.
可选地,在本申请的一种实现方式中,预处理结果包括:组内进位生成信号和组内进位传播信号。第n个进位模块包含的预处理单元,具体用于:对对应的第一加数和第二加数中的每个比特位进行运算,生成每个比特位对应的进位生成信号和进位传播信号;基于对应的至少一个比特位的进位生成信号和进位传播信号分别生成每个比特位的组内进位生成信号和组内进位传播信号。Optionally, in an implementation of the present application, the preprocessing result includes: an intra-group carry generation signal and an intra-group carry propagation signal. The preprocessing unit included in the nth carry module is specifically used to: operate on each bit in the corresponding first addend and second addend to generate a carry generation signal and a carry propagation signal corresponding to each bit; and generate an intra-group carry generation signal and an intra-group carry propagation signal for each bit based on the carry generation signal and carry propagation signal of at least one corresponding bit.
具体地,对对应的第一加数和第二加数中的每个比特位进行逻辑与运算,生成每个比特位的进位生成信号,进位生成信号为第一加数和第二加数中的对应比特位的逻辑与值运算结果。对对应的第一加数和第二加数中的每个比特位进行逻辑或运算,生成每个比特位的进位传播信号,进位传播信号为第一加数和第二加数中的对应比特位的逻辑或值运算结果。为了便于电路实现时的整体化布局,在本申请实施例中,有时也将每个比特位的进位生成信号进行逻辑非运算的结果称为进位生成信号。类似地,将每个比特位的进位传播信号进行逻辑非运算的结果称为进位传播信号。Specifically, a logical AND operation is performed on each bit of the corresponding first addend and second addend to generate a carry generation signal for each bit, and the carry generation signal is the result of the logical AND value operation of the corresponding bit in the first addend and the second addend. A logical OR operation is performed on each bit of the corresponding first addend and the second addend to generate a carry propagation signal for each bit, and the carry propagation signal is the result of the logical OR value operation of the corresponding bit in the first addend and the second addend. In order to facilitate the overall layout during circuit implementation, in the embodiments of the present application, the result of the logical NOT operation of the carry generation signal for each bit is sometimes referred to as the carry generation signal. Similarly, the result of the logical NOT operation of the carry propagation signal for each bit is referred to as the carry propagation signal.
在得到第n个进位模块对应的每个比特位的进位生成信号和进位传播信号之后,第n个进位模块包含的预处理单元还可以对相邻的多个比特位的进位生成信号进行逻辑或运算,生成组内进位生成信号,第n个进位模块包含的预处理单元还可以对相邻的多个比特位的进位传播信号进行逻辑与运算,生成组内进位传播信号。为了便于电路实现时的整体化布局,在本申请实施例中,有时也将组内进位生成信号进行逻辑非运算的结果称为组内进位生成信号。类似地,将组内进位传播信号进行逻辑非运算的结果称为组内进位传播信号。After obtaining the carry generation signal and carry propagation signal of each bit corresponding to the nth carry module, the preprocessing unit included in the nth carry module can also perform a logical OR operation on the carry generation signals of multiple adjacent bits to generate an intra-group carry generation signal, and the preprocessing unit included in the nth carry module can also perform a logical AND operation on the carry propagation signals of multiple adjacent bits to generate an intra-group carry propagation signal. In order to facilitate the overall layout during circuit implementation, in the embodiments of the present application, the result of performing a logical NOT operation on the intra-group carry generation signal is sometimes referred to as the intra-group carry generation signal. Similarly, the result of performing a logical NOT operation on the intra-group carry propagation signal is referred to as the intra-group carry propagation signal.
例如,对于第一加数A和第二加数B中的第i个比特位,第i个比特位的进位生成信号Gi=Ai·Bi,第i个比特位的进位传播信号Pi=Ai+Bi。如上所述,为了便于电路实现时的整体化布局,第i个比特位的进位生成信号和进位传播信号有时也分别被表示为或第j个比特位到第i个比特位的组内进位产生信号Gi:j=Gi+Gi+1+…+Gi,第j个比特位到第i个比特位的组内进位传播信号Pi:j=Pi·Pi+1·…·Pi。如上所述,为了便于电路实现时的整体化布局,第j个比特位到第i个比特位的组内进位产生信号和进位传播信号有时也可以被表示为和 For example, for the i-th bit in the first addend A and the second addend B, the carry generation signal of the i-th bit is G i =A i ·B i , and the carry propagation signal of the i-th bit is P i =A i +B i . As described above, in order to facilitate the overall layout during circuit implementation, the carry generation signal and the carry propagation signal of the i-th bit are sometimes expressed as or The intra-group carry generation signal from the j-th bit to the i-th bit is Gi:j = Gi + Gi+1 +…+ Gi , and the intra-group carry propagation signal from the j-th bit to the i-th bit is Pi :j = Pi · Pi +1 ·…· Pi . As described above, in order to facilitate the overall layout during circuit implementation, the intra-group carry generation signal and carry propagation signal from the j-th bit to the i-th bit can sometimes be expressed as and
此外,Gi:j=Gi:k+Gk-1:j,并且,Pi:j=Pi:k·Pk-1:j,其中,k为按照比特位从低到高的顺序位于第j个比特位到第i个比特位之间的任一比特位。In addition, Gi :j =Gi :k + Gk-1:j , and Pi :j =Pi :k · Pk-1:j , where k is any bit located between the jth bit and the i-th bit in order from low to high bits.
本实施例中,第n个进位模块包含的多个进位计算单元,用于根据预处理的结果和第n-1个进位模块的级间进位参数进行运算,生成第n个进位模块对应的每个比特位的进位输出和第n个进位模块的级间进位参数。In this embodiment, the nth carry module includes multiple carry calculation units, which are used to perform operations based on the preprocessing results and the inter-stage carry parameters of the n-1th carry module to generate the carry output of each bit corresponding to the nth carry module and the inter-stage carry parameters of the nth carry module.
可选地,在本申请的一种实施例中,第n个进位模块包含的每个进位计算单元,具体用于根据对应的比特位的组内进位生成信号和组内进位传播信号以及第n-1个进位模块的级间进位参数进行运算,生成对应的比特位的进位输出。Optionally, in one embodiment of the present application, each carry calculation unit included in the nth carry module is specifically used to perform operations based on the intra-group carry generation signal and intra-group carry propagation signal of the corresponding bit and the inter-stage carry parameter of the n-1th carry module to generate the carry output of the corresponding bit.
对于第n个进位模块对应的多个比特位中的最高位,该最高比特位对应的进位计算单元,还用于将在第n个进位模块对应的最高位的进位输出的计算中得到的进位参数,作为第n个进位模块的级间进位参数。For the highest bit among the multiple bits corresponding to the nth carry module, the carry calculation unit corresponding to the highest bit is also used to use the carry parameter obtained in the calculation of the carry output of the highest bit corresponding to the nth carry module as the inter-stage carry parameter of the nth carry module.
其中,进位参数是在每个比特位的进位输出的计算过程中得到中间量,进位参数与进位输出之间存在预设关系。每个比特位的进位输出可以基于该比特位的进位参数与该比特位的进位传播信号进行运算得到,具体地,每个比特位的进位输出为该比特位的进位参数与该比特位的进位传播信号的逻辑与运算结果。例如,若第i个比特位的进位输出为Ci,第i个比特位的进位传播信号为Pi,第i个比特位的进位参数为Cpi,则预设关系为:Ci=Pi·Cpi。The carry parameter is an intermediate quantity obtained in the calculation process of the carry output of each bit, and there is a preset relationship between the carry parameter and the carry output. The carry output of each bit can be obtained by calculating the carry parameter of the bit and the carry propagation signal of the bit. Specifically, the carry output of each bit is the logical AND operation result of the carry parameter of the bit and the carry propagation signal of the bit. For example, if the carry output of the i-th bit is Ci , the carry propagation signal of the i-th bit is Pi , and the carry parameter of the i-th bit is Cpi , then the preset relationship is: Ci = Pi · Cpi .
若第n-1个进位模块对应的多个比特位中的最高位为第(k-1)个比特位,则在第n-1个进位模块中的多个进位计算单元在计算第(k-1)个比特位的进位输出Ck-1时得到进位参数Cpk-1,作为第n-1个级间进位参数。若第n个进位模块的预处理单元输出结果中包括组内进位生成信号Gi:k和组内进位生成信号Pi-1:k,则第i个比特位的进位输出为Ci=Gi:k+Pi:k-1·Cpk-1。此外,由于Pi:k-1·Cpk-1=Pi:k·Pk-1·Cpk-1,因此,Ci=Gi:k+Pi:k·Ck-1也成立。If the highest bit among the multiple bits corresponding to the n-1th carry module is the (k-1)th bit, the multiple carry calculation units in the n-1th carry module obtain the carry parameter Cp k-1 when calculating the carry output C k-1 of the (k-1)th bit, as the n-1th inter-stage carry parameter. If the output result of the preprocessing unit of the nth carry module includes the intra-group carry generation signal Gi :k and the intra-group carry generation signal Pi-1:k , the carry output of the i-th bit is Ci = Gi:k + Pi :k-1 ·Cp k-1 . In addition, since Pi:k-1 ·Cp k-1 = Pi :k ·P k-1 ·Cp k-1 , Ci = Gi:k + Pi :k ·C k-1 also holds.
由于Gi:k和Pi:k可以通过预处理单元处理得到,因此,第n个进位模块中与第i个比特位对应的进位计算单元在得到第n-1个进位模块的级间进位参数Ck-1时,可以通过简单的逻辑运算,得到第i个比特位的进位输出或进位参数。此外,由于第n个进位模块中的预处理单元可以对第n个进位模块对应的多个比特位进行预处理得到对应的多个组内进位生成信号和组内进位传播信号第n个进位模块中的多个进位计算单元可以,基于对应的组内进位生成信号和组内进位传播信号并行计算每个比特位的进位输出,由此提高进位计算的效率。Since G i:k and P i:k can be obtained by processing the preprocessing unit, the carry calculation unit corresponding to the i-th bit in the n-th carry module can obtain the carry output or carry parameter of the i-th bit through a simple logical operation when obtaining the inter-stage carry parameter C k-1 of the n-1-th carry module. In addition, since the preprocessing unit in the n-th carry module can preprocess the multiple bits corresponding to the n-th carry module to obtain the corresponding multiple intra-group carry generation signals and intra-group carry propagation signals, the multiple carry calculation units in the n-th carry module can calculate the carry output of each bit in parallel based on the corresponding intra-group carry generation signals and intra-group carry propagation signals, thereby improving the efficiency of the carry calculation.
应理解,为了便于电路实现时的整体化布局,进位参数Cpk-1和进位输出Ck-1有时也被表示为和 It should be understood that in order to facilitate the overall layout of the circuit implementation, the carry parameter Cp k-1 and the carry output C k-1 are sometimes also expressed as and
本申请实施例中,由于第n个进位模块包含的预处理单元对对应的第一加数和第二加数中的多个比特位进行预处理,第n进位模块包含的多个进位计算单元,用于根据预处理的结果和第n-1个进位模块的级间进位参数进行运算,生成第n个进位模块对应的每个比特位的进位输出和第n个进位模块的级间进位参数,这使得在获取到第n-1个进位模块输出的级间进位参数时,第n个进位模块中的每个进位计算单元即可以直接利用预处理结果和第n-1个进位模块输出的级间进位参数并行计算对应的每个比特位的进位输出,由此基本上实现了并行计算49位二进制数据中每个比特位的进位输出。In the embodiment of the present application, since the preprocessing unit included in the nth carry module preprocesses multiple bits in the corresponding first addend and second addend, the multiple carry calculation units included in the nth carry module are used to perform operations based on the preprocessing results and the inter-level carry parameters of the n-1th carry module to generate the carry output of each bit corresponding to the nth carry module and the inter-level carry parameters of the nth carry module. This allows each carry calculation unit in the nth carry module to directly use the preprocessing results and the inter-level carry parameters output by the n-1th carry module to parallelly calculate the carry output of each corresponding bit when the inter-level carry parameters output by the n-1th carry module are obtained, thereby basically realizing the parallel calculation of the carry output of each bit in the 49-bit binary data.
此外,如图1所示,49位加法器还包括求和模块,该求和模块与N个进位模块电连接,以用于根据第一加数和第二加数中的每个比特位、以及对应的进位输出进行运算,得到对应的求和结果。In addition, as shown in FIG1 , the 49-bit adder further includes a summation module, which is electrically connected to the N carry modules, so as to perform operations according to each bit of the first addend and the second addend, and the corresponding carry output, to obtain a corresponding summation result.
例如,对于第一加数A和第二加数A中的第i个比特位,可以根据以下求和公式,得到第i个比特位的求和结果。该公式为:For example, for the i-th bit in the first addend A and the second addend A, the summation result of the i-th bit can be obtained according to the following summation formula. The formula is:
其中,Ci-1为第一加数A和第二加数A中的第i-1个比特位的进位输出。Wherein, Ci-1 is the carry output of the i-1th bit in the first addend A and the second addend A.
本实施例中,由于基本上并行计算49位二进制数据中每个比特位的进位输出,因此,可以基本上并行地计算49位二进制数据中每个比特位的求和结果,由此可以缩短整个计算过程的时长,提高计算速度。In this embodiment, since the carry output of each bit in the 49-bit binary data is calculated basically in parallel, the sum result of each bit in the 49-bit binary data can be calculated basically in parallel, thereby shortening the duration of the entire calculation process and improving the calculation speed.
可选地,在本申请的一种实施例中,第n个进位模块对应的第一加数和第二加数中的比特位的数量等于或大于第n-1个进位模块对应的第一加数和第二加数中的比特位的数量。Optionally, in an embodiment of the present application, the number of bits in the first addend and the second addend corresponding to the nth carry module is equal to or greater than the number of bits in the first addend and the second addend corresponding to the (n-1)th carry module.
由于第n个进位模块对应的每个比特位的进位输出的计算依赖于第n-1个进位模块的级间进位参数,因此,第n个进位模块中的每个进位计算单元的进位运算时间相对于第n-1个进位模块中的每个进位计算单元的进位运算时间具有一定的逻辑时延。通过使第n个进位模块对应的第一加数和第二加数中的比特位的数量等于或大于第n-1个进位模块对应的第一加数和第二加数中的比特位的数量,可以充分利用这一逻辑延时进行组内进位生成信号和组内进位传播信号的计算,避免第n个进位模块在计算时等待第n-1个进位模块的级间进位参数的情况出现,有利于进一步减小运算所耗费的时间。Since the calculation of the carry output of each bit corresponding to the nth carry module depends on the inter-stage carry parameter of the n-1th carry module, the carry operation time of each carry calculation unit in the nth carry module has a certain logic delay relative to the carry operation time of each carry calculation unit in the n-1th carry module. By making the number of bits in the first addend and the second addend corresponding to the nth carry module equal to or greater than the number of bits in the first addend and the second addend corresponding to the n-1th carry module, this logic delay can be fully utilized to calculate the intra-group carry generation signal and the intra-group carry propagation signal, avoiding the situation that the nth carry module waits for the inter-stage carry parameter of the n-1th carry module during calculation, which is conducive to further reducing the time consumed by the operation.
可选地,在本申请的一种实施例中,N等于6,第1个进位模块对应第一加数和第二加数的第0比特位至第3比特位,第2个进位模块对应第一加数和第二加数的第4比特位至第7比特位,第3个进位模块对应第一加数和第二加数的第8比特位至13比特位,所述第4个进位模块对应所述第一加数和所述第二加数的第14比特位至第21比特位,所述第5个进位模块对应所述第一加数和所述第二加数的第22比特位至第29比特位,所述第6个进位模块对应所述第一加数和所述第二加数的第30比特位至第48比特位。由此,使得加法器的布局较为集中,面积较小,有利于整体结构化布局。Optionally, in an embodiment of the present application, N is equal to 6, the first carry module corresponds to the 0th to 3rd bits of the first addend and the second addend, the second carry module corresponds to the 4th to 7th bits of the first addend and the second addend, the third carry module corresponds to the 8th to 13th bits of the first addend and the second addend, the fourth carry module corresponds to the 14th to 21st bits of the first addend and the second addend, the fifth carry module corresponds to the 22nd to 29th bits of the first addend and the second addend, and the sixth carry module corresponds to the 30th to 48th bits of the first addend and the second addend. Thus, the layout of the adder is more concentrated, the area is smaller, and it is conducive to the overall structural layout.
应当理解,在本实施例中,进位模块的数量N可以为2个、4个、或者更多个,并且每个进位模块对应的具体比特位可以根据需要进行设置,本实施例对此不做限定。It should be understood that in this embodiment, the number N of carry modules may be 2, 4, or more, and the specific bits corresponding to each carry module may be set as needed, which is not limited in this embodiment.
实施例二Embodiment 2
基于实施例一提供的49位加法器,进一步,本实施例提供了图1所示的49位加法器中的一个进位模块的结构示意图。应理解,该进位模块可以为实施例一中的N个进位模块中的任一进位模块,为了便于描述,下文中将该进位模块称为第n个进位模块。在本实施例中,第n个进位模块包含的预处理单元包括交替布置的至少一个第一预处理单元和至少一个第二预处理单元。Based on the 49-bit adder provided in the first embodiment, further, the present embodiment provides a schematic diagram of the structure of a carry module in the 49-bit adder shown in FIG1. It should be understood that the carry module can be any carry module of the N carry modules in the first embodiment. For the convenience of description, the carry module is referred to as the nth carry module hereinafter. In the present embodiment, the preprocessing unit included in the nth carry module includes at least one first preprocessing unit and at least one second preprocessing unit arranged alternately.
本实施例中,第一预处理单元用于对对应的第一加数和第二加数中的第i个比特位和第i-1个比特位进行运算,生成第一预处理结果,第一预处理结果指示第i个比特位和第i-1个比特位的进位生成信号的逻辑或运算结果,i为奇数。In this embodiment, the first preprocessing unit is used to perform operations on the i-th bit and the i-1-th bit in the corresponding first addend and the second addend to generate a first preprocessing result, and the first preprocessing result indicates the logical OR operation result of the carry generation signals of the i-th bit and the i-1-th bit, where i is an odd number.
可选地,在本申请的一种具体的实现方式中,如图2所示,第一预处理单元包括:第一与门201、第二与门202和第一或非门203,第一与门201的第一输入端和第二输入端分别接收第i个比特位,第一与门201的输出端连接至第一或非门203的第一输入端;第二与门202的第一输入端和第二输入端分别接收第i-1个比特位,第二与门202的输出端连接至第一或非门203的第二输入端,第一或非门203的输出端输出第一预处理结果。例如,若第一加数为A,第二加数为B,则第一预处理结果为其中,Gi和Gi-1为第i个比特位的进位生成信号和第i-1个比特位的进位生成信号。Optionally, in a specific implementation of the present application, as shown in FIG2 , the first preprocessing unit includes: a first AND gate 201, a second AND gate 202 and a first NOR gate 203, the first input terminal and the second input terminal of the first AND gate 201 respectively receive the i-th bit, and the output terminal of the first AND gate 201 is connected to the first input terminal of the first NOR gate 203; the first input terminal and the second input terminal of the second AND gate 202 respectively receive the i-1-th bit, the output terminal of the second AND gate 202 is connected to the second input terminal of the first NOR gate 203, and the output terminal of the first NOR gate 203 outputs the first preprocessing result. For example, if the first addend is A and the second addend is B, the first preprocessing result is Among them, Gi and Gi -1 are the carry generation signal of the i-th bit and the carry generation signal of the i-1-th bit.
应理解,第一预处理单元也可以直接由与或非门这种结构实现,本实施例对此不做限定。It should be understood that the first pre-processing unit may also be directly implemented by a structure such as an AND-NOR gate, and this embodiment does not limit this.
本实施例中,第二预处理单元用于对对应的第一加数和第二加数中的第j个比特位和第j-1个比特位进行运算,生成第二预处理结果,第二预处理结果指示第j个比特位和第j-1个比特位的进位传播信号的逻辑与运算结果,j为偶数。In this embodiment, the second preprocessing unit is used to perform operations on the j-th bit and the j-1-th bit in the corresponding first addend and the second addend to generate a second preprocessing result, and the second preprocessing result indicates the logical AND operation result of the carry propagation signals of the j-th bit and the j-1-th bit, where j is an even number.
可选地,在本申请的一种具体的实现方式中,如图3所示,第二预处理单元包括:第一或门301、第二或门302和第一与非门303,第一或门301的第一输入端和第二输入端分别接收第j个比特位,第一或门301的输出端连接至第一与非门的第一输入端;第二或门302的第一输入端和第二输入端分别接收第j-1个比特位,第二或门302的输出端连接至第一与非门303的第二输入端,第一与非门303的输出端输出第二预处理结果。例如,若第一加数为A,第二加数为B,则第一预处理结果为其中,Pj和Pj-1为第j个比特位的进位传播信号和第j-1个比特位的进位传播信号。Optionally, in a specific implementation of the present application, as shown in FIG3 , the second preprocessing unit includes: a first OR gate 301, a second OR gate 302 and a first NAND gate 303, the first input terminal and the second input terminal of the first OR gate 301 respectively receive the j-th bit, and the output terminal of the first OR gate 301 is connected to the first input terminal of the first NAND gate; the first input terminal and the second input terminal of the second OR gate 302 respectively receive the j-1-th bit, the output terminal of the second OR gate 302 is connected to the second input terminal of the first NAND gate 303, and the output terminal of the first NAND gate 303 outputs the second preprocessing result. For example, if the first addend is A and the second addend is B, the first preprocessing result is Among them, P j and P j-1 are the carry propagation signal of the j-th bit and the carry propagation signal of the j-1-th bit.
应理解,第二预处理单元也可以直接由或与非门这种结构实现,本实施例对此不做限定。It should be understood that the second pre-processing unit may also be directly implemented by a structure such as an OR-NAND gate, and this embodiment does not limit this.
相应地,第n个进位模块包含的多个进位计算单元,用于基于至少一个第一预处理结果和至少一个第二预处理结果以及第n-1个进位模块的级间进位参数得到对应的比特位的进位输出。例如,如图4所示,在一个示例中,第n个进位模块对应第一加数和第二加数中的4至7个比特位,则第n个进位模块对应的预处理单元共生成2个第一预处理结果(也即,GON_5_4)和(也即,GON_7_6),以及2个第二预处理结果(也即,PAN_4_3)、(也即,PAN_6_5),第n个进位模块包含的多个进位计算单元可以基于这些第一预处理结果和第二预处理结果,结合第n-1个进位模块的级间进位参数得到第n个进位模块对应的比特位的进位输出。Accordingly, the nth carry module includes a plurality of carry calculation units, which are used to obtain the carry output of the corresponding bit based on at least one first preprocessing result and at least one second preprocessing result and the inter-stage carry parameter of the n-1th carry module. For example, as shown in FIG4 , in one example, the nth carry module corresponds to 4 to 7 bits in the first addend and the second addend, and the preprocessing unit corresponding to the nth carry module generates a total of 2 first preprocessing results. (i.e., GON_5_4) and (ie, GON_7_6), and 2 second preprocessing results (i.e., PAN_4_3), (That is, PAN_6_5), the multiple carry calculation units included in the nth carry module can obtain the carry output of the bit corresponding to the nth carry module based on these first preprocessing results and the second preprocessing results combined with the inter-stage carry parameters of the n-1th carry module.
可选地,在本申请的一个实施例中,第n个进位模块包含的预处理单元还包括第三预处理单元和第四预处理单元,第三预处理单元分别对至少一个第一预处理单元输出的第一预处理结果和至少一个第二预处理单元输出的第二预处理结果中的相邻至少两个进行运算,以生成对应的第三预处理结果和第四预处理结果,第三预处理结果指示对应的相邻多个比特之间的进位参数,第四预处理结果指示对应的相邻多个比特的进位传播信号的逻辑与运算结果。第n个进位模块包含的多个进位计算单元,用于基于第三预处理结果和第四预处理结果以及第n-1个进位模块的级间进位参数得到对应的比特位的进位输出。Optionally, in one embodiment of the present application, the preprocessing unit included in the nth carry module further includes a third preprocessing unit and a fourth preprocessing unit, the third preprocessing unit respectively operates on at least two adjacent first preprocessing results output by at least one first preprocessing unit and at least two adjacent second preprocessing results output by at least one second preprocessing unit to generate corresponding third preprocessing results and fourth preprocessing results, the third preprocessing result indicates a carry parameter between corresponding adjacent multiple bits, and the fourth preprocessing result indicates a logical AND operation result of carry propagation signals of corresponding adjacent multiple bits. The multiple carry calculation units included in the nth carry module are used to obtain the carry output of the corresponding bit based on the third preprocessing result and the fourth preprocessing result and the inter-stage carry parameter of the n-1th carry module.
例如,第三预处理单元对第一预处理结果和以及第二预处理结果进行运算,生成指示第4个比特位至第7个比特位之间的进位参数第四预处理单元对基于第二预处理结果和第二预处理结果进行运算,生成指示第3个比特位至第6个比特位的进位生成信号的逻辑或运算结果,即一个组内进位传播信号(也即,PAN_6_3)。对应的进位计算单元可以基于第三预处理结果GON_7_4和第四预处理结果PAN_6_3,结合第n-1个进位模块的级间进位参数得到第7个比特位的进位输出。For example, the third preprocessing unit processes the first preprocessing result and And the second preprocessing result Perform an operation to generate a carry parameter indicating the carry between the 4th bit and the 7th bit The fourth preprocessing unit performs a preprocessing operation based on the second preprocessing result. And the second preprocessing result Perform an operation to generate the logical OR result of the carry generation signals indicating the 3rd to 6th bits, that is, an intra-group carry propagation signal. (That is, PAN_6_3). The corresponding carry calculation unit can obtain the carry output of the 7th bit based on the third preprocessing result GON_7_4 and the fourth preprocessing result PAN_6_3 in combination with the inter-stage carry parameter of the n-1th carry module.
可选地,在本申请的一种实施例中,第n个进位模块包含的多个进位计算单元包括与第i个比特位对应的第一进位计算单元,第一进位计算单元包括第三或门、第三与门和第二或非门;Optionally, in an embodiment of the present application, the multiple carry calculation units included in the nth carry module include a first carry calculation unit corresponding to the i-th bit, and the first carry calculation unit includes a third OR gate, a third AND gate, and a second NOR gate;
第三或门的第一输入端连接至对应的第二预处理单元的输出端,第三或门的第二输入端连接至第n-1个进位模块输出的级间进位参数,第三或门的输出端连接至第三与门的第一输入端,第三与门的第二输入端连接至对应的第一预处理单元的输出端,第三与门的输出端输出第i个比特的进位参数;A first input end of the third OR gate is connected to an output end of the corresponding second preprocessing unit, a second input end of the third OR gate is connected to an inter-stage carry parameter output by the n-1th carry module, an output end of the third OR gate is connected to a first input end of a third AND gate, a second input end of the third AND gate is connected to an output end of the corresponding first preprocessing unit, and an output end of the third AND gate outputs an i-th bit carry parameter;
第三与门的输出端连接至第二或非门的第一输入端,第二或非门的第二输入端接收第i个比特位的进位传播信号,第二或非门的输出端连接至求和模块,以向求和模块输出第i个比特位的进位输出。The output end of the third AND gate is connected to the first input end of the second NOR gate, the second input end of the second NOR gate receives the carry propagation signal of the i-th bit, and the output end of the second NOR gate is connected to the summing module to output the carry output of the i-th bit to the summing module.
例如,如图4所示,第n-1个进位模块对应第一加数和第二加数中的0至3个比特位,第n个进位模块对应第一加数和第二加数中的4至7个比特位为例,第n个进位模块包含的预处理单元包括交替布置的第一预处理单元和第二预处理单元401~404,以及交替布置的第一进位计算单元和第二进位计算单元405~408。对于第5个比特位,对应的第一进位计算单元406中的第三或门的第一输入端连接至对应的第二预处理单元401的输出端以得到(也即,PAN_4_3),第三或门的第二输入端连接至第n-1个进位模块输出的级间进位参数(也即,CPN_3_0),第三或门的输出端连接至第三与门的第一输入端,第三与门的第二输入端连接至对应的第一预处理单元的输出端以得到(也即,GON_5_4),第三与门的输出端输出第5个比特位的进位参数(也即,CPN_5_0)。第三与门的输出端连接至第二或非门的第一输入端,第二或非门的第二输入端接收第5个比特位的进位传播信号(也即,PN_5),第二或非门的输出端输出进位输出 (也即,CN_5_0),即第5个比特位的进位输出基于第5个比特位的组内进位生成信号G5:4和组内进位传播信号P5:3以及第1个进位模块的级间进位参数得到。For example, as shown in FIG4, the n-1th carry module corresponds to the 0th to 3th bits of the first addend and the second addend, and the nth carry module corresponds to the 4th to 7th bits of the first addend and the second addend. For example, the preprocessing units included in the nth carry module include the first preprocessing units and the second preprocessing units 401 to 404 arranged alternately, and the first carry calculation units and the second carry calculation units 405 to 408 arranged alternately. For the 5th bit, the first input end of the third OR gate in the corresponding first carry calculation unit 406 is connected to the output end of the corresponding second preprocessing unit 401 to obtain (ie, PAN_4_3), the second input terminal of the third OR gate is connected to the inter-stage carry parameter output by the n-1th carry module (ie, CPN_3_0), the output end of the third OR gate is connected to the first input end of the third AND gate, and the second input end of the third AND gate is connected to the output end of the corresponding first pre-processing unit to obtain (That is, GON_5_4), the output end of the third AND gate outputs the carry parameter of the 5th bit (That is, CPN_5_0). The output of the third AND gate is connected to the first input of the second NOR gate, and the second input of the second NOR gate receives the carry propagation signal of the fifth bit. (ie, PN_5), the output terminal of the second NOR gate outputs a carry output (That is, CN_5_0), that is, the carry output of the 5th bit is obtained based on the intra-group carry generation signal G 5:4 and the intra-group carry propagation signal P 5:3 of the 5th bit and the inter-stage carry parameter of the 1st carry module.
此外,由于C5=G5:4+P5:3·CP3=G5:4+P5:4·C3,因此,也可以理解为,第5个比特位的进位输出基于第5个比特位的组内进位生成信号G5:4和组内进位传播信号P5:4以及第n-1个进位模块的级间进位输出得到。In addition, since C5 =G5 :4 +P5 :3 · CP3 =G5 :4 +P5 :4 · C3 , it can also be understood that the carry output of the 5th bit is obtained based on the intra-group carry generation signal G5 :4 and the intra-group carry propagation signal P5 :4 of the 5th bit and the inter-stage carry output of the n-1th carry module.
又例如,如图4所示,对于第7个比特位,对应的第一进位计算单元408中的第三或门的第一输入端连接至对应的第四预处理单元410的输出端以得到(也即,PAN_6_3),第三或门的第二输入端连接至第n-1个进位模块输出的级间进位参数(也即,CPN_3_0),第三或门的输出端连接至第三与门的第一输入端,第三与门的第二输入端连接至对应的第四预处理单元409的输出端以得到第三与门的输出端输出第7个比特位的进位参数 (也即,CPN_7_0)。第三与门的输出端连接至第二或非门的第一输入端,第二或非门的第二输入端接收第7个比特位的进位传播信号(也即,PN_7),第二或非门的输出端输出进位输出(也即,CN_7_0),即第7个比特位的进位输出基于第7个比特位的组内进位生成信号G7:4和组内进位传播信号P7:3以及第1个进位模块的级间进位参数得到。For another example, as shown in FIG. 4 , for the 7th bit, the first input terminal of the third OR gate in the corresponding first carry calculation unit 408 is connected to the output terminal of the corresponding fourth pre-processing unit 410 to obtain (ie, PAN_6_3), the second input terminal of the third OR gate is connected to the inter-stage carry parameter output by the n-1th carry module (ie, CPN_3_0), the output end of the third OR gate is connected to the first input end of the third AND gate, and the second input end of the third AND gate is connected to the output end of the corresponding fourth pre-processing unit 409 to obtain The output of the third AND gate outputs the carry parameter of the 7th bit (That is, CPN_7_0). The output of the third AND gate is connected to the first input of the second NOR gate, and the second input of the second NOR gate receives the carry propagation signal of the 7th bit. (ie, PN_7), the output terminal of the second NOR gate outputs a carry output (That is, CN_7_0), that is, the carry output of the 7th bit is obtained based on the intra-group carry generation signal G 7:4 and the intra-group carry propagation signal P 7:3 of the 7th bit and the inter-stage carry parameter of the 1st carry module.
此外,由于第7个比特位为第2个进位模块对应的最高位,因此在第2个比特位的进位输出的计算中得到的进位参数(也即CP_7_0)作为第2个进位模块的级间进位输出,提供给第3个进位模块。In addition, since the 7th bit is the highest bit corresponding to the second carry module, the carry parameter obtained in the calculation of the carry output of the second bit is (ie, CP_7_0) is used as the inter-stage carry output of the second carry module and provided to the third carry module.
可选地,在本申请的一种实施例中,多个进位计算单元还包括第j个比特位对应的第二进位计算单元,第二进位计算单元包括第四或门和第二与非门。Optionally, in an embodiment of the present application, the multiple carry calculation units further include a second carry calculation unit corresponding to the j-th bit, and the second carry calculation unit includes a fourth OR gate and a second NAND gate.
第四或门的第一输入端连接至对应的第二预处理单元的输出端,第四或门的第二输入端连接至第n-1个进位模块输出的级间进位参数或第j-1个比特位的进位参数,第四或门的输出端连接至第二与非门的第一输入端,第二与非门的第二输入端接收第j个比特位对应的进位生成信号,第二与非门的输出端连接至求和模块,以向求和模块输出第j个比特位的进位输出。The first input end of the fourth OR gate is connected to the output end of the corresponding second preprocessing unit, the second input end of the fourth OR gate is connected to the inter-level carry parameter output by the n-1th carry module or the carry parameter of the j-1th bit, the output end of the fourth OR gate is connected to the first input end of the second NAND gate, the second input end of the second NAND gate receives the carry generation signal corresponding to the jth bit, and the output end of the second NAND gate is connected to the summation module to output the carry output of the jth bit to the summation module.
同样地,如图4所示,对于第4个比特位,对应的第二进位计算单元405中的第四或门的第一输入端连接至对应的第二预处理单元的输出端,以得到第四或门的第二输入端连接至第n-1个进位模块输出的级间进位参数第四或门的输出端连接至第二与非门的第一输入端,第二与非门的第二输入端接收第4个比特位对应的进位生成信号(也即,GN_4),第二与非门的输出端输出(也即,C_4),即第4个比特位的进位输出基于第4个比特位的组内进位生成信号G4和组内进位传播信号P4:3以及第n-1个进位模块的级间进位参数CP3得到。此外,由于C4=G4+P4·P3·CP3=G4+P4·C3,也可以理解为,第5个比特位的进位输出基于第5个比特位的组内进位生成信号G4和组内进位传播信号P4以及第n-1个进位模块的级间进位输出C3得到。Similarly, as shown in FIG. 4 , for the 4th bit, the first input terminal of the fourth OR gate in the corresponding second carry calculation unit 405 is connected to the output terminal of the corresponding second pre-processing unit to obtain The second input terminal of the fourth OR gate is connected to the inter-stage carry parameter output by the n-1th carry module. The output end of the fourth OR gate is connected to the first input end of the second NAND gate, and the second input end of the second NAND gate receives the carry generation signal corresponding to the fourth bit. (ie, GN_4), the output terminal of the second NAND gate outputs (That is, C_4), that is, the carry output of the 4th bit is obtained based on the intra-group carry generation signal G 4 and the intra-group carry propagation signal P 4:3 of the 4th bit and the inter-stage carry parameter CP 3 of the n-1th carry module. In addition, since C 4 =G 4 +P 4 ·P 3 ·CP 3 =G 4 +P 4 ·C 3 , it can also be understood that the carry output of the 5th bit is obtained based on the intra-group carry generation signal G 4 and the intra-group carry propagation signal P 4 of the 5th bit and the inter-stage carry output C 3 of the n-1th carry module.
又例如,如图4所示,对于第6个比特位,对应的第二进位计算单元中的第四或门的第一输入端连接至对应的第二预处理单元的输出端,以得到(也即,PAN_6_5),第四或门的第二输入端连接至第5个比特位的进位参数,以得到(也即,CPN_5_0),第四或门的输出端连接至第二与非门的第一输入端,第二与非门的第二输入端接收第6个比特位对应的进位生成信号(也即,GN_6),第二与非门的输出端输出 即第6个比特位的进位输出基于第6个比特位的组内进位生成信号G6和组内进位传播信号P6:5以及第5个比特位的进位参数CP5得到。For another example, as shown in FIG4, for the sixth bit, the first input terminal of the fourth OR gate in the corresponding second carry calculation unit is connected to the output terminal of the corresponding second pre-processing unit to obtain (ie, PAN_6_5), the second input of the fourth OR gate is connected to the carry parameter of the fifth bit to obtain (ie, CPN_5_0), the output end of the fourth OR gate is connected to the first input end of the second NAND gate, and the second input end of the second NAND gate receives the carry generation signal corresponding to the sixth bit (ie, GN_6), the output terminal of the second NAND gate outputs That is, the carry output of the 6th bit is obtained based on the intra-group carry generation signal G 6 of the 6th bit and the intra-group carry propagation signal P 6:5 and the carry parameter CP 5 of the 5th bit.
应理解,图4仅是用于说明本申请实施例提供的加法器的进位模块的一种示例,49位加法器中的各个进位模块中的预处理单元和多个进位计算单元的连接关系可以根据需要进行调整,本实施例对此不做限定。It should be understood that Figure 4 is only an example of the carry module of the adder provided in the embodiment of the present application. The connection relationship between the preprocessing unit and the multiple carry calculation units in each carry module of the 49-bit adder can be adjusted as needed, and this embodiment does not limit this.
本实施例中,由于每个进位模块中的第一预处理单元、第二预处理单元、第三预处理单元和第四预处理单元对每个进位模块对应的第一加数和第二加数中的多个比特位进行预处理,每个进位模块包含的多个进位计算单元,这使得每个进位模块在获取到前一进位模块输出的级间进位参数时,每个进位模块中的多个进位计算单元即可以直接利用预处理结果和前一进位模块输出的级间进位参数并行计算对应的每个比特位的进位输出,由此基本上实现了并行计算49位二进制数据中每个比特位的进位输出。In the present embodiment, since the first preprocessing unit, the second preprocessing unit, the third preprocessing unit and the fourth preprocessing unit in each carry module preprocess the multiple bits in the first addend and the second addend corresponding to each carry module, each carry module includes multiple carry calculation units, so that when each carry module obtains the inter-stage carry parameter output by the previous carry module, the multiple carry calculation units in each carry module can directly use the preprocessing result and the inter-stage carry parameter output by the previous carry module to parallelly calculate the carry output of each corresponding bit, thereby basically realizing the parallel calculation of the carry output of each bit in the 49-bit binary data.
如图5所示,第1进位模块501对应于第一加数和第二加数中的第0个比特位至第3个比特位,第2进位模块502对应于第一加数和第二加数中的第4个比特位至第7个比特位,第3进位模块503对应于第一加数和第二加数中的第8个比特位至第13个比特位,第4个进位模块对应第一加数和第二加数的第14比特位至第21比特位,第5个进位模块对应第一加数和第二加数的第22比特位至第29比特位,第6个进位模块对应第一加数和第二加数的第30比特位至第48比特位。第1进位模块501至第6进位模块506中的预处理单元对对应的比特位进行预处理,第1个进位模块对应的多个比特位中的最高位(即第3个比特位)的进位参数作为级间进位参数提供至第2进位模块,以由第2进位模块中的多个进位计算单元计算第2进位模块对应的每个比特位的进位输出,同时,第2进位模块对应的多个比特位中的最高位(即第7个比特位)基于预处理结果和第1进位模块的级间进位输出得到第7比特位的级间进位参数,并提供至第3进位模块,以由第3进位模块中的多个进位计算单元计算第3进位模块对应的每个比特位的进位输出,以此类推,由此基本上实现了并行计算49位二进制数据中每个比特位的进位输出,以用于求和模块507根据第一加数A和第二加数A中的每个比特位和对应的进位输出并行计算每个比特位的求和结果,由此可以缩短整个计算过程的时长,提高计算速度。As shown in Figure 5, the first carry module 501 corresponds to the 0th to 3rd bits of the first addend and the second addend, the second carry module 502 corresponds to the 4th to 7th bits of the first addend and the second addend, the third carry module 503 corresponds to the 8th to 13th bits of the first addend and the second addend, the fourth carry module corresponds to the 14th to 21st bits of the first addend and the second addend, the fifth carry module corresponds to the 22nd to 29th bits of the first addend and the second addend, and the sixth carry module corresponds to the 30th to 48th bits of the first addend and the second addend. The preprocessing units in the first carry module 501 to the sixth carry module 506 preprocess the corresponding bits, and the carry parameter of the highest bit (i.e., the third bit) among the multiple bits corresponding to the first carry module is provided to the second carry module as an inter-stage carry parameter, so that the multiple carry calculation units in the second carry module calculate the carry output of each bit corresponding to the second carry module. At the same time, the highest bit (i.e., the seventh bit) among the multiple bits corresponding to the second carry module is calculated based on the preprocessing result and the inter-stage carry of the first carry module. The inter-level carry parameter of the 7th bit is output and provided to the 3rd carry module, so that the multiple carry calculation units in the 3rd carry module calculate the carry output of each bit corresponding to the 3rd carry module, and so on. This basically realizes the parallel calculation of the carry output of each bit in the 49-bit binary data, so that the summation module 507 can calculate the summation result of each bit in parallel according to each bit in the first addend A and the second addend A and the corresponding carry output, thereby shortening the duration of the entire calculation process and improving the calculation speed.
此外,通过有规律地布置第一预处理单元、第二预处理单元、第三预处理单元、第四预处理单元、第一进位计算单元和第二进位计算单元,可以在提高49位加法器的计算速度的同时,减少49位加法器的占用面积,并且使得布线较为集中,有利于整体结构化布局。In addition, by regularly arranging the first preprocessing unit, the second preprocessing unit, the third preprocessing unit, the fourth preprocessing unit, the first carry calculation unit, and the second carry calculation unit, the calculation speed of the 49-bit adder can be improved while reducing the occupied area of the 49-bit adder, and the wiring can be more concentrated, which is conducive to the overall structured layout.
需要指出的是,图5仅是用于说明本实施实施例提供的49位加法器的进位链的一种具体示例,根据实际需要,进位模块的数量可以为2个、4个、或者更多个,并且每个进位模块对应的具体比特位可以根据需要进行设置,本实施例对此不做限定。It should be pointed out that Figure 5 is only a specific example of the carry chain of the 49-bit adder provided in this embodiment. According to actual needs, the number of carry modules can be 2, 4, or more, and the specific bits corresponding to each carry module can be set as needed. This embodiment does not limit this.
实施例三Embodiment 3
基于上述实施例提供的49位加法器,本申请实施例提供一种49位加法器的实现方法。图6为本申请实施例提供的一种49位加法器的实现方法的流程图。如图6所示,该49位加法器的实现方法包括:Based on the 49-bit adder provided in the above embodiment, an embodiment of the present application provides a method for implementing a 49-bit adder. FIG6 is a flow chart of a method for implementing a 49-bit adder provided in an embodiment of the present application. As shown in FIG6, the method for implementing a 49-bit adder includes:
S601、接收第一加数和第二加数,第一加数和第二加数按照比特位从低到高的顺序划分为N个数据组,每个数据组包括第一加数和第二加数中的多个比特位,N为大于1且小于48的整数;S601, receiving a first addend and a second addend, wherein the first addend and the second addend are divided into N data groups in order of bits from low to high, each data group includes a plurality of bits in the first addend and the second addend, and N is an integer greater than 1 and less than 48;
S602、对每个数据组包含的多个比特位进行预处理;S602, preprocessing multiple bits included in each data group;
S603、计算每个数据组包含的多个比特位的进位输出,其中,对于N个数据组中的第n个数据组,根据第n个数据组的预处理结果和第n-1个数据组的级间进位参数进行运算,生成第n个数据组对应的每个比特位的进位输出和第n个进位模块的级间进位参数,n为大于1且小于或等于N的整数;S603, calculating the carry outputs of multiple bits contained in each data group, wherein for the nth data group among the N data groups, performing calculations according to the preprocessing result of the nth data group and the inter-stage carry parameter of the n-1th data group, generating the carry output of each bit corresponding to the nth data group and the inter-stage carry parameter of the nth carry module, where n is an integer greater than 1 and less than or equal to N;
S604、根据第一加数和第二加数中的每个比特位、以及对应的进位输出进行运算,得到对应的求和结果。S604: Perform an operation according to each bit of the first addend and the second addend, and the corresponding carry output, to obtain a corresponding sum result.
可选地,在本申请的一种实施例中,步骤S602具体包括:Optionally, in an embodiment of the present application, step S602 specifically includes:
对对应的第一加数和第二加数中的每个比特位进行运算,生成每个比特位对应的进位生成信号和进位传播信号;基于对应的至少一个比特位的进位生成信号和进位传播信号分别生成每个比特位的组内进位生成信号和组内进位传播信号;Performing operations on each bit of the corresponding first addend and second addend to generate a carry generation signal and a carry propagation signal corresponding to each bit; generating an intra-group carry generation signal and an intra-group carry propagation signal for each bit based on the carry generation signal and the carry propagation signal of the corresponding at least one bit;
相应地,步骤S603具体包括:Accordingly, step S603 specifically includes:
根据每个数据组对应的比特位的组内进位生成信号和组内进位传播信号以及前一数据组的级间进位参数进行运算,生成每个数据组对应的比特位的进位输出。An operation is performed based on the intra-group carry generation signal and the intra-group carry propagation signal of the bit position corresponding to each data group and the inter-stage carry parameter of the previous data group to generate a carry output of the bit position corresponding to each data group.
可选地,在本申请的一种实施例中,计算每个数据组包含的多个比特位的进位输出,还包括:将每个数据组对应的多个比特位中的最高位的进位输出的计算中得到的进位参数,作为所述数据组的级间进位参数,其中,最高位的进位输出基于最高位的进位参数与最高位的进位传播信号进行运算得到。Optionally, in one embodiment of the present application, calculating the carry output of multiple bits contained in each data group also includes: using the carry parameter obtained from the calculation of the carry output of the highest bit among the multiple bits corresponding to each data group as the inter-level carry parameter of the data group, wherein the carry output of the highest bit is obtained by calculating the carry parameter of the highest bit and the carry propagation signal of the highest bit.
可选地,在本申请的一种实施例中,每个数据组对应的第一加数和第二加数中的比特位的数量等于或大于前一数据组对应的第一加数和第二加数中的比特位的数量。Optionally, in an embodiment of the present application, the number of bits in the first addend and the second addend corresponding to each data group is equal to or greater than the number of bits in the first addend and the second addend corresponding to the previous data group.
可选地,在本申请的一种实施例中,N等于6,第1个数据组对应第一加数和第二加数的第0比特位至第3比特位,第2个数据组对应第一加数和第二加数的第4比特位至第7比特位,第3个数据组对应第一加数和第二加数的第8比特位至13比特位,,所述第4个进位模块对应所述第一加数和所述第二加数的第14比特位至第21比特位,所述第5个进位模块对应所述第一加数和所述第二加数的第22比特位至第29比特位,所述第6个进位模块对应所述第一加数和所述第二加数的第30比特位至第48比特位。Optionally, in one embodiment of the present application, N is equal to 6, the first data group corresponds to the 0th to 3rd bits of the first addend and the second addend, the second data group corresponds to the 4th to 7th bits of the first addend and the second addend, the third data group corresponds to the 8th to 13th bits of the first addend and the second addend, the fourth carry module corresponds to the 14th to 21st bits of the first addend and the second addend, the fifth carry module corresponds to the 22nd to 29th bits of the first addend and the second addend, and the sixth carry module corresponds to the 30th to 48th bits of the first addend and the second addend.
本申请实施例提供的49位加法器的实现方法,用于实现前述装置实施例中的49位加法器,并具有相应的装置实施例的有益效果,此处不再赘述。The implementation method of the 49-bit adder provided in the embodiment of the present application is used to implement the 49-bit adder in the aforementioned device embodiment, and has the beneficial effects of the corresponding device embodiment, which will not be repeated here.
实施例四Embodiment 4
本申请实施例提供了一种运算电路,该运算电路包括根据前述实施例一和二中任一项提供的49位加法器。其原理与效果类似,此处不再赘述。The embodiment of the present application provides an operation circuit, which includes a 49-bit adder provided according to any one of the above-mentioned embodiments 1 and 2. The principle and effect thereof are similar and will not be described in detail here.
实施例五Embodiment 5
本申请实施例提供了一种芯片,该芯片包括根据前述实施例四提供的运算电路。其原理与效果类似,此处不再赘述。The embodiment of the present application provides a chip, which includes the operation circuit provided according to the above-mentioned embodiment 4. The principle and effect thereof are similar and will not be described in detail here.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110838058.3A CN113419704B (en) | 2021-07-23 | 2021-07-23 | 49-Bit adder and implementation method thereof, operation circuit and chip |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110838058.3A CN113419704B (en) | 2021-07-23 | 2021-07-23 | 49-Bit adder and implementation method thereof, operation circuit and chip |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113419704A CN113419704A (en) | 2021-09-21 |
CN113419704B true CN113419704B (en) | 2024-08-02 |
Family
ID=77719609
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110838058.3A Active CN113419704B (en) | 2021-07-23 | 2021-07-23 | 49-Bit adder and implementation method thereof, operation circuit and chip |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113419704B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN215068203U (en) * | 2021-07-23 | 2021-12-07 | 北京源启先进微电子有限公司 | 49-bit adder, arithmetic circuit and chip |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3356613B2 (en) * | 1996-02-14 | 2002-12-16 | 日本電気株式会社 | Addition method and adder |
JPH09231055A (en) * | 1996-02-27 | 1997-09-05 | Denso Corp | Logical operation circuit and carry look-ahead adder |
JPH11134173A (en) * | 1997-10-30 | 1999-05-21 | Fujitsu Ltd | Binary adder |
WO2000057270A1 (en) * | 1999-03-23 | 2000-09-28 | Sony Electronics, Inc. | Adder circuit |
US7290027B2 (en) * | 2002-01-30 | 2007-10-30 | International Business Machines Corporation | Circuit suitable for use in a carry lookahead adder |
CN102226885A (en) * | 2011-05-24 | 2011-10-26 | 电子科技大学 | Modulo 2n-2k-1 adder and design method thereof |
CN102866875B (en) * | 2012-10-05 | 2016-03-02 | 刘杰 | Multioperand adder |
CN110633068A (en) * | 2018-06-25 | 2019-12-31 | 北京嘉楠捷思信息技术有限公司 | Travelling wave carry adder |
CN111708512B (en) * | 2020-07-22 | 2025-02-25 | 深圳比特微电子科技有限公司 | Adder, operation circuit, chip and computing device |
-
2021
- 2021-07-23 CN CN202110838058.3A patent/CN113419704B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN215068203U (en) * | 2021-07-23 | 2021-12-07 | 北京源启先进微电子有限公司 | 49-bit adder, arithmetic circuit and chip |
Non-Patent Citations (1)
Title |
---|
邹逢兴.《计算机硬件技术基础实验教程》.高等教育出版社,2000,第37-39页. * |
Also Published As
Publication number | Publication date |
---|---|
CN113419704A (en) | 2021-09-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Hatamian et al. | A 70-MHz 8-bit/spl times/8-bit parallel pipelined multiplier in 2.5-/spl mu/m CMOS | |
Guo et al. | Fast binary counters and compressors generated by sorting network | |
CN107977191A (en) | Low-power-consumption parallel multiplier | |
Thakur et al. | Design and analysis of high-speed parallel prefix adder for digital circuit design applications | |
CN113407153B (en) | 16-Bit adder and implementation method thereof, operation circuit and chip | |
Chen et al. | An asynchronous energy-efficient CNN accelerator with reconfigurable architecture | |
CN103235710A (en) | Reversible-logic-based 16-bit carry look-ahead adder | |
Somasekhar et al. | A 230-MHz half-bit level pipelined multiplier using true single-phase clocking | |
CN113419704B (en) | 49-Bit adder and implementation method thereof, operation circuit and chip | |
CN113419703B (en) | 33-bit adder and its implementation method, operation circuit and chip | |
Yamamoto et al. | A systematic methodology for design and analysis of approximate array multipliers | |
CN215068203U (en) | 49-bit adder, arithmetic circuit and chip | |
Pathak et al. | Low power Dadda multiplier using approximate almost full adder and Majority logic based adder compressors | |
CN215068205U (en) | 16-bit adder, arithmetic circuit and chip | |
CN116796816B (en) | Processors, computing chips and computing devices | |
Neeraja et al. | Design of an area efficient braun multiplier using high speed parallel prefix adder in cadence | |
CN114756203A (en) | Base 4Booth multiplier and implementation method, arithmetic circuit and chip thereof | |
CN114756200A (en) | 64-bit adder for realizing radix-4 Booth multiplier and its realization method, operation circuit and chip | |
Senthilpari et al. | Low energy, low latency and high speed array divider circuit using a Shannon theorem based adder cell | |
CN1553310A (en) | Symmetric cutting algorithm for high-speed low loss multiplier and circuit strucure thereof | |
Puneeth et al. | Design and Implementation of High Frequency 16-bit full adder on FPGA Families | |
kumar Varshney et al. | Deployment of Braun Multiplier Using Novel Adder Formulations | |
Kumar et al. | Low Power Multiplier using SPST based on Kogge Stone Adder | |
CN102955682A (en) | Modular multiplier | |
CN102929575A (en) | Modular multiplier |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20240228 Address after: No. 519, 2nd Street, Baiyang Street, Qiantang New District, Hangzhou City, Zhejiang Province, China, 4-1301 Applicant after: Hangzhou Yuanhe Technology Co.,Ltd. Country or region after: China Address before: 100080 unit 1-32-1, 14th floor, block B, No. 3 Danling street, Haidian District, Beijing Applicant before: Beijing Yuanqi Advanced Microelectronics Co.,Ltd. Country or region before: China |
|
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20241119 Address after: 100089, 5th Floor, Building 7, Courtyard A2, West Third Ring North Road, Haidian District, Beijing Patentee after: Zhongguancun Technology Leasing Co.,Ltd. Country or region after: China Address before: No. 519, 2nd Street, Baiyang Street, Qiantang New District, Hangzhou City, Zhejiang Province, China, 4-1301 Patentee before: Hangzhou Yuanhe Technology Co.,Ltd. Country or region before: China |