Addition circuit, operation circuit, circuit for performing hash algorithm and related device

By separating the carry logic and summation logic modules and combining registers and small-scale adders, the problems of high glitches and high power consumption in hash algorithm addition circuits are solved, realizing a low-glitch and low-power addition circuit, thus improving calculation speed and efficiency.

CN120915430BActive Publication Date: 2026-01-23SHENZHEN MICROBT ELECTRONICS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511353244.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-22
Publication Date
2026-01-23
Estimated Expiration
2045-09-22

AI Technical Summary

Technical Problem

Existing hash algorithms suffer from numerous glitches and high power consumption in their addition circuits, which negatively impact computational efficiency and speed, especially when calculating large values.

Method used

It adopts a separate carry logic module and summation logic module structure. The carry logic module calculates and stores the carry in advance, and combined with the register module and multiple small-scale adders, it reduces glitches and power consumption.

Benefits of technology

It achieves a low-glitch, low-power adder circuit, improving computation speed and efficiency, and especially reducing latency and power consumption when applied in pipelined structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120915430B_ABST
    Figure CN120915430B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an addition circuit, an operation circuit, a circuit for performing a hash algorithm, and related devices. The addition circuit has first and second inputs, each of which is divided into first to N-th portions in order from low bits to high bits, N being an integer greater than 1. The addition circuit includes: a carry logic module configured to calculate one or more carries, each of which corresponds to a carry generated by adding a corresponding one of the first input and a corresponding portion of the second input; first and second register modules configured to store first to N-th-1 portions of the first and second inputs, respectively; a third register module configured to store the one or more carries; a first sum logic module configured to sum the N-th portions of the first and second inputs to generate an intermediate sum; a fourth register module configured to store the intermediate sum; and a second sum logic module configured to sum the first to N-th-1 portions of the first and second inputs, the intermediate sum, and the one or more carries.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates generally to an addition circuit, an operation circuit, a circuit for performing a hash algorithm, a computing chip, and a computing device. BACKGROUND

[0002] A hash algorithm is an algorithm that takes variable-length data as input and produces a fixed-length hash value as output, and its essence is to refine information. Since 1993, the U.S. Institute of Standards and Technology has designed and published multiple versions of the Secure Hash Algorithm (SHA), and SHA-256 is one of the secure hash algorithms with a hash length of 256 bits. SUMMARY

[0003] According to a first aspect of the present disclosure, an addition circuit is provided for calculating the sum of a first number and a second number, the addition circuit having a first input representing the first number and a second input representing the second number and having an output representing the sum of the first number and the second number, each of the first input and the second input being divided into 1st to Nth parts corresponding to each other, N being an integer greater than 1, the 1st to Nth parts representing the partial bits of the input in turn from low to high, the addition circuit comprising: a carry logic module configured to calculate one or more carries, each of the one or more carries corresponding to a carry generated by adding a corresponding one of the first input and a corresponding part of the second input; a first register module configured to store the 1st to N-1th parts of the first input; a second register module configured to store the 1st to N-1th parts of the second input; a third register module coupled to the carry logic module and configured to store the one or more carries; a first summing logic module configured to sum the Nth part of the first input and the Nth part of the second input, thereby generating an intermediate sum; a fourth register module coupled to the first summing logic module and configured to store the intermediate sum; and a second summing logic module coupled to the first to fourth register modules and configured to sum the 1st to N-1th parts of the first input, the 1st to N-1th parts of the second input, the intermediate sum, and the one or more carries, wherein the sum output by the second summing logic module represents the partial bits of the output in turn from low to high.

[0004] In some embodiments, the carry logic module is configured to calculate the one or more carries using look-ahead carry logic.

[0005] In some embodiments, the first summing logic module is implemented as a ripple-carry adder.

[0006] In some embodiments, the second summing logic module is implemented as a plurality of ripple-carry adders in parallel.

[0007] In some embodiments, N is an integer greater than 2, and wherein: the carry logic module is configured to compute N-2 carries, an i-th carry of the N-2 carries corresponding to a carry resulting from adding an i-th portion of the first input and an i-th portion of the second input, i = 1,..., N-2; the first register module and the second register module each include 1st through (N-1)th cells, and the second sum logic module includes 1st through (N-1)th adders; a j-th cell of the first register module is configured to store a j-th portion of the first input, a j-th cell of the second register module is configured to store a j-th portion of the second input, and a j-th adder of the second sum logic module is coupled to the j-th cell of the first register module and the j-th cell of the second register module, j = 1,..., N-1; a 1st adder of the second sum logic module is configured to sum the 1st portion of the first input and the 1st portion of the second input; and an (N-1)th adder of the second sum logic module is further coupled to the third register module and the fourth register module and is configured to sum the (N-1)th portion of the first input, the (N-1)th portion of the second input, the intermediate sum, and an (N-2)th carry of the N-2 carries.

[0008] In some embodiments, N is an integer greater than 3, and wherein a k-th adder of the second sum logic module is further coupled to the third register module and is configured to sum the k-th portion of the first input, the k-th portion of the second input, and a (k-1)th carry of the N-2 carries, k = 2,..., N-2.

[0009] In some embodiments, each of the 1st through (N-2)th portions of each of the first input and the second input has a first number of bits, and the (N-1)th through Nth portions of the input collectively have a second number of bits, the second number of bits being equal to the first number of bits.

[0010] In some embodiments, the carry logic module includes: a preprocessor configured to perform an exclusive-OR operation and an AND operation on each bit of the 1st through (N-2)th portions of the first input and a corresponding bit of the 1st through (N-2)th portions of the second input, respectively, in parallel, thereby generating a corresponding carry signal and a generate signal; and a carry generator configured to generate the N-2 carries using the carry signals and the generate signals generated by the preprocessor.

[0011] In some embodiments, the carry logic module is configured to compute N-1 carries, an i-th carry of the N-1 carries corresponding to a carry resulting from adding an i-th portion of the first input and an i-th portion of the second input, i = 1, …, N-1; the first register module and the second register module each include 1st to (N-1)th cells, and the second sum logic module includes 1st to Nth adders; a j-th cell of the first register module is configured to store a j-th portion of the first input, a j-th cell of the second register module is configured to store a j-th portion of the second input, and a j-th adder of the second sum logic module is coupled to the j-th cell of the first register module and the j-th cell of the second register module, j = 1, …, N-1; a 1st adder of the second sum logic module is configured to sum the 1st portion of the first input and the 1st portion of the second input; and an Nth adder of the second sum logic module is further coupled to a third register module and a fourth register module, and is configured to sum an intermediate sum and an (N-1)th carry of the N-1 carries.

[0012] In some embodiments, N is an integer greater than 2, and wherein a k-th adder of the second sum logic module is further coupled to the third register module and is configured to sum the k-th portion of the first input, the k-th portion of the second input, and a (k-1)th carry of the N-1 carries, k = 2, …, N-1.

[0013] In some embodiments, each portion of each of the first input and the second input has the same number of bits.

[0014] In some embodiments, the carry logic module includes: a preprocessor configured to perform an exclusive-OR operation and an AND operation on each bit of the 1st to (N-1)th portions of the first input and a corresponding bit of the 1st to (N-1)th portions of the second input, respectively, in parallel, thereby generating a corresponding carry signal and a generate signal; and a carry generator configured to generate the N-1 carries using the carry signals and the generate signals generated by the preprocessor.

[0015] In some embodiments, the carry generator includes a parallel prefix network.

[0016] According to a second aspect of the present disclosure, there is provided an arithmetic circuit, comprising: a sum module including an adder circuit according to any embodiment of the first aspect of the present disclosure; and a first arithmetic module coupled to the sum module to provide a first input and a second input of the adder circuit.

[0017] In some embodiments, the arithmetic circuit includes a plurality of arithmetic stages, each of the plurality of arithmetic stages includes a respective register module, and the plurality of arithmetic stages includes a first arithmetic stage and a second arithmetic stage immediately following the first arithmetic stage, the second arithmetic stage further includes the first to fourth register modules of the adder circuit, a first arithmetic module is arranged between the first arithmetic stage and the second arithmetic stage and is coupled to the first respective register module of the first arithmetic stage, the first arithmetic module is configured to operate on data from the first respective register module to produce the first input and the second input of the adder circuit, and the carry logic module and the first sum logic module of the adder circuit are arranged between the first arithmetic stage and the second arithmetic stage.

[0018] In some embodiments, the plurality of arithmetic stages further includes a third arithmetic stage immediately following the second arithmetic stage, a third respective register module of the third arithmetic stage is coupled to the sum module to receive the output of the adder circuit, and a second sum logic module of the adder circuit is arranged between the second arithmetic stage and the third arithmetic stage.

[0019] In some embodiments, the arithmetic circuit further includes: a second arithmetic module arranged between the second arithmetic stage and the third arithmetic stage and coupled to the second respective register module of the second arithmetic stage, the second arithmetic module is configured to operate on data from the second respective register module.

[0020] In some embodiments, the sum module is a first sum module, the adder circuit is a first adder circuit, and the arithmetic circuit further includes: a second sum module including a second adder circuit, the second adder circuit is the adder circuit according to any of the embodiments of the first aspect of the present disclosure, wherein the third arithmetic stage further includes the first to fourth register modules of the second adder circuit, the second arithmetic module is coupled to the second sum module to provide the first input and the second input of the second adder circuit, and is configured to operate on data from the second respective register module to produce the first input and the second input of the second adder circuit, and the carry logic module and the first sum logic module of the second adder circuit are arranged between the second arithmetic stage and the third arithmetic stage.

[0021] According to a third aspect of the present disclosure, there is provided a circuit for performing a hash algorithm, comprising: an input configured to receive data; and an operation configured to calculate a hash value based on the received data, and comprising a plurality of operation stages arranged in a pipeline structure, wherein: the plurality of operation stages comprises a first operation stage and a second operation stage immediately following the first operation stage, each of the first operation stage and the second operation stage comprises a 0th extension register module to a 15th extension register module configured to store 0th extension data to 15th extension data of the operation stage respectively, the 15th extension register module comprises a first sum register submodule, a second sum register submodule, a first carry register submodule and a second carry register submodule, the circuit further comprises a first extension data operation module arranged between the first operation stage and the second operation stage, the first extension data operation module comprises a first submodule, a second submodule and a third submodule, the first submodule is configured to calculate an initial sum and an initial carry based on the 0th extension data of the first operation stage and based on at least two of the 1st extension data, the 9th extension data and the 14th extension data of the first operation stage, each of the initial sum and the initial carry is divided into 1st to Nth parts corresponding to each other to include, N is an integer greater than 2, the 1st to Nth parts sequentially represent partial bits of each of them from low to high, wherein the 1st to N-1th parts of the initial sum are stored in the first sum register submodule of the 15th extension register module of the second operation stage, and the 1st to N-1th parts of the initial carry are stored in the first carry register submodule of the 15th extension register module of the second operation stage, the second submodule is configured to calculate N-2 carries, the i-th carry of the N-2 carries corresponds to a carry generated by adding the i-th part of the initial sum and the i-th part of the initial carry, i = 1, …, N-2, the N-2 carries are stored in the second carry register submodule of the 15th extension register module of the second operation stage, and the third submodule is configured to sum the Nth part of the initial sum and the Nth part of the initial carry, thereby generating an intermediate sum, the intermediate sum is stored in the second sum register submodule of the 15th extension register module of the second operation stage.

[0022] In some embodiments, the plurality of operation stages further comprises a third operation stage immediately following the second operation stage, the third operation stage comprising a 14th extension register module configured to store the 14th extension data of the operation stage, and wherein the circuit further comprises a second extension data operation module arranged between the second operation stage and the third operation stage, the second extension data operation module comprising a fourth sub-module, the fourth sub-module comprising 1st to N-1st adders, wherein the 1st adder is configured to sum the 1st part of the initial summand and the 1st part of the initial carry, wherein the N-1st adder is configured to sum the N-1st part of the initial summand, the N-1st part of the initial carry, the intermediate summand and the N-2nd carry of the N-2 carries, and wherein the N-1 sums outputted by the 1st to N-1st adders are stored in the 14th extension register module of the third operation stage.

[0023] In some embodiments, N is an integer greater than 3, wherein the kth adder of the fourth sub-module is configured to sum the kth part of the initial summand, the kth part of the initial carry and the k-1th carry of the N-2 carries, k = 2, …, N-2.

[0024] According to a fourth aspect of the present disclosure, there is provided a circuit for performing a hash algorithm, comprising: an input configured to receive data; and an operation configured to calculate a hash value based on the received data, and comprising a plurality of operation stages arranged in a pipeline structure, wherein: the plurality of operation stages comprises a first operation stage and a second operation stage immediately following the first operation stage, each of the first operation stage and the second operation stage comprises a 0th extension register module to a 15th extension register module configured to store 0th extension data to 15th extension data of the operation stage respectively, the 15th extension register module comprises a first sum register submodule, a second sum register submodule, a first carry register submodule and a second carry register submodule, the circuit further comprises a first extension data operation module arranged between the first operation stage and the second operation stage, the first extension data operation module comprises a first submodule, a second submodule and a third submodule, the first submodule is configured to calculate an initial sum and an initial carry based on the 0th extension data of the first operation stage and based on at least two of the 1st extension data, the 9th extension data and the 14th extension data of the first operation stage, each of the initial sum and the initial carry is divided into 1st to Nth parts corresponding to each other to include, N is an integer greater than 1, the 1st to Nth parts sequentially represent partial bits of each of them from low to high, wherein the 1st to N-1th parts of the initial sum are stored in the first sum register submodule of the 15th extension register module of the second operation stage, and the 1st to N-1th parts of the initial carry are stored in the first carry register submodule of the 15th extension register module of the second operation stage, the second submodule is configured to calculate N-1 carries, the i-th carry of the N-1 carries corresponds to a carry generated by adding the i-th part of the initial sum and the i-th part of the initial carry, i = 1, …, N-1, the N-1 carries are stored in the second carry register submodule of the 15th extension register module of the second operation stage, and the third submodule is configured to sum the Nth part of the initial sum and the Nth part of the initial carry, thereby generating an intermediate sum, the intermediate sum is stored in the second sum register submodule of the 15th extension register module of the second operation stage.

[0025] In some embodiments, the plurality of operation stages further comprises a third operation stage immediately following the second operation stage, the third operation stage comprising a 14th extension register module configured to store the 14th extension data of the operation stage, and wherein the circuit further comprises a second extension data operation module arranged between the second operation stage and the third operation stage, the second extension data operation module comprising a fourth sub-module, the fourth sub-module comprising 1st to Nth adders, wherein the 1st adder is configured to sum the 1st part of the initial summand and the 1st part of the initial carry, wherein the Nth adder is configured to sum the intermediate summand and the N-1th carry of the N-1 carries, and wherein the N summands output by the 1st to Nth adders are stored in the 14th extension register module of the third operation stage.

[0026] In some embodiments, N is an integer greater than 2, wherein the kth adder of the fourth sub-module is configured to sum the kth part of the initial summand, the kth part of the initial carry and the k-1th carry of the N-1 carries, k = 2, …, N-1.

[0027] According to a fifth aspect of the present disclosure, there is provided a computing chip comprising the circuit according to any of the first to fourth aspects of the present disclosure.

[0028] According to a sixth aspect of the present disclosure, there is provided a computing device comprising the computing chip according to the fifth aspect of the present disclosure.

[0029] Other features of the present disclosure, and their advantages, will become more apparent in the light of the following detailed description of exemplary embodiments of the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0030] The accompanying drawings, which constitute a part of this specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0031] The present disclosure can be understood more fully by reference to the following detailed description of exemplary embodiments of the present disclosure, taken in connection with the accompanying drawings, in which:

[0032] Figure 1 is a schematic block diagram illustrating an operation circuit in some examples;

[0033] Figure 2 is a schematic block diagram illustrating an adder circuit according to some embodiments of the present disclosure;

[0034] Figure 3 is a schematic block diagram illustrating a carry logic module of an adder circuit according to some embodiments of the present disclosure;

[0035] Figures 4A-4Cis a schematic block diagram illustrating a carry lookahead adder (CLA), a parallel prefix adder (PPA), and a parallel prefix network in some examples;

[0036] Figure 5 is a schematic block diagram illustrating an example implementation of the carry logic module of the adder circuit of Figure 2

[0037] Figure 6 is a schematic block diagram illustrating an example implementation of the first sum logic module and the second sum logic module of the adder circuit of Figure 2

[0038] Figure 7 is a schematic block diagram illustrating an adder circuit according to some embodiments of the present disclosure;

[0039] Figure 8 is a schematic block diagram illustrating a carry logic module of an adder circuit according to some other embodiments of the present disclosure;

[0040] Figure 9 is a schematic block diagram illustrating an example implementation of the carry logic module of the adder circuit of Figure 7

[0041] Figure 10 is a schematic block diagram illustrating an example implementation of the first sum logic module and the second sum logic module of the adder circuit of Figure 7

[0042] Figure 11 is a schematic block diagram illustrating an arithmetic circuit according to some embodiments of the present disclosure;

[0043] Figure 12 is a schematic block diagram illustrating an arithmetic circuit according to some other embodiments of the present disclosure;

[0044] Figure 13 is a schematic block diagram illustrating an arithmetic circuit according to yet some other embodiments of the present disclosure;

[0045] Figure 14 is a schematic block diagram illustrating an arithmetic circuit according to still some other embodiments of the present disclosure;

[0046] Figure 15 is a schematic diagram illustrating an example pipeline structure for performing the SHA-256 algorithm;

[0047] Figure 16 is a schematic diagram illustrating an example pipeline structure for performing the SHA-256 algorithm; Figure 15 ​​​​is a schematic diagram illustrating a first example of an extension register module of an operation stage in the pipeline structure in

[0048] Figure 17 is a schematic diagram illustrating a second example of an extension register module of an operation stage in the pipeline structure in Figure 15

[0049] Figure 18 is a schematic diagram illustrating a third example of an extension register module of an operation stage in the pipeline structure in Figure 15

[0050] Figure 19 is a schematic block diagram illustrating a circuit for performing a hash algorithm according to some embodiments of the present disclosure;

[0051] Figure 20 is a schematic block diagram illustrating a circuit for performing a hash algorithm according to some other embodiments of the present disclosure;

[0052] Figure 21 is a schematic diagram illustrating a first example of an extension register module of an operation stage in the circuit shown in Figure 20

[0053] Figure 22 is a schematic diagram illustrating a second example of an extension register module of an operation stage in the circuit shown in Figure 20 Figure 23 is a schematic block diagram illustrating an extension data operation module in Figure 22

[0054] Figure 24 is a schematic diagram illustrating a third example of an extension register module of an operation stage in the circuit shown in Figure 20 Figure 25 is a schematic block diagram illustrating an extension data operation module in Figure 24

[0055] Note that, in the following embodiments, the same reference numerals are sometimes used across different drawings to indicate the same or functionally similar parts, and repeated explanations thereof are omitted. In the present specification, similar reference numerals and letters are used to denote similar items, and therefore, once an item is defined in one drawing, it need not be further discussed in subsequent drawings.

[0056] ​​​​​​​For ease of understanding, the positions, dimensions, and extents of the structures shown in the accompanying drawings and other materials may not represent actual positions, dimensions, and extents. Therefore, the disclosed invention is not limited to the positions, dimensions, and extents disclosed in the accompanying drawings and other materials. Furthermore, the drawings are not necessarily drawn to scale, and some features may be enlarged to show details of specific components. Detailed Implementation

[0057] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of the present disclosure.

[0058] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit this disclosure or its application or use. Those skilled in the art will understand that they are merely illustrative of exemplary ways that can be used to implement the invention, and not exhaustive.

[0059] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.

[0060] It should be understood that, unless explicitly stated otherwise or derived from the context, when referring to the carry-over resulting from addition or summation, the carry-over usually refers to the final carry-over.

[0061] Figure 1 These are schematic diagrams of the operational circuit 10 in some examples. For example... Figure 1 As shown, the arithmetic circuit 10 includes a summing module 12. The summing module 12 is configured to sum a first number a and a second number b, thereby producing a sum s and a carry c. The arithmetic circuit 10 also includes an arithmetic module 11, which is coupled before the summing module 12 and configured to perform the operation to produce the first number a and the second number b. For example, the summing module 12 can be implemented as an adder (ADD), while the arithmetic module 11 can be implemented as a combinational logic circuit. Generally, an ADD can have two inputs and one output, thus reducing one operand; however, an ADD has more stages, more glitches, a larger area, and higher power consumption. Especially when the input of the ADD comes from a combinational logic circuit, the adder has high power consumption due to high glitches.

[0062] To this end, the present disclosure provides an adder circuit that can have reduced glitch, and in turn, lower power consumption. For example, such an adder circuit can be used to compute a sum of a first number and a second number. The adder circuit can have a first input representing the first number and a second input representing the second number and have an output representing the sum of the first number and the second number. Each of the first input and the second input is correspondingly partitioned into 1st to Nth portions. For example, N can be an integer greater than 1. The 1st to Nth portions of each input represent partial bits of the input in order from a lower bit to a higher bit. Such an adder circuit can include a carry logic module configured to compute one or more carries, each of the one or more carries corresponding to a carry generated by adding a respective one of the 1st to Nth portions of the first input and a corresponding one of the 1st to Nth portions of the second input; a first register module configured to store the 1st to N-1th portions of the first input; a second register module configured to store the 1st to N-1th portions of the second input; a third register module coupled to the carry logic module and configured to store the one or more carries; a first sum logic module configured to sum the Nth portion of the first input and the Nth portion of the second input, thereby generating an intermediate sum; a fourth register module coupled to the first sum logic module and configured to store the intermediate sum; and a second sum logic module coupled to the first to fourth register modules and configured to sum the 1st to N-1th portions of the first input, the 1st to N-1th portions of the second input, the intermediate sum, and the one or more carries. The sum output by the second sum logic module can represent partial bits of the output in order from a lower bit to a higher bit.

[0063] Circuits according to various embodiments of the present disclosure are described in detail below with reference to the accompanying drawings. It should be understood that actual circuits can also include other additional components, but in order to avoid obscuring the gist of the present disclosure, these additional components are not discussed herein and are not shown in the accompanying drawings.

[0064] Figure 2 is a schematic diagram of an adder circuit 100 according to some embodiments of the present disclosure. For example, the adder circuit 100 is configured to compute a sum of a first number a and a second number b. The adder circuit 100 can have a first input representing the first number a and a second input representing the second number b and have an output representing the sum s of the first number a and the second number b. Each of the first input a and the second input b is correspondingly partitioned into 1st to Nth portions (N being an integer greater than 2) that represent partial bits of the input in order from a lower bit to a higher bit. For example, the first input a includes a 1st portion a1, a 2nd portion a2, …, an (N-1)th portion a N-1 , a Nth portion a N (i.e., a = [a N , a N-1The second input b includes part 1 b1, part 2 b2, ..., part N-1 b1. N-1 Part Nb N (That is, b = [b N , b N-1 The value of N can be determined according to specific needs, for example, it can be 3, 4, 5, 6, 7, 8, etc.

[0065] like Figure 2 As shown, the adder circuit 100 includes a first register module 102, a second register module 104, a third register module 106, a fourth register module 108, a carry logic module 112, a first summation logic module 114, and a second summation logic module 110.

[0066] The first register module 102 is configured to store the first to N-1th portions of the first input a. Specifically, the first register module 102 includes a first unit 1021, a second unit 1022, ..., an N-1th unit 102. N-1 Each unit is configured to store a corresponding portion of the first input a. For example, the j-th unit 102 of the first register module 102. j Configured to store the j-th part a of the first input a j (j=1,…,N-1).

[0067] The second register module 104 is configured to store the first to the (N-1)th portions of the second input b. Specifically, the second register module 104 includes a first unit 1041, a second unit 1042, ..., an (N-1)th unit 104. N-1 Each unit is configured to store a corresponding portion of the second input b. For example, the j-th unit 104 of the second register module 104... j Configured to store the j-th part of the second input b j (j=1,…,N-1).

[0068] Carry logic module 112 is configured to calculate N-2 carry values ​​c1, ..., c N-2 Carry-over c1, ..., c N-2 Each of the elements in the set has one bit. The carry bits are c1, ..., c1. N-2 The i-th carry c i The i-th part a corresponding to the first input a i With the i-th part of the second input b i The carry generated by the addition (i=1, ..., N-2). For example, the carry logic module 112 can receive at least the first to N-2 parts a1, ..., a2 of the first input a. N-2and at least the 1st to the N-2nd portions b1,..., b N-2 The N-2 carry-ins c1,..., c N-2 are then calculated using the carry logic. As such, the carry logic module 112 does not need to sum the inputs bit by bit, but can quickly jump to the desired bit to obtain the carry-in. An exemplary implementation of the carry logic module 112 will be described in detail below in conjunction with the accompanying drawings.

[0069] The third register module 106 can be coupled to the carry logic module 112 and configured to store the N-2 carry-ins c1,..., c N-2 .

[0070] The first summing logic module 114 and the second summing logic module 110 are configured to cooperate to calculate the sum s of the first number a and the second number b. For example, the first summing logic module 114 can include an adder configured to sum the Nth portion a N of the first input a N and the Nth portion b m of the second input b N to produce an intermediate sum s N . Here, the "intermediate sum" is relative to the sum s that is finally output by the second summing logic module 110, while it is the final output sum for the adder of the first summing logic module 114. The carry-in produced by the adder of the first summing logic module 114 summing a N and b N can be discarded. The fourth register module 108 is coupled to the first summing logic module 114 and configured to store the intermediate sum s m .

[0071] The second summing logic module 110 is coupled to the first to fourth register modules 102-108 to receive the 1st to the N-1th portions a1,..., a N-1 of the first input a N-1 , the 1st to the N-1th portions b1,..., b m of the second input b N-2 , the intermediate sum s N-1 , and the carry-ins c1,..., c N-1 and sum them.

[0072] The second summing logic module 110 includes a 1st adder 1101, a 2nd adder 1102,..., an N-1th adder 110 N-1 . Each of the 1st adder 1101, the 2nd adder 1102,..., the N-1th adder 110 N-1 of the second summing logic module 110 is coupled to a corresponding one of the first register module 102 and a corresponding one of the second register module 104. For example, the jth adder 110 jThe jth cell 102 of the first register module 102 is coupled to the (j-1)th cell 102 of the first register module 102 and the (j+1)th cell 102 of the first register module 102. j The jth cell 104 of the second register module 104 is coupled to the (j-1)th cell 104 of the second register module 104 and the (j+1)th cell 104 of the second register module 104. j The jth cell 102 of the first register module 102 is coupled to the (j-1)th cell 102 of the first register module 102 and the (j+1)th cell 102 of the first register module 102. j The jth cell 104 of the second register module 104 is coupled to the (j-1)th cell 104 of the second register module 104 and the (j+1)th cell 104 of the second register module 104. j (j = 1, …, N-1).

[0073] The first adder 1101 of the second summation logic module 110 is configured to sum the first part a1 of the first input a and the first part b1 of the second input b, thereby generating the first sum s1. The (N-1)th adder 110 N-1 The (N-1)th adder 110 N-1 of the second summation logic module 110 is further coupled to the third register module 106 and the fourth register module 108, and is configured to sum the (N-1)th part a N-1 of the first input a, the (N-1)th part b m of the second input b, the intermediate sum s N-2 and the (N-2)th carry c N-2 of the carries c1, …, c N-1 , thereby generating the (N-1)th sum s k In the case where N is an integer greater than 3, the kth adder 110 k of the second summation logic module 110 is further coupled to the third register module 106, thereby receiving the (k-1)th carry c N-2 of the carries c1, …, c k-1 (k = 2, …, N-2). The kth adder 110 k is configured to sum the kth part a k of the first input a, the kth part b k of the second input b, and the (k-1)th carry c k-1 , thereby generating the kth sum s k The N-1 sums s1, s2, …, s N-1 outputted by the first to (N-1)th adders of the second summation logic module 110 represent the partial bits of the output s in sequence from low to high (i.e., s = [s N-1 , s N-2 , …, s1]).

[0074] In fact, the jth adder 110 j (j = 1, …, N-1) generates a carry c j in addition to the sum s j when summing the jth part a j of the first input a and the jth part b j of the second input b, and this carry c j needs to be provided to the (j+1)th adder 110j+1 Only then can it correctly obtain the (j+1)th part a of the first input a. j+1 The (j+1)th part of the second input b j+1 The sum of s j+1 However, carry signals often have many glitches. If we let the j-th adder be 110... j Carry c j Output to the (j+1)th adder 110 j+1 This will lead to carry c j The glitch propagates to the (j+1)th adder 110 j+1 This results in increased power consumption. In contrast, in the adder circuit taught in this disclosure, such as... Figure 2 As shown, carry c1, ..., c N-2 The carry logic module 112 calculates the value in advance and stores it in the third register module 106. The second adder 1102 to the (N-1)th adder 110 of the second summation logic module 110. N-1 The inputs all come from registers, thus enabling glitch reduction or even elimination (e.g., by fine-tuning the register clock or register drive). The second adder 1102 to the (N-1)th adder 110 of the second summing logic module 110. N-1 All have ample setup time spanning a full cycle with minimal glitches, resulting in reduced power consumption. Furthermore, the first adder 1101 of the second summing logic module 110 and the adders of the first summing logic module 114 themselves do not have carry-over from lower bits, thus exhibiting smaller glitches and lower power consumption. In the adder circuit 100, the first adder 1101 to the (N-1)th adder 110 of the second summing logic module 110... N-1 All carry-in bits generated can be discarded, and the resulting sum is directly the corresponding bits of the sum s.

[0075] Therefore, with Figure 1 In contrast, adder circuit 100 separates the summation logic circuit of the adder into a first part (e.g., first summation logic module 114) for processing the most significant bit (MSB) and a second part (e.g., second summation logic module 110) primarily for processing the least significant bit (LSB). Furthermore, it separates the carry logic circuit and the second part of the summation logic circuit. The carry logic and the first part of the summation logic can be performed in one clock cycle, with the calculated carry and the sum of the MSB stored in registers respectively. The second part of the summation logic can be performed in the next clock cycle based on input from the registers. This reduces the glitches from the carry logic circuit to the summation logic circuit. Additionally, the summation logic circuit of adder circuit 100 further breaks down a large-scale adder into N smaller-scale adders. The total area of ​​the adders in the first summation logic module 114 and the second summation logic module 110 can be less than [a certain value].Figure 1 The area of the adders of the summation module 12 is thus reduced, and a reduced power consumption can be achieved. The N-1 adders among the N smaller scale adders that are located in the second part of the summation logic circuit (e.g., the 1st adder 1101 to the N-1 adder 110 N-1 ) can be parallel, and a reduced delay and an increased processing speed can be achieved.

[0076] Taking the example that the first number a and the second number b each include 32 bits and are split into three parts (16 bits + 8 bits + 8 bits), the summation module 12 of the operation circuit 10 needs a 32-bit adder, while the second summation logic module 110 of the adder circuit 100 only needs 2 16-bit adders and the first summation logic module 114 only needs 1 8-bit adder. Generally speaking, the area of a 32-bit adder can be equivalent to the area of three 16-bit adders, and the area of a 16-bit adder can be equivalent to the area of three 8-bit adders. In addition, a carry lookahead adder (CLA) is often needed to implement a 32-bit adder with a smaller delay, but the CLA often consumes a lot of chip area. A ripple carry adder (RCA) has a much smaller area than the CLA and is comparable to a full adder (FAA), but the delay stage of a 32-bit ripple carry adder is as high as 32 stages, and the speed is too slow. However, in the adder circuit taught in the present disclosure, the 32-bit adder can be split into 2 parallel 16-bit adders and 1 8-bit adder in series before the 16-bit adders, and these parallel smaller scale adders in the second summation logic module 110 can be implemented as RCAs, so that both the speed close to the CLA and the fewer glitches, smaller area and lower power consumption can be achieved. In addition, for example, when the adder circuit 100 is applied in a pipeline structure (e.g., as described later with respect to Figures 21-25 the first part of the summation logic of each beat can be parallel with the second part of the summation logic of the last beat, and thus the smaller scale adders in the first summation logic module can also be implemented as RCAs, so that both the speed close to the CLA and the fewer glitches, smaller area and lower power consumption can be achieved.

[0077] Each of the first through fourth register modules 102-108 can, for example, be implemented as a combination of single-bit registers. The number of single-bit registers included in each register module can depend on the number of bits that the register module is to store. In some examples, each of the first to N-2 portions of each of the first input a and the second input b has a first bit, and the N-1 to N portions of that input have a total of a second bit. For example, the second bit can be equal to the first bit. This can allow the adder circuit 100' to have a smaller computational delay in some cases, such as when it is applied in a pipelined structure (e.g., as will be discussed later). Figures 21-25 (As described). In some examples, the second digit may also be greater than or less than the first digit. In some embodiments, each of the first input a and the second input b is partitioned such that the difference between the first digit and the second digit is minimized.

[0078] For example, if the total number of bits in each input from the (N-1)th part to the Nth part remains unchanged, increasing the Nth part by one bit reduces the (N-1)th part by one bit, thus affecting the (N-1)th unit 102 of the first register module 102. N-1 The (N-1)th unit 104 of the second register module 104 N-1 Each part uses one less single-bit register, while the fourth register module 108 uses one more single-bit register, thus reducing the overall number of single-bit registers by one. On the other hand, adding one bit to the Nth part also means that the first summing logic module 114, which is implemented as RCA, adds one level of delay.

[0079] In some examples, the number of bits in the (N-1)th part of each of the first inputs a and the second input b is equal to the number of bits in the Nth part of that input. Depending on the specific requirements, the number of bits in the (N-1)th part of each of the first inputs a and the second input b may also be greater than or less than the number of bits in the Nth part of that input. In some examples, the number of bits in the (N-1)th part of each of the first inputs a and the second input b is less than the number of bits in each of the first to N-2 parts of that input. In some examples, two or more parts of each of the first inputs a and the second input b may have the same or different numbers of bits.

[0080] Figure 3 The carry logic module 112 of an adder circuit 100 according to some embodiments of the present disclosure is shown. For example... Figure 3 As shown, the carry logic module 112 may include a preprocessor 1122 and a carry generator 1124. The preprocessor 1122 may be configured to process the first to N-2 portions [a] of the first input a in parallel. N-2 Each bit of [, …, a1] and the first to N-2 parts of the second input b [bN-2 The corresponding bits of [b1, ..., b1] are XORed and ANDed respectively to generate the corresponding Propogate Signal p and Generate Signal g. The carry generator 1124 can be configured to use the Propogate Signal p and Generate Signal g generated by the preprocessor 1122 to generate carry c1, ..., c2. N-2 .

[0081] In some embodiments, the carry logic module 112 can be designed based on the construction of a carry-lookahead adder (CLA) or a parallel prefix adder (PPA). For example, refer to... Figures 4A-4C , Figure 4A and Figure 4B Example constructions of a carry-lookahead adder (CLA) and a parallel prefix adder (PPA) are shown respectively. Figures 4A-4C In this context, M represents the number of bits input to the adder. Figures 4A-4C In the example, assume that the bits of the M-bit number a are represented from least significant bit to most significant bit as A1, A2, ..., A... M-1 A M Furthermore, the bits of the M-bit number b are represented sequentially from least significant bit to most significant bit as B1, B2, ..., B... M-1 B M Furthermore, the bits of the transmitted signal p are represented sequentially from least significant bit to most significant bit as P1, P2, ..., P... M-1 P M Furthermore, the bits of the generated signal g are represented sequentially from least significant bit to most significant bit as G1, G2, ..., G... M-1 G M .like Figure 4A As shown, P v =A v ⊕B v G v =A v ·B v v = 1, 2, ..., M, where ⊕ represents the XOR operation and · represents the AND operation. For example, the carry chain of the CLA (C in The carry input is equal to the initial carry C0, C out Output the carry and it equals the final carry C. M C1 to C M-1 (for carry-over) and the formula can be calculated as follows:

[0082] C0=G0=C in ;

[0083] C1=G1+P 1· C0;

[0084] C2= G2+P2·C1= G2+P2·(G1+P1·C0)= G2+P2·G1+P2·P1·C0;

[0085] ...

[0086] C M = G M +P M ·C M-1 =……;

[0087] S v =P v ⊕C v-1 v = 1, 2, ..., M.

[0088] To reduce the depth of the AND gate, PPA further optimizes CLA. The computational flow of PPA and CLA is largely the same, except that in calculating C... v Sufficient parallel optimization was performed. Currently, several PPA variants exist, whose main design approach is to achieve a balance in terms of adder range, circuit depth, number of node outputs, and overall routing. For example, ... Figure 4B As shown, it is comparable to Figure 4A The CLA shown implements the carry generator as a parallel prefix network. Figure 4C Three parallel prefix networks are illustrated exemplarily in the case of M=16. For a detailed discussion of PPA and parallel prefix networks, see Milad Bahadori et al.'s article entitled "A comparative study on performance and reliability of 32-bit binary adders" (https: / / doi.org / 10.1016 / j.vlsi.2015.12.002), published in Integration, Vol. 53, pp. 54-67, March 2016, which is incorporated herein by reference in its entirety.

[0089] Since the carry logic module 112 does not need to obtain the carry at each bit position, nor the sum at each bit position, it can have simplified carry logic compared to CLA and PPA, and does not require a post-processor. For example, Figure 5 Taking the first number 'a' and the second number 'b' as examples, each consisting of 32 bits and divided into three 8-bit parts and two 4-bit parts (where the carry logic module 112 calculates three carrys c1, c2, and c3), the carry logic module 112 modified based on PPA is shown. Carry input C inmay be set to 0. The 1st part al=[A8, A7,..., Al], the 2nd part a2=[A 16 , A 15 ,..., A9] and the 3rd part a3=[A 24 , A 23 ,..., A 17 ] of the 1st number a and the 1st part bl=[B8, B7,..., B1], the 2nd part b2=[B 16 , B 15 ,..., B9] and the 3rd part b3=[B 24 , B 23 ,..., B 17 ] of the 2nd number b are inputted to the preprocessor 1122 of the carry logic module 112, while the 4th part a4=[A 28 , A 27 , A 26 , A 25 ] and the 5th part a5=[A 32 , A 31 , A 30 , A 29 ] of the 1st number a and the 4th part b4=[B 28 , B 27 , B 26 , B 25 ] and the 5th part b5=[B 32 , B 31 , B 30 , B 29 ] of the 2nd number b can not be inputted to the carry logic module 112 for processing. Thus, Figure 5 , the preprocessor 1122 of the carry logic module 112 can reduce 8 XOR gates and 8 AND gates compared to the preprocessor of the PPA as shown in Figure 4B . In other words, instead of constructing the carry logic module 112 based on a 32-bit PPA, the carry logic module 112 can be constructed based on a 24-bit PPA. In addition, the carry generator 1124 can obtain the intermediate carries C8 (as the 1st carry cl), C 16 (as the 2nd carry c2) and C 24 (as the 3rd carry c3) using the parallel prefix network in a jump manner without obtaining C1 to C7, C9 to C 15 , C 17 to C 23 , C 25 to C 32 and further obtaining S1 to S 32 .

[0090] Figure 6A first summing logic module 114 and a second summing logic module 110 of an adder circuit 100 according to some embodiments of the present disclosure are shown. Figure 6 continue Figure 5 For example, the first adder 1101 to the fourth adder 1104 of the second summing logic module 110 are implemented as four parallel 8-bit RCAs, and the adder of the first summing logic module 114 is implemented as a 4-bit RCA serially preceding the fourth adder 1104. The RCA can be implemented as a cascaded combination including a full adder FAA and / or a half adder (HA) HA.

[0091] like Figure 6 As shown, the first adder 1101 of the second summation logic module 110 includes a cascaded combination of a half adder HA and seven full adders FAA. Each stage of this cascaded combination receives a corresponding bit of the first part a1 = [A8, A7, …, A1] of a first number a and a corresponding bit of the first part b1 = [B8, B7, …, B1] of a second number b, and outputs the corresponding bit of the sum s1 = [S8, S7, …, S1] of the first part a1 of the first number a and the first part b1 of the second number b. Alternatively, the half adder HA can also be implemented as FAA, where the carry input of the FAA can be set to 0. The carry (e.g., C) output by each stage of this cascaded combination except the last stage is... v (v=1,2,……,7)) is input into the next level, and the carry C8 of the last level output of this cascade combination can be discarded.

[0092] The second adder 1102 of the second summing logic module 110 includes a cascaded combination of eight full adders FAA. Each stage of this cascaded combination receives the second part a2 of the first number a = [A...]. 16 A 15 The corresponding digit of [A9] and the second part of the second number b, b2 = [B 16 B 15 Output the corresponding bit of [, …, B9] and output the sum of the second part a2 of the first number a and the second part b2 of the second number b, s2=[S 16 , S 15 The corresponding bit of [, …, S9]. The first stage of this cascade combination also receives C8, which is calculated in advance by the carry logic module 112 as the first carry c1. The carry (e.g., C) output by each stage of this cascade combination except the last stage is also included. v (v=9,10,...,15) is input into the next stage, and the carry C of the last stage output of this cascade combination is... 16 It can be discarded.

[0093] The 3rd adder 1103 of the 2nd summation logic module 110 includes a cascaded combination of 8 full adders FAA. Each stage of the cascaded combination receives a respective bit of the 3rd portion a3=[A 24 , A 23 , …, A 17 ] of the 1st number a and a respective bit of the 3rd portion b3=[B 24 , B 23 , …, B 17 ] of the 2nd number b, and outputs a respective bit of the sum s3=[S 24 , S 23 , …, S 17 ] of the 3rd portion a3 of the 1st number a and the 3rd portion b3 of the 2nd number b. The first stage of the cascaded combination also receives C 16 , which is calculated by the carry logic module 112 as the 2nd carry c2 in advance. The carry output (e.g., C v (v=17, 18, …, 23)) of each stage of the cascaded combination except the last stage is input into the next stage, and the carry output C 24 of the last stage of the cascaded combination can be discarded.

[0094] The 1st summation logic module 114 includes a cascaded combination of one half adder HA and 3 full adders FAA. Each stage of the cascaded combination receives a respective bit of the 5th portion a5=[A 32 , A 31 , A 30 , A 29 ] of the 1st number a and a respective bit of the 5th portion b5=[B 32 , B 31 , B 30 , B 29 ] of the 2nd number b, and outputs a respective bit of the intermediate sum s m =[Sm 32 , Sm 31 , Sm 30 , Sm 29 ] of the 5th portion a5 of the 1st number a and the 5th portion b5 of the 2nd number b. Alternatively, the half adder HA can also be implemented as a FAA, where the carry input of the FAA can be set to 0. The carry output (e.g., C v (v=29, 30, 31)) of each stage of the cascaded combination except the last stage is input into the next stage, and the carry output C 32 of the last stage of the cascaded combination can be discarded.

[0095] The 4th adder 1104 of the second summation logic module 110 includes a first cascade combination of 4 full adders FAA and a second cascade combination of 4 half adders HA. The first cascade combination is in series before the second cascade combination. Each stage of the first cascade combination receives a respective one bit of the 4th portion a4 = [A 28 , A 27 , A 26 , A 25 ] of the first number a and a respective one bit of the 4th portion b4 = [B 28 , B 27 , B 26 , B 25 ] of the second number b, and outputs a respective one bit of the sum [S 28 , S 27 , S 26 , S 25 ] of the 4th portion a4 of the first number a and the 4th portion b4 of the second number b. The first stage of the first cascade combination also receives C 24 as the 3rd carry c3 calculated by the carry logic module 112 in advance. The carry (e.g., C v (v = 25, 26, 27)) output by each stage of the first cascade combination except the last stage is input to the next stage, and the carry C 28 output by the last stage of the first cascade combination can be input to the first stage of the second cascade combination. Each stage of the second cascade combination receives a respective one bit of the intermediate sum s m = [Sm 32 , Sm 31 , Sm 30 , Sm 29 ], and outputs a respective one bit of the sum [S 32 , S 31 , S 30 , S 29 ] of the 5th portion a5 of the first number a and the 5th portion b5 of the second number b. The first stage of the second cascade combination also receives C 28 from the first cascade combination. The carry output by each stage of the second cascade combination except the last stage is input to the next stage, and the carry output by the last stage of the second cascade combination can be discarded. Alternatively, each of one or more half adders HA in the second cascade combination can also be implemented as a FAA, where the carry input of the FAA can be set to 0.

[0096] Thus, the second summation logic module 110 can directly output a 32-bit sum s = [S 32 , S 31 , …, S1] of the 32-bit first number a and the 32-bit second number b.

[0097] Figure 7 This is a schematic diagram of an adder circuit 100' according to other embodiments of the present disclosure. The difference between adder circuit 100' and adder circuit 100 is that the carry logic module 112' of adder circuit 100' further calculates the (N-1)th part a of the first input a. N-1 With the (N-1)th part of the second input b N-1 The carry generated by the addition corresponds to the (N-1)th carry c. N-1 Furthermore, the second summing logic module 110' further includes an Nth adder. The differences between the adder circuit 100' and the adder circuit 100 will be described below, while their similarities will not be repeated and can be referred to the preceding description.

[0098] For example, adder circuit 100' is configured to calculate the sum of a first number a and a second number b. Adder circuit 100' may have a first input representing the first number a and a second input representing the second number b, and an output representing the sum s of the first number a and the second number b. Each of the first input a and the second input b is correspondingly divided into parts 1 to N (N is an integer greater than 1), which represent the portion bits of the input sequentially from the least significant bit to the most significant bit. For example, the first input a includes part 1 a1, part 2 a2, ..., part N-1 a1. N-1 Part N a N (i.e., a=[a N , a N-1 The second input b includes part 1 b1, part 2 b2, ..., part N-1 b1. N-1 Part Nb N (That is, b = [b N ,b N-1 The value of N can be determined according to specific needs, for example, it can be 2, 3, 4, 5, 6, 7, 8, etc.

[0099] like Figure 7 As shown, the adder circuit 100' includes a first register module 102, a second register module 104, a third register module 106, a fourth register module 108, a carry logic module 112', a first summation logic module 114, and a second summation logic module 110'.

[0100] The first register module 102 is configured to store the first to N-1th portions of the first input a. The second register module 104 is configured to store the first to N-1th portions of the second input b. As previously described, the first register module 102 may have N-1 units, and the j-th unit 102 of the first register module 102... j Configured to store the j-th part a of the first input a jand the second register module 104 can have N-1 units and the jth unit 104 j is configured to store the jth portion b j of the second input b (j = 1,..., N-1).

[0101] The carry logic module 112' is configured to compute N-1 carries ci,..., c N-1 Each of the carries ci,..., c N-1 has 1 bit. The ith carry ci,..., c N-1 of the carries ci,..., c i corresponds to the addition of the ith portion a i of the first input a and the ith portion b i of the second input b (i = 1,..., N-1). For example, the carry logic module 112' can receive at least the 1st through N-1th portions a1,..., a N-1 of the first input a and the 1st through N-1th portions b1,..., b N-1 of the second input b and then compute these N-1 carries ci,..., c N-1 using look-ahead carry logic. In this way, the carry logic module 112' does not need to sum its received inputs bit by bit, but rather can quickly jump to the carry at the desired bit. An exemplary implementation of the carry logic module 112' can be similar to the exemplary implementation of the carry logic module 112.

[0102] The third register module 106 can be coupled to the carry logic module 112' and configured to store the N-1 carries ci,..., c N-1 .

[0103] The first sum logic module 114 and the second sum logic module 110' are configured to cooperate to compute the sum s of the first number a and the second number b. For example, the first sum logic module 114 can include an adder configured to sum the Nth portion a N of the first input a and the Nth portion b N of the second input b, thereby producing an intermediate sum s m . The fourth register module 108 is coupled to the first sum logic module 114 and configured to store the intermediate sum s m .

[0104] The second sum logic module 110' is coupled to the first through fourth register modules 102-108 to receive the 1st through N-1th portions a1,..., a N-1 of the first input a, the 1st through N-1th portions b1,..., b N-1 of the second input b, the intermediate sum s mand carry c1, ..., c N-1 And sum them.

[0105] The second summation logic module 110' includes a first adder 1101, a second adder 1102, ..., an Nth adder 110. N For example, the j-th adder 110 of the second summation logic module 110' j Unit j 102 coupled to the first register module 102 j The j-th unit 104 of the second register module 104 j Thus, it can receive the j-th part a of the first input a. j The j-th part of the second input b j (j=1,…,N-1).

[0106] The first adder 1101 of the second summing logic module 110' is configured to sum the first part a1 of the first input a and the first part b1 of the second input b, thereby producing the first sum s1. N It is also coupled to the third register module 106 and the fourth register module 108, and is configured to handle intermediate and data s m With carry c1, ..., c N-1 The (N-1)th carry c N-1 Summing, thus producing the Nth sum s N When N is an integer greater than 2, the k-th adder 110' of the second summing logic module 110' k It is also coupled to the third register module 106, so that it can receive carry c1, ..., c N-1 The (k-1)th carry c k-1 (k=2, ..., N-1). The k-th adder 110 k Configured to the k-th part a of the first input a k The k-th part of the second input b k With carry c of the (k-1)th position k-1 Summing, thus producing the k-th sum s k The second summation logic module 110' outputs N sums s1, s2, ..., s... N The bits from least significant to most significant represent the partial bits of the output s (i.e., s = [s...]). N , s N-1 , …, s1]).

[0107] like Figure 7 As shown, carry c1, ..., c N-1calculated by the carry logic module 112' and stored in the third register module 106 in advance. The inputs of the 2nd adder 1102 to the Nth adder 110 N of the second summation logic module 110' are from registers, so that glitch reduction or even elimination can be achieved (e.g., by fine tuning the register clock or register driving). The 2nd adder 1102 to the Nth adder 110 N of the second summation logic module 110' have a long set-up time of up to one entire cycle, and have small glitches, so that power consumption is reduced. In addition, the 1st adder 1101 of the second summation logic module 110' and the adders of the first summation logic module 114 themselves do not have carry-in from lower bits, so that they have small glitches and low power consumption. In the adder circuit 100', the carries generated by the 1st adder 1101 to the Nth adder 110 N of the second summation logic module 110' can be discarded, and the sums generated by them are directly the corresponding partial bits of the sum s.

[0108] Thus, compared with Figure 1 , the adder circuit 100' separates the summation logic circuit of the adder into a first part (e.g., the first summation logic module 114) for processing high bits (MSB) and a second part (e.g., the second summation logic module 110') mainly for processing low bits (LSB), and further separates the carry logic circuit of the adder and the second part of the summation logic circuit, wherein the carry logic and the first part of the summation logic can be performed in a certain cycle and the calculated carry and the sum of the MSB are respectively stored in registers, and the second part of the summation logic can be performed in the next cycle based on the inputs from the registers, so that the glitch effect from the carry logic circuit to the summation logic circuit is reduced. In addition, the summation logic circuit of the adder circuit 100' also splits a large-scale adder into N+1 small-scale adders. The total area of the adders of the first summation logic module 114 and the second summation logic module 110' can be smaller than the area of the adder of the summation module 12 of Figure 1 , so that reduced power consumption can be achieved. The N adders (e.g., the 1st adder 1101 to the Nth adder 110 N of the second summation logic module 110') in the second part of the summation logic circuit can be performed in parallel, so that reduced delay and improved processing speed can be achieved.

[0109] Taking the example of the first number a and the second number b each comprising 32 bits and being split into four parts (8 bits + 8 bits + 8 bits + 8 bits), the summation module 12 of the arithmetic circuit 10 requires a 32-bit adder, while the summation logic module of the adder circuit 100 only requires 4 8-bit adders (in the second part of the summation logic circuit) and 1 8-bit adder (in the first part of the summation logic circuit). In the adder circuit taught in the present disclosure, the 32-bit adder can be split into 4 8-bit adders in parallel and 1 8-bit adder in series before the 8-bit adders, and the smaller scale adders in parallel in the second part of the summation logic can be implemented as RCAs, so as to achieve a speed close to CLA, while having less glitch, smaller area and lower power consumption. Moreover, for example when the adder circuit 100’ is applied in a pipelined structure (e.g., as described later with respect to Figures 21-25 the first part of the summation logic of each tick can be in parallel with the second part of the summation logic of the previous tick, so the smaller scale adders in the first part of the summation logic can also be implemented as RCAs, so as to achieve a speed close to CLA, while having less glitch, smaller area and lower power consumption.

[0110] In some examples, each part of each of the first input a and the second input b has the same number of bits. This can result in the adder circuit 100’ having a smaller computation latency in some cases, for example when applied in a pipelined structure (e.g., as described later with respect to Figures 21-25 In some examples, each of the first input a and the second input b is divided such that the difference in the number of bits between each of its parts is as small as possible. In some examples, two or more parts of each of the first input a and the second input b can also have different numbers of bits.

[0111] Figure 8 A carry logic module 112’ of the adder circuit 100’ according to some embodiments of the present disclosure is shown. As Figure 8 shown, the carry logic module 112’ can include a pre-processor 1122’ and a carry generator 1124’. The pre-processor 1122’ can be configured to perform an XOR operation and an AND operation on each bit of the first 1 to N-1 parts of the first input a [a N-1 , …, a1] and the corresponding bits of the second 1 to N-1 parts of the second input b [b N-1 , …, b1] in parallel, respectively, to generate a corresponding pass signal p and a generate signal g. The carry generator 1124’ can be configured to generate the carries c1, …, c N-1 using the pass signal p and the generate signal g generated by the pre-processor 1122’.

[0112] In some embodiments, the carry logic module 112' can be designed based on the construction of a carry-lookahead adder (CLA) or a parallel prefix adder (PPA). Since the carry logic module 112' does not need to obtain the carry at each bit, nor the sum at each bit, it can have simplified carry logic compared to CLA and PPA, and requires no post-processor. For example, Figure 9 Taking the first number 'a' and the second number 'b' as examples, each consisting of 32 bits and divided into three 8-bit parts and two 4-bit parts (where the carry logic module 112' calculates four carries c1, c2, c3, and c4), the carry logic module 112' derived from the PPA modification is shown. Carry input C in It can be set to 0. The first part of the first number 'a', a1 = [A8, A7, …, A1], and the second part, a2 = [A…]. 16 A 15 , …, A9]、Part 3 a3=[A 24 A 23 , …, A 17 ] and part 4 a4=[A 28 A 27 A 26 A 25 ] and the first part of the second number b, b1=[B8, B7, …, B1], and the second part, b2=[B 16 B 15 , …, B9]、Part 3 b3=[B 24 B 23 , …, B 17 ] and part 4 b4=[B 28 B 27 B 26 B 25 The first number a is input to the preprocessor 1122' of the carry logic module 112', and the fifth part a5 of the first number a = [A 32 A 31 A 30 A 29 ] and the 5th part of the second number b, b5 = [B 32 B 31 B 30 B 29 This can be processed without inputting into the carry logic module 112'. Therefore, Figure 9 The preprocessor 1122' in the example is compared to... Figure 4BThe pre-processor of the PPA shown can reduce 4 XOR gates and 4 AND gates. In other words, instead of constructing the carry logic module 112' based on a 32-bit PPA, the carry logic module 112' can be constructed based on a 28-bit PPA. In addition, the carry generator 1124' can obtain the intermediate carries C8(as the 1st carry cl), C 16 (as the 2nd carry c2), C 24 (as the 3rd carry c3), and C 28 (as the 4th carry c4) in a single step of the parallel prefix network, without obtaining C1to C7, C9to C 15 , C 17 to C 23 , C 25 to C 27 , C 29 to C 32 , and S1to S 32 .

[0113] Figure 10 The first sum logic module 114 and the second sum logic module 110' of the adder circuit 100' according to some embodiments of the present disclosure are shown. Figure 10 Continuing Figure 9 the example, the 1st to 5th adders 1101 to 1105 of the second sum logic module 110' are implemented as 3 parallel 8-bit RCAs and 2 parallel 4-bit RCAs, and the adder of the first sum logic module 114 is implemented as a 4-bit RCA serially preceding the 5th adder 1105. The RCAs can be implemented as cascaded combinations of full adders FAA and / or half adders HA. As shown, the configuration of the first sum logic module 114 and the 1st to 3rd adders 1101 to 1103 is similar to that in Figure 10 , which is not repeated here. Figure 6

[0114] The 4th adder 1104 of the second sum logic module 110' includes a cascaded combination of 4 full adders FAA. Each stage of the cascaded combination receives a respective one bit of the 4th portion a4= [A 28 , A 27 , A 26 , A 25 ] of the first number a and a respective one bit of the 4th portion b4= [B 28 , B 27 , B 26 , B 25 ] of the second number b, and outputs the sum [S 28 , S 27 , S 26 , S 25 ​The corresponding bit of ] is also received by the first stage of this cascaded combination, which is calculated in advance by the carry logic module 112' as the third carry c3. 24 The carry-in (e.g., C) of the output of each stage in this cascade combination except the last stage. v (v=25, 26, 27) is input into the next stage, and the carry C of the last stage output of this cascade combination is... 28 It can be discarded.

[0115] The fifth adder 1105 of the second summing logic module 110' comprises a cascaded combination of four half-adders HA. Each stage of this cascaded combination receives an intermediate sum s. m =[Sm 32 , Sm 31 , Sm 30 , Sm 29 Output the corresponding digit of the first number a, and output the sum of the 5th part a5 of the first number a and the 5th part b5 of the second number b. 32 , S 31 , S 30 , S 29 The corresponding bit of ] . The first stage in this cascade combination also receives C, which is calculated in advance by the carry logic module 112' as the 4th carry c4. 28 The carry-in of the output of each stage of the cascade combination, except for the last stage, is fed into the next stage, and the carry-in of the output of the last stage of the cascade combination can be discarded. Alternatively, each of one or more half-adders HA in the cascade combination can also be implemented as FAA, where the carry-in of the FAA can be set to 0.

[0116] Therefore, the second summation logic module 110' can directly output the 32-bit sum s=[S] of the first 32-bit number a and the second 32-bit number b. 32 , S 31 , …, S1).

[0117] Figure 11 An operational circuit 200 according to some embodiments of the present disclosure is shown. For example... Figure 11 As shown, the arithmetic circuit 200 includes a summing module 220 and a first arithmetic module 210 coupled to the summing module 220. The summing module 220 may include the addition circuits 100 and 100' described in any of the foregoing embodiments. The first arithmetic module 210 may provide a first input and a second input to the addition circuits 100 and 100'. Figures 12-14 They are shown respectively Figure 11 Several non-limiting example configurations of the operational circuit 200 are shown. Figures 12-14 In the example shown, the addition circuit included in the summation module 220 is depicted as follows: Figure 2The illustrated add circuit 100, however, is for illustrative purposes only and is not intended to be limiting.

[0118] In some examples, the arithmetic circuit 200 includes a plurality of arithmetic stages. For example, the arithmetic stages can be arranged in a pipelined structure. Each arithmetic stage can include a respective register module.

[0119] As Figure 12 illustrated, the plurality of arithmetic stages of the arithmetic circuit 200 includes a first arithmetic stage 230a and a second arithmetic stage 230b that is immediately subsequent to the first arithmetic stage 230a. The first arithmetic stage 230a includes a first respective register module 232a. The second arithmetic stage 230b includes a second respective register module 232b and also includes the first through fourth register modules 102-108 of the add circuit of the summation module 220. A first arithmetic module 210 is arranged between the first arithmetic stage 230a and the second arithmetic stage 230b and is coupled to the first respective register module 232a of the first arithmetic stage 230a. For example, the first arithmetic module 210 can be configured to operate on data from the first respective register module 232a to produce the first input and the second input of the add circuit of the summation module 220. In addition, the carry logic module 112 and the first summation logic module 114 of the add circuit of the summation module 220 can also be arranged between the first arithmetic stage 230a and the second arithmetic stage 230b.

[0120] As Figure 13 illustrated, in some examples, the plurality of arithmetic stages of the arithmetic circuit 200 also includes a third arithmetic stage 230c that is immediately subsequent to the second arithmetic stage 230b. The third arithmetic stage 230c includes a third respective register module 232c. The third respective register module 232c of the third arithmetic stage 230c can be coupled to the summation module 220 to receive the output of the add circuit thereof. For example, the second summation logic module 110 of the add circuit of the summation module 220 can be arranged between the second arithmetic stage 230b and the third arithmetic stage 230c.

[0121] As Figure 14 illustrated, in some examples, the arithmetic circuit 200 also includes a second arithmetic module 240 arranged between the second arithmetic stage 230b and the third arithmetic stage 230c. The second arithmetic module 240 can be coupled to the second respective register module 232b of the second arithmetic stage 230b and configured to operate on data from the second respective register module 232b. For example, the second arithmetic module 240 can have the same configuration as the first arithmetic module 210.

[0122] In some examples, the arithmetic circuit 200 can further include another summation module 220', which can have the same configuration as the summation module 220. In such examples, the third arithmetic stage 230c can further include the first to fourth register modules 102-108 of the summation module 220'. The second arithmetic module 240 can be coupled to the summation module 220' to provide the first and second inputs of the summation module 220'. The second arithmetic module 240 can be configured to operate on data from the second respective register module 232b, thereby generating the first and second inputs of the summation module 220'. The carry logic module 112 and the first summation logic module 114 of the summation module 220' can also be arranged between the second arithmetic stage 230b and the third arithmetic stage 230c.

[0123] Although not shown, the first arithmetic stage 230a can also include the first to fourth register modules of the summation module's adder circuit, and the second summation logic module of the summation module's adder circuit can also be arranged between the first arithmetic stage 230a and the second arithmetic stage 230b. That is, the internal of each arithmetic stage of the arithmetic circuit 200 and between adjacent arithmetic stages can have the same configuration.

[0124] For more clarity and intuition, the SHA-256 algorithm will be briefly introduced in the following and taken as an example of a hash algorithm to describe the circuit for performing a hash algorithm according to embodiments of the present disclosure. It will be appreciated by those skilled in the art that the circuit for performing a hash algorithm according to embodiments of the present disclosure is applicable to any hash algorithm, and can even be further applied to any other suitable circuit, not limited to SHA-2 series algorithms such as SHA-256 algorithm.

[0125] Figure 15 A schematic diagram of an exemplary pipeline structure for performing the SHA-256 algorithm is shown. The input of SHA-256 is data with a maximum length of less than 2 64 bits, and the output is a data digest of 256 bits, i.e. a hash value. The input data is processed in units of data blocks of 512 bits. In order to implement the SHA-256 algorithm, 64 rounds of repeated operations need to be performed for each data block of 512 bits, so a pipeline structure including 64 arithmetic stages can be used to operate 64 groups of data in parallel. As shown in Figure 15 the pipeline structure includes the 0th arithmetic stage to the 63rd arithmetic stage, each of which includes eight 32-bit compression register modules A to H for storing intermediate values and sixteen 32-bit expansion register modules R0 to R 15The 0th operation stage receives the input data block, divides it into eight 32-bit data segments, stores them in compression register modules A through H, processes them, and then provides the results to the 1st operation stage. Afterward, each operation stage processes the results received from the previous stage and provides its own result to the next stage. Finally, after 64 operation stages, this pipeline structure outputs the hash result of the input data having undergone one SHA-256 algorithm operation.

[0126] The internal logic of a round of operations performed by SHA-256 at each operational level is discussed in detail below. The t-th round of operations performed at the t-th operational level is defined by the following formula (t is an integer and satisfies 0 ≤ t ≤ 63):

[0127] T1 = H + Σ1(E) + Ch(E, F, G) + K t + W t ;

[0128] T2 = Σ0(A) + Maj(A, B, C);

[0129] H = G;

[0130] G = F;

[0131] F = E;

[0132] E = D + T1;

[0133] D = C;

[0134] C = B;

[0135] B = A;

[0136] A = T1 + T2; (Equation 1)

[0137] in:

[0138] Ch(x, y, z)=(x AND y) ⊕ ((NOT x) AND z)

[0139] Maj(x, y, z)= (x AND y) ⊕ (x AND z) ⊕ (y AND z)

[0140] Σ0(x)=ROTR 2 (x) ⊕ ROTR 13 (x) ⊕ ROTR 22 (x)

[0141] Σ1(x)=ROTR 6(x) ⊕ ROTR 11 (x) ⊕ ROTR 25 (x)

[0142] where ROTR n (x) means rotate right n bits of the 32-bit variable x; W t is a 32-bit word derived from the current 256-bit block of input data; K t is a 32-bit additional constant; + is modulo 2 32 addition; AND is a 32-bit bitwise AND operation; NOT is a one's complement operation; and

[0143] The 32-bit word W t is derived from a 512-bit block of data as follows. W t may be derived as follows:

[0144] For 0 < t < 15: W t is taken directly from the input data block;

[0145] For 16 < t < 63:

[0146] W t = σ1(W t-2 ) + W t-7 + σ0(W t-15 ) + W t-16 ( Equation 2 )

[0147] where:

[0148] σ0(x) = ROTR 7 (x) ⊕ ROTR 18 (x) ⊕ SHR 3 (x)

[0149] σ1(x) = ROTR 17 (x) ⊕ ROTR 19 (x) ⊕ SHR 10 (x)

[0150] where ROTR n (x) means rotate right n bits of the 32-bit variable x; SHR n (x) means shift right n bits of the 32-bit variable x, filling the left with zeros; and 32 + is modulo 2

[0151] Note that the formulas of the above Σ0(x), Σ1(x), σ0(x), σ1(x) functions are given in a specific form for processing 32-bit data with SHA-256 as an example, and those skilled in the art know that these functions can be adaptively taken in other corresponding forms for processing other sizes of data (e.g., 64-bit data, etc.) in other SHA algorithms (e.g., SHA-512, etc.) or even other hash algorithms.

[0152] In the following, several non-limiting example configurations of the extension register modules of the operation stages in the pipeline structure in Figures 16-18 are described. Figure 15 In the following, several non-limiting example configurations of the extension register modules of the operation stages in the pipeline structure in Figures 16-18 It is understood that

[0153] Figure 16 is a schematic diagram showing a first example of the extension register modules of the operation stages in the pipeline structure in Figure 15 and the extension data operation modules between adjacent operation stages.

[0154] With reference to Figure 16 , the extension data in the extension register modules R0, R1, R9 and R 14 of each operation stage need to be used to calculate the extension data to be stored in the extension register modules R 15 of the next operation stage. In addition, the extension data in the extension register modules R1 to R 15 can be directly shifted to the corresponding extension register modules R0 to R 14 of the next operation stage. Specifically, the 15th extension data W15 15 in the extension register module R t+1 of the t+1th operation stage is obtained by sequentially adding the 0th extension data W0 t in the extension register module R0 of the tth operation stage, the σ0(W1 t obtained after the σ0 operation of the 1st extension data W1 t in the extension register module R1 of the tth operation stage by a σ0 operator, the 9th extension data W9 t in the extension register module R9 of the tth operation stage, the σ1(W14 14 obtained after the σ1 operation of the 14th extension data W14 t in the extension register module R t of the tth operation stage by a σ1 operator, i.e., W15 t+1 = W0 t + σ0(W1t +W9 t +σ1(W14 t As can be seen, from the extended register modules R0, R1, R9, and R at the t-th operation level... 14 The 0th extended data W0 t Extended Data W1 t Extended Data W9, No. 9 t Extended Data 14 W14 t The calculations need to be stored in the extended register module R of the next operation stage. 15 Extended data W15 in t+1 The computational logic stages required are as high as four, which leads to significant computational latency, limits the computational speed of the pipeline structure, and makes it difficult to achieve a low power consumption-to-computing power ratio.

[0155] In this regard, the inventors of this application noted that there is a direct connection between the extended register module R0 of the (t+1)th operation level and the extended register module R1 of the tth operation level; that is, the extended data stored in the extended register module R1 of the tth operation level is directly shifted to the extended register module R0 of the (t+1)th operation level. Therefore, the inventors of this application conceived of using this direct connection between the extended register modules R0 and R1 to transfer the extended register module R0 used for calculating the (t+2)th operation level... 15 During the process of storing extended data, the portion of the extended data in the extended register module R0 of the (t+1)th operation level (i.e., the extended data in the extended register module R1 of the t-th operation level) is moved forward to the extended register module R1 used for calculating the (t+1)th operation level. 15 The process of storing the extended data is performed simultaneously and stored in the extended register module R0 of the (t+1)th operation level. In this way, the extended register module R0 used for calculating the (t+2)th operation level can be used... 15 After decomposing the process of storing the extended data, the decomposed parts are combined with the extended register module R used to calculate the (t+1)th operation level. 15 The process of storing extended data is handled in parallel. Parallel processing reduces the number of logical operation stages required to compute the extended data in each round, thereby increasing the processing speed of the circuit and the computing chip containing it, facilitating a lower power-to-computing power ratio. Specifically, the 15th extended register module R of the (t+2)th operation stage... 15 The 15th extended data W15 stored in the middle t+2 The first extended data W1 is stored in the first extended register module R1 of the t-th operation level. t The second extended data W2 is stored in the second extended register module R2 of the t-th operation level. t The 10th extended register module R of the t-th operation level10 the 10th extension data W10 stored in the 10th extension register module R t and the 15th extension register module R of the tth operation stage 15 the 15th extension data W15 stored in the 15th extension register module R t The following relation can be satisfied: W15 t+2 = W1 t + σ0(W2 t ) + W10 t + σ1(W15 t ), where σ0, σ1, + are defined as described above.

[0156] For example, the extension data for storage into the 0th extension register module R0 of the t+1th operation stage can be computed based on the extension data stored in one or both of the 2nd extension register module R2, the 10th extension register module R 10 , the 15th extension register module R 15 of the tth operation stage and the extension data stored in the 1st extension register module R1 of the tth operation stage. In addition, the extension data for storage into the 15th extension register module R 15 of the t+1th operation stage can be computed based on the extension data stored in one or both of the 1st extension register module R1, the 9th extension register module R9, the 14th extension register module R 14 of the tth operation stage and the extension data stored in the 0th extension register module R0 of the tth operation stage.

[0157] Figure 17 is a schematic diagram illustrating a second example of extension register modules of operation stages in the pipeline structure in Figure 15 and extension data operation modules between adjacent operation stages.

[0158] As shown in Figure 17 , the 0th extension data W0 t+1 in the 0th extension register module R0 of the t+1th operation stage is obtained from the 1st extension data W1 t stored in the 1st extension register module R1 of the tth operation stage and the 2nd extension data W2 t stored in the 2nd extension register module R2 of the tth operation stage. Specifically, in this example, W0 t+1 = W1 t + σ0(W2 t ).

[0159] Further as shown in Figure 17 , the 15th extension data W15 15 in the 15th extension register module R t+1The 0th extended data W0 is stored in the 0th extended register module R0 of the t-th operation level. t The 9th extended data W9 is stored in the 9th extended register module R9. t and the 14th extended register module R 14 The 14th extended data W14 stored in the middle t Obtained. Specifically, in this example, W15 t+1 =W0 t +W9 t + σ1(W14 t ).

[0160] Further as Figure 17 As shown, the extended data stored in the i-th extended register module of the t-th operation level is directly shifted to the (i-1)-th extended register module of the (t+1)-th operation level, where 2≤i≤15 and i is an integer.

[0161] exist Figure 17 In the example shown, the number of computational logic stages required to finally compute the extended data for the (t+1)th operation stage is reduced to 3, which greatly reduces computational latency and significantly improves the computational speed of the pipeline structure.

[0162] The extended data operation module between the (t+1)th operation level and the (t+2)th operation level can be the same as the extended data operation module between the t-th operation level and the (t+1)th operation level. Further, as... Figure 17 As shown, the 15th extended register module R of the (t+2)th operation stage 15 Extended data W15 in t+2 The 0th extended data W0 is stored in the 0th extended register module R0 of the (t+1)th operation level. t+1 The 9th extended data W9 is stored in the 9th extended register module R9. t+1 and the 14th extended register module R 14 The 14th extended data W14 stored in the middle t+1 Obtained. Specifically, in this example, W15 t+2 =W0 t+1 +W9 t+1 +σ1(W14 t+1 )=W1 t +σ0(W2 t )+W10 t +σ1(W15 t ).

[0163] Figure 18 It is shown Figure 15 A schematic diagram of the third example of the extended register module of the operation stage and the extended data operation module between adjacent operation stages in the pipeline structure.

[0164] As shown in Figure 18 , the 0th extended data W0 t+1 in the 0th extended register module R0 of the t+1th operation stage is obtained by the 1st extended data W1 t stored in the 1st extended register module R1 of the tth operation stage and the 10th extended data W10 10 stored in the 10th extended register module R t . Specifically, in this example, W0 t+1 = W1 t + W10 t .

[0165] Further as shown in Figure 18 , the 15th extended data W15 15 in the 15th extended register module R t+1 of the t+1th operation stage is obtained by the 0th extended data W0 t stored in the 0th extended register module R0 of the tth operation stage, the 1st extended data W1 t stored in the 1st extended register module R1 and the 14th extended data W14 14 stored in the 14th extended register module R t . Specifically, in this example, W15 t+1 = W0 t + σ0(W1 t ) + σ1(W14 t ).

[0166] Further as shown in Figure 18 , the extended data stored in the i-th extended register module of the tth operation stage is directly shifted to the (i-1)th extended register module of the t+1th operation stage, where 2≤i≤15 and i is an integer.

[0167] In the example shown in Figure 18 , the number of operation logic stages that the extended data for the t+1th operation stage needs to go through for final calculation is reduced to 3 stages, greatly reducing the calculation delay and greatly improving the operation speed of the pipeline structure.

[0168] The extended data operation module between the tth operation stage and the t+1th operation stage can be the same as the extended data operation module between the tth operation stage and the t+1th operation stage. Further as shown in Figure 18 , the 15th extended data W15 15 in the 15th extended register module R t+2 of the t+2th operation stage is obtained by the 0th extended data W0 t+1The first extended data W1 stored in the first extended register module R1 t+1 and the 14th extended register module R 14 The 14th extended data W14 stored in the middle t+1 Obtained. Specifically, in this example, W15 t+2 =W0 t+1 +σ0(W1 t+1 )+σ1(W14 t+1 )=W1 t +σ0(W2 t )+W10 t +σ1(W15 t ).

[0169] In addition, in some examples, W0 t+1 =W1 t +σ1(W15 t And W15 t+1 =W0 t +σ0(W1 t )+W9 t Therefore, W15 t+2 =W0 t+1 +σ0(W1 t+1 )+W9 t+1 =W1 t +σ0(W2 t )+W10 t +σ1(W15 t This can be used as a reference. Figures 17-18 The configuration is implemented similarly, so I won't go into details here.

[0170] exist Figures 16-18 In some configurations, the input to the adder comes from combinational logic circuits. For example, Figure 16 The input of the adder ADD in the code comes from the full adder FAA2, and Figure 17 and Figure 18 The input to adder ADD1 in each of them comes from full adder FAA. Therefore, these configurations exist similar to Figure 1 The illustrated arithmetic circuit suffers from high power consumption due to glitches in the adder and delay due to numerous stages. Therefore, these configurations can be modified according to the teachings of this disclosure to achieve a pipelined structure with reduced power consumption and delay.

[0171] Figure 19A circuit 300 for performing a hash algorithm according to some embodiments of the present disclosure is shown, where arrows indicate the direction of data transmission. The circuit 300 may include an input unit 310 and an arithmetic unit 320. The input unit 310 may be configured to receive data. The arithmetic unit 320 may be configured to calculate a hash value based on the received data. The arithmetic unit 320 may include a plurality of arithmetic stages 320-0, ..., 320-63 arranged in a pipelined structure. Each arithmetic stage may include an extended register module configured to store extended data. For example, the extended register module may be implemented as a combination of single-bit registers. It should be understood that although the arithmetic unit 320 is depicted in the figures as including 64 arithmetic stages, as mentioned above, this document only provides a non-limiting example of a circuit for performing the SHA-256 algorithm, and the circuit according to the present disclosure can actually be applied to perform any hash algorithm now known or later developed (not limited to the SHA family of algorithms), and may include any suitable number of arithmetic stages. It should also be understood that the actual circuit may have additional components (such as a compression register module), but to avoid obscuring the key points of this disclosure, these other components are not shown in the accompanying drawings and are not discussed herein. Typically, the extended data of the first operational stage 320-0 of the arithmetic unit 320 can be directly taken from the data received by the input unit 310, for example, while the extended data of each operational stage starting from operational stage 320-1 can be determined, for example, based on the extended data of the previous operational stage.

[0172] Generally, the extended register modules of each of the multiple arithmetic stages 320-0, ..., 320-63 can have the same configuration. In some cases, the extended register modules of each of the multiple arithmetic stages 320-0, ..., 320-63 can have different configurations. For example, there may be one or more arithmetic stages that have one or more fewer extended register modules than other arithmetic stages. This disclosure is not limited to any of the above situations.

[0173] like Figure 19 As shown, the multiple operation stages 320-0, ..., 320-63 include a first operation stage 320-a and a second operation stage 320-b immediately following the first operation stage 320-a. In this paper, the operation stage that comes first among two adjacent operation stages in the pipeline structure can be referred to as the first operation stage, and the operation stage that comes later among two adjacent operation stages can be referred to as the second operation stage. Note that "first" and "second" are used only for distinction and not as a limitation.

[0174] Each of the first operational level 320-a and the second operational level 320-b includes an extended register module R0 to an extended register module R15, respectively configured to store extended data from the 0th to the 15th extensions of that operational level. 1515th Extended Register Module R 15 Includes the first sum register submodule R 15s1 First carry register submodule R 15c1 The second sum register submodule R 15s2 Second base register submodule R 15c2 For example, the first sum register submodule R in circuit 300 15s1 First carry register submodule R 15c1 The second sum register submodule R 15s2 Second base register submodule R 15c2 These can correspond to the first register module 102, the second register module 104, the fourth register module 108, and the third register module 106 in the summation module 220 of the arithmetic circuit 200, respectively. Therefore, their configuration can be similar to the configuration of the first register module 102, the second register module 104, the fourth register module 108, and the third register module 106 described above, and will not be elaborated here.

[0175] Further as Figure 19 As shown, circuit 300 further includes a first extended data processing module 330-a disposed between the first operational stage 320-a and the second operational stage 320-b. The first extended data processing module 330-a includes a first submodule 331, a second submodule 332 and a third submodule 333.

[0176] The first submodule 331 of the first extended data processing module 330-a can be configured to be based on the 0th extended data W0 of the first processing level 320-a. a And based on the first extended data W1 of the first operation level 320-a a Extended Data W9, No. 9 a and the 14th extended data W14 a At least two of them are used to calculate the initial sum s0 and the initial carry c0. For example, the first submodule 331 of the first extended data operation module 330-a in circuit 300 may correspond to the first operation module 210 of operation circuit 200. The initial sum s0 and the initial carry c0 can be processed as the aforementioned first number a and second number b using the teachings of this disclosure. For example, each of the initial sum s0 and the initial carry c0 is divided into parts corresponding to each other to include the first to the Nth parts (when applying the teachings regarding the adder circuit 100, N can be an integer greater than 2; when applying the teachings regarding the adder circuit 100', N can be an integer greater than 1), which represent the part bits of each from the least significant bit to the most significant bit. For example, s0 = [s0 N ,s0 N-1 , …, s01], and c0=[c0 N, c0 N-1 ,..., c01]. The first through N-1 portions of the initial sum s0 [s0 N-1 ,..., s01] are stored in the first sum register submodule R 15c of the 15th extension register module R 15s1 of the second arithmetic stage 320-b, and the first through N-1 portions of the initial carry c0 [c0 N-1 ,..., c01] are stored in the first carry register submodule R 15c of the 15th extension register module R 15c1 of the second arithmetic stage 320-b. For example, the first sum register submodule R 15s1 and the first carry register submodule R 15c1 may each include first through N-1 cells for storing the respective portions of the initial sum s0 and the initial carry c0. In this case, the jth portion s0 j of the initial sum s0 can be stored in the jth cell of the first sum register submodule R 15 of the 15th extension register module R 15s1 of the second arithmetic stage 320-b, and the jth portion c0 j of the initial carry c0 can be stored in the jth cell of the first carry register submodule R 15 of the 15th extension register module R 15c1 of the second arithmetic stage 320-b (j = 1,..., N-1).

[0177] When applying the teachings regarding the addition circuit 100, the second submodule 332 of the first extension data operation module 330-a can be configured to compute N-2 carries c1,..., c N-2 , where the ith carry corresponds to the carry resulting from adding the ith portion s0 i of the initial sum s0 and the ith portion c0 i of the initial carry c0 (i = 1,..., N-2). Alternatively, when applying the teachings regarding the addition circuit 100', the second submodule 332 of the first extension data operation module 330-a can be configured to compute N-1 carries c1,..., c N-1 , where the ith carry corresponds to the carry resulting from adding the ith portion s0 i of the initial sum s0 and the ith portion c0 i of the initial carry c0 (i = 1,..., N-1). These pre-computed carries are stored in the second carry register submodule R 15 of the 15th extension register module R 15c2For example, the second submodule 332 of the first extended data operation module 330-a in circuit 300 can correspond to the carry logic modules 112 and 112' in the summation module 220 of operation circuit 200. Therefore, its configuration can be similar to the configuration of the carry logic modules 112 and 112' described above, and will not be elaborated here.

[0178] The third submodule 333 of the first extended data processing module 330-a can be configured to process the Nth part s0 of the initial sum s0. N The Nth part c0 of the initial carry c0 N Summing, thus producing the intermediate sum s m The middle number s m Stored in the 15th extended register module R of the second arithmetic stage 320-b 15 The second sum register submodule R 15s2 For example, the third submodule 333 of the first extended data operation module 330-a in circuit 300 can correspond to the first summing logic module 114 in the summing module 220 of operation circuit 200. Therefore, its configuration can be similar to the configuration of the first summing logic module 114 described above, and will not be elaborated here.

[0179] In some examples, such as reference Figure 20 The multiple operation levels 320-0, ..., 320-63 also include a third operation level 320-c immediately following the second operation level 320-b. The third operation level 320-c includes a 14th extended data W14 configured to store this operation level. c 14th Extended Register Module R 14 Circuit 300 also includes a second extended data processing module 330-b disposed between the second operational stage 320-b and the third operational stage 320-c. The second extended data processing module 330-b includes a fourth submodule 334.

[0180] When applying the teachings regarding the adder circuit 100, the fourth submodule 334 of the second extended data operation module 330-b may include the first to the (N-1)th adders. The first adder is configured to sum the first part s01 of the initial sum s0 with the first part c01 of the initial carry c0. The (N-1)th adder is configured to sum the (N-1)th part s0 of the initial sum s0. N-1 The (N-1)th part of the initial carry c0 N-1 , middle and number s m With the (N-2)th carry c N-2 Summation. When N is an integer greater than 3, the k-th adder is configured to sum the k-th part s0 of the initial sum s0. k The k-th part of the initial carry c0 kWith carry c of the (k-1)th position k-1 Summation (k=2, ..., N-2). For example, the fourth submodule 334 of the second extended data operation module 330-b in circuit 300 can correspond to the second summation logic module 110 in the summation module 220 of operation circuit 200. Therefore, its configuration can be similar to the configuration of the second summation logic module 110 described above, and will not be repeated here. The N-1 sums output by the first to N-1 adders of the fourth submodule 334 (which consist of the sum s of the initial sum s0 and the initial carry c0) are stored in the 14th extended register module R of the third operation stage 320-c. 14 middle.

[0181] Alternatively, when applying the teachings regarding the adder circuit 100', the fourth submodule 334 of the second extended data processing module 330-b may include first to Nth adders. The first adder is configured to sum the first portion s01 of the initial sum s0 with the first portion c01 of the initial carry c0. The Nth adder is configured to sum the intermediate sum s0... m With the (N-1)th carry c N-1 Summation. When N is an integer greater than 2, the k-th adder is configured to sum the k-th part s0 of the initial sum s0. k The k-th part of the initial carry c0 k With carry c of the (k-1)th position k-1 Summation (k=2, ..., N-1). For example, the fourth submodule 334 of the second extended data operation module 330-b in circuit 300 can correspond to the second summation logic module 110' in the summation module 220 of operation circuit 200. Therefore, its configuration can be similar to the configuration of the second summation logic module 110' described above, and will not be repeated here. The N sums output by the first to Nth adders of the fourth submodule 334 (which consist of the sum s of the initial sum s0 and the initial carry c0) are stored in the 14th extended register module R of the third operation stage 320-c. 14 middle.

[0182] Figures 21-25 The following are examples of applying the teachings of this disclosure to... Figures 16-18 Several non-restrictive example configurations are obtained by making corresponding modifications. This is understandable. Figures 21-25 The grayed-out depiction of some extended register modules and extended data operation modules is for illustrative purposes only and is not intended to be restrictive. Figures 21-25 In the example shown, each operation level can have the same configuration both internally and between adjacent operation levels.

[0183] like Figure 21As shown, the first submodule 331 of the first extended data operation module 330-a between the first operation stage 320-a and the second operation stage 320-b includes a σ0 operator, a σ1 operator, and two full adders FAA1, FAA2, and is configured to calculate an initial sum s0 and an initial carry c0 based on the 0th extended data W0 a , the 1st extended data W1 a , the 9th extended data W9 a , and the 14th extended data W14 a of the first operation stage 320-a. Each of the initial sum s0 and the initial carry c0 is partitioned correspondingly to each other to include 1st to Nth portions (N can be an integer greater than 2 when the teachings regarding the addition circuit 100 are applied; N can be an integer greater than 1 when the teachings regarding the addition circuit 100' are applied), which represent partial bits of the each from low to high. For example, s0 = [s0 N , s0 N-1 , …, s01] and c0 = [c0 N , c0 N-1 , …, c01]. The 1st to N-1th portions of the initial sum s0 are stored in the first sum register submodule R 15 of the 15th extended register module R 15s1 of the second operation stage 320-b, and the 1st to N-1th portions of the initial carry c0 are stored in the first carry register submodule R 15 of the 15th extended register module R 15c1 of the second operation stage 320-b.

[0184] The second submodule 332 of the first extended data operation module 330-a includes a carry logic module (Carry Logic Module) CLM. When the teachings regarding the addition circuit 100 are applied, the carry logic module CLM can receive at least the 1st to N-2th portions of the initial sum s0 and at least the 1st to N-2th portions of the initial carry c0, thereby generating N-2 carries c1, …, c N-2 , where the i-th carry corresponds to the carry generated by adding the i-th portion s0 i of the initial sum s0 and the i-th portion c0 i of the initial carry c0 (i = 1, …, N-2). When the teachings regarding the addition circuit 100' are applied, the carry logic module CLM can receive at least the 1st to N-1th portions of the initial sum s0 and at least the 1st to N-1th portions of the initial carry c0, thereby generating N-1 carries c1, …, c N-1 , where the i-th carry corresponds to the carry generated by adding the i-th portion s0 i of the initial sum s0 and the i-th portion c0i The carry generated by the addition (i = 1,..., N - 1). These carries computed by the carry logic module CLM are stored in the second carry register sub-modules R 15 of the 15th extended register module R 15c2 of the second arithmetic stage 320-b.

[0185] The third sub-module 333 of the first extended data operation module 330-a comprises a first sum logic module SLM1. The first sum logic module SLM1 can receive the Nth part of the initial sum s0 and the Nth part of the initial carry c0, thereby generating an intermediate sum s m . The intermediate sum s m is stored in the second sum register sub-module R 15 of the 15th extended register module R 15s2 of the second arithmetic stage 320-b.

[0186] The fourth sub-module 334 of the second extended data operation module 330-b between the second arithmetic stage 320-b and the third arithmetic stage 320-c comprises a second sum logic module SLM2.

[0187] The second sum logic module SLM2 can receive the first to N - 1th parts of the initial sum s0 and the first to N - 1th parts of the initial carry c0, and the carries c1,..., c N-2 and the intermediate sum s m , thereby generating N - 1 sums s1,..., s N-1 , when the teachings regarding the addition circuit 100 are applied. The second sum logic module SLM2 comprises first to N - 1 adders. The first adder is configured to sum the first part s01 of the initial sum s0 and the first part c01 of the initial carry c0, thereby generating the sum s1. The N - 1th adder is configured to sum the N - 1th part s0 N-1 , the N - 1th part c0 N-1 of the initial carry c0, the intermediate sum s m and the N - 2th carry c N-2 , thereby generating the sum s N-1 . In case N is an integer larger than 3, the kth adder is configured to sum the kth part s0 k , the kth part c0 k of the initial carry c0 and the k - 1th carry c k-1 (k = 2,..., N - 2), thereby generating the sum s k . The N - 1 sums s1,..., s N-1(The sum s of the initial sum s0 and the initial carry c0) is stored in the 14th extended register module R of the third arithmetic level 320-c. 14 middle.

[0188] Alternatively, when applying the teachings regarding the adder circuit 100', the second summing logic module SLM2 can receive the first to N-1 parts of the initial sum s0 and the first to N-1 parts of the initial carry c0, as well as the carry c1, ..., c N-1 and the middle number s m This generates N sums s1, ..., s2. N The second summation logic module SLM2 includes adders 1 through N. The first adder is configured to sum the first part s01 of the initial sum s0 with the first part c01 of the initial carry c0, thereby producing a sum s1. The Nth adder is configured to sum the intermediate sums s1 and s2. m With the (N-1)th carry c N-1 Summing, thus producing the sum s N When N is an integer greater than 2, the k-th adder is configured to add the k-th part s0 of the initial sum s0. k The k-th part of the initial carry c0 k With carry c of the (k-1)th position k-1 Summing (k=2, ..., N-1) to produce the sum s k N sums s1, ..., s2 N (The sum s of the initial sum s0 and the initial carry c0) is stored in the 14th extended register module R of the third arithmetic level 320-c. 14 middle.

[0189] Therefore, the 14th extended register module R of the third arithmetic stage 320-c 14 The 14th extended data W14 stored in the middle c With the 0th extended data W0 of the first operation level 320-a a Extended Data W1 a Extended Data W9, No. 9 a and the 14th extended data W14 a The following relationship can be satisfied: W14 c =W0 a +σ0(W1 a +W9 a +σ1(W14 a ).

[0190] Figure 21 and Figure 16 In comparison, although calculating "W0" a +σ0(W1 a +W9a +σ1(W14 a This requires an extra round of processing time, but it doesn't have a significant negative impact on the assembly line structure. Additionally, Figure 21 This breaks the constraints of the 32-bit binary adder. On one hand, Figure 21 Will Figure 16 The separation of the carry logic circuit and the LSB section of the summation logic circuit in the adder ADD makes the application of RCA in a pipelined structure feasible. Specifically, originally Figure 16 If the 32-bit adder ADD is implemented as RCA, it will have 32 stages, and the resulting latency may be unacceptable. Figure 16 A 32-bit adder, ADD, is often implemented as a CLA, but CLAs are large in area, have many glitches, and consume a lot of power. Figure 21 In this context, the second summation logic module, SLM2, can be implemented as multiple parallel RCAs, which offers reduced area, glitches, and power consumption while achieving speeds close to those of a CLA. On the other hand, Figure 21 Will Figure 16 The separation of the carry logic circuit and the LSB section of the summation logic circuit in the adder ADD further reduces the glitches from the carry logic circuit to the summation logic circuit. The inputs of the second summation logic module SLM2 all come from registers, thus reducing or even eliminating glitches, which lowers the power consumption of circuit 300. On another front, Figure 21 Will Figure 16 The summation logic circuit of the adder ADD has its LSB and MSB sections separated. This ensures that the MSB section of the summation logic circuit has no carry from lower bits, resulting in smaller glitches and lower power consumption. Therefore, Figure 21 At an acceptable register area and power consumption cost (e.g., assuming the Nth part of the initial sum s0 and the initial carry c0 both have x bits, in an arithmetic stage, compared to...), Figure 16 29+Nx or 30+Nx single-bit registers were added, where R 15c1 It has 31-x single-bit registers and R 15c2 Having N-2 or N-1 single-bit registers in exchange for a significantly reduced adder area / glitch power consumption.

[0191] like Figure 22 and Figure 23 As shown, the first submodule 331 of the first extended data operation module 330-a between the first operation level 320-a and the second operation level 320-b includes a σ1 arithmetic unit and a full adder FAA, and is configured to operate based on the 0th extended data W0 of the first operation level 320-a. a Extended Data W9, No. 9 a and the 14th extended data W14 aCalculate the initial sum s0 and the initial carry c0. Each of the initial sum s0 and the initial carry c0 is divided into corresponding parts from 1 to N (when applying the teachings regarding adder circuit 100, N can be an integer greater than 2; when applying the teachings regarding adder circuit 100', N can be an integer greater than 1), and these parts from 1 to N represent the portion bits of each part sequentially from the least significant bit to the most significant bit. For example, s0 = [s0 N , s0 N-1 , …, s01], and c0=[c0 N c0 N-1 The first to N-1 parts of the initial sum s0 are stored in the 15th extended register module R of the second operation level 320-b. 15 The first sum register submodule R 15s1 In this process, the first to N-1 portions of the initial carry c0 are stored in the 15th extension register module R of the second arithmetic stage 320-b. 15 First carry register submodule R 15c1 middle.

[0192] The second submodule 332 of the first extended data processing module 330-a includes a carry logic module CLM. Figure 22 The carry logic module (CLM) in the middle can be similar to Figure 21 The carry logic module (CLM) in the second arithmetic stage is not discussed in detail here. The carry calculated by the carry logic module (CLM) is stored in the 15th extended register module R of the second arithmetic stage 320-b. 15 Second carry register submodule R 15c2 middle.

[0193] The third submodule 333 of the first extended data processing module 330-a includes a first summation logic module SLM1. The first summation logic module SLM1 can receive the Nth part of the initial sum s0 and the Nth part of the initial carry c0, thereby generating an intermediate sum s m The middle number s m Stored in the 15th extended register module R of the second arithmetic stage 320-b 15 The second sum register submodule R 15s2 middle.

[0194] The fourth submodule 334 of the second extended data operation module 330-b between the second operation level 320-b and the third operation level 320-c includes the second summation logic module SLM2. Figure 22 The second summation logic module SLM2 in the code can be similar to... Figure 21The second summation logic module SLM2 in the third arithmetic stage 320-c is not described in detail here. The sum calculated by the second summation logic module SLM2 is stored in the 14th extended register module R of the third arithmetic stage 320-c. 14 middle.

[0195] Additionally, the 0th extended data W0 of the first operational level 320-a a It is based on the first extended data W1 of the fourth operation level 320-d through the fifth submodule 335 (which includes a σ0 arithmetic unit and an adder ADD0) of the third extended data operation module 330-d, which is immediately preceding the first operation level 320-a and is located between the first operation level 320-a and the fourth operation level 320-d. d And the second extended data W2 d The calculated value is W0. a = W1 d +σ0(W2 d ).

[0196] Therefore, the 14th extended register module R of the third arithmetic stage 320-c 14 The 14th extended data W14 stored in the middle c With the 0th extended data W0 of the first operation level 320-a a Extended Data W9, No. 9 a and the 14th extended data W14 a The following relationship can be satisfied: W14 c =W0 a +W9 a +σ1(W14 a In addition, the 14th extended register module R of the third arithmetic stage 320-c 14 The 14th extended data W14 stored in the middle c With the first extended data W1 of the fourth operation level 320-d d Second extended data W2 d Extended Data W10 (10th Edition) d And the 15th extended data W15 d The following relationship can be satisfied: W14 c =W1 d +σ0(W2 d +W10 d +σ1(W15 d ), of which W15 d ={W15s1 d + W15c1 d + W15s2 d + W15c2 d}. W15s1 d W15c1 dW15s2 d W15c2 d These are the 15th extended register module R of the fourth arithmetic level 320-d. 15 The first sum register submodule R 15s1 First carry register submodule R 15c1 The second sum register submodule R 15s2 Second base register submodule R 15c2 The data stored in it.

[0197] Figure 22 and Figure 17 In comparison, although calculating "W1" d +σ0(W2 d +W10 d +σ1(W15 d This requires an extra round of processing time, but it doesn't have a significant negative impact on the assembly line structure. Additionally, Figure 22 This breaks the constraints of the 32-bit binary adder. On one hand, Figure 22 Will Figure 17 The carry logic circuit and the LSB section of the summation logic circuit of the adder ADD1 are separated, making the application of RCA in a pipelined structure feasible. Specifically, originally Figure 17 If the 32-bit adder ADD1 is implemented as an RCA, it will have 32 stages, and the resulting latency may be unacceptable. Figure 17 The 32-bit adder ADD1 is often implemented as a CLA, but CLAs have a large area, many glitches, and high power consumption. Figure 22 In this context, the second summation logic module, SLM2, can be implemented as multiple parallel RCAs, which offers reduced area, glitches, and power consumption while achieving speeds close to those of a CLA. On the other hand, Figure 22 Will Figure 17 The separation of the carry logic circuit and the LSB section of the summation logic circuit in the adder ADD1 further reduces the glitches from the carry logic circuit to the summation logic circuit. The inputs of the second summation logic module SLM2 all come from registers, thus reducing or even eliminating glitches, which lowers the power consumption of circuit 300. On another front, Figure 22 Will Figure 17 The summation logic circuit of adder ADD1 has its LSB and MSB sections separated. This ensures that the MSB section of the summation logic circuit has no carry from lower bits, resulting in smaller glitches and lower power consumption. Therefore, Figure 22 At an acceptable register area and power consumption cost (e.g., assuming the Nth part of the initial sum s0 and the initial carry c0 both have x bits, in an arithmetic stage, compared to...), Figure 1729+Nx or 30+Nx single-bit registers were added, where R 15c1 It has 31-x single-bit registers and R 15c2 Having N-2 or N-1 single-bit registers in exchange for a significantly reduced adder area / glitch power consumption.

[0198] like Figure 24 and Figure 25 As shown, the first submodule 331 of the first extended data operation module 330-a between the first operation level 320-a and the second operation level 320-b includes a σ0 operator, a σ1 operator, and a full adder FAA, and is configured to operate based on the 0th extended data W0 of the first operation level 320-a. a Extended Data W1 a and the 14th extended data W14 a Calculate the initial sum s0 and the initial carry c0. Each of the initial sum s0 and the initial carry c0 is divided into corresponding parts from 1 to N (when applying the teachings regarding adder circuit 100, N can be an integer greater than 2; when applying the teachings regarding adder circuit 100', N can be an integer greater than 1), and these parts from 1 to N represent the portion bits of each part sequentially from the least significant bit to the most significant bit. For example, s0 = [s0 N , s0 N-1 , …, s01], and c0=[c0 N c0 N-1 The first to N-1 parts of the initial sum s0 are stored in the 15th extended register module R of the second operation level 320-b. 15 The first sum register submodule R 15s1 In this process, the first to N-1 portions of the initial carry c0 are stored in the 15th extension register module R of the second arithmetic stage 320-b. 15 First carry register submodule R 15c1 middle.

[0199] The second submodule 332 of the first extended data processing module 330-a includes a carry logic module CLM. Figure 24 The carry logic module (CLM) in the middle can be similar to Figure 21 The carry logic module (CLM) in the second arithmetic stage is not discussed in detail here. The carry calculated by the carry logic module (CLM) is stored in the 15th extended register module R of the second arithmetic stage 320-b. 15 Second carry register submodule R 15c2 middle.

[0200] The third submodule 333 of the first extended data processing module 330-a includes a first summation logic module SLM1. The first summation logic module SLM1 can receive the Nth part of the initial sum s0 and the Nth part of the initial carry c0, thereby generating an intermediate sum s m The middle number s m Stored in the 15th extended register module R of the second arithmetic stage 320-b 15 The second sum register submodule R 15s2 middle.

[0201] The fourth submodule 334 of the second extended data operation module 330-b between the second operation level 320-b and the third operation level 320-c includes the second summation logic module SLM2. Figure 24 The second summation logic module SLM2 in the code can be similar to... Figure 21 The second summation logic module SLM2 in the third arithmetic stage 320-c is not described in detail here. The sum calculated by the second summation logic module SLM2 is stored in the 14th extended register module R of the third arithmetic stage 320-c. 14 middle.

[0202] Additionally, the 0th extended data W0 of the first operational level 320-a a The first extended data W1 of the fourth operation level 320-d is processed by the fifth submodule 335 (which includes an adder ADD0) of the third extended data operation module 330-d, which is immediately preceding the first operation level 320-a and is located between the first operation level 320-a and the fourth operation level 320-d. d and the 10th extended data W10 d The calculated value is W0. a = W1 d +W10 d .

[0203] Therefore, the 14th extended register module R of the third arithmetic stage 320-c 14 The 14th extended data W14 stored in the middle c With the 0th extended data W0 of the first operation level 320-a a Extended Data W1 a and the 14th extended data W14 a The following relationship can be satisfied: W14 c =W0 a +σ0(W1 a ) +σ1(W14 a In addition, the 14th extended register module R of the third arithmetic stage 320-c 14 The 14th extended data W14 stored in the middle c With the first extended data W1 of the fourth operation level 320-dd Second extended data W2 d Extended Data W10 (10th Edition) d And the 15th extended data W15 d The following relationship can be satisfied: W14 c =W1 d +σ0(W2 d +W10 d +σ1(W15 d ), of which W15 d ={W15s1 d + W15c1 d + W15s2 d + W15c2 d}. W15s1 d W15c1 d W15s2 d W15c2 d These are the 15th extended register module R of the fourth arithmetic level 320-d. 15 The first sum register submodule R 15s1 First carry register submodule R 15c1 The second sum register submodule R 15s2 Second base register submodule R 15c2 The data stored in it.

[0204] Figure 24 and Figure 18 In comparison, although calculating "W1" d +σ0(W2 d +W10 d +σ1(W15 d This requires an extra round of processing time, but it doesn't have a significant negative impact on the assembly line structure. Additionally, Figure 24 This breaks the constraints of the 32-bit binary adder. On one hand, Figure 24 Will Figure 18 The carry logic circuit and the LSB section of the summation logic circuit of the adder ADD1 are separated, making the application of RCA in a pipelined structure feasible. Specifically, originally Figure 18 If the 32-bit adder ADD1 is implemented as an RCA, it will have 32 stages, and the resulting latency may be unacceptable. Figure 18 The 32-bit adder ADD1 is often implemented as a CLA, but CLAs have a large area, many glitches, and high power consumption. Figure 24 In this context, the second summation logic module, SLM2, can be implemented as multiple parallel RCAs, which offers reduced area, glitches, and power consumption while achieving speeds close to those of a CLA. On the other hand, Figure 24 Will Figure 18The separation of the carry logic circuit and the LSB section of the summation logic circuit in the adder ADD1 further reduces the glitches from the carry logic circuit to the summation logic circuit. The inputs of the second summation logic module SLM2 all come from registers, thus reducing or even eliminating glitches, which lowers the power consumption of circuit 300. On another front, Figure 24 Will Figure 18 The summation logic circuit of adder ADD1 has its LSB and MSB sections separated. This ensures that the MSB section of the summation logic circuit has no carry from lower bits, resulting in smaller glitches and lower power consumption. Therefore, Figure 24 At an acceptable register area and power consumption cost (e.g., assuming the Nth part of the initial sum s0 and the initial carry c0 both have x bits, in an arithmetic stage, compared to...), Figure 18 29+Nx or 30+Nx single-bit registers were added, where R 15c1 It has 31-x single-bit registers and R 15c2 Having N-2 or N-1 single-bit registers in exchange for a significantly reduced adder area / glitch power consumption.

[0205] In addition, it can be based on W0 t+1 =W1 t +σ1(W15 t W15 t+1 =W0 t +σ0(W1 t )+W9 t And W15 t+2 =W0 t+1 +σ0(W1 t+1 )+ W9 t+1 =W1 t +σ0(W2 t )+W10 t +σ1(W15 t (This can be extended to other embodiments. For example, in some embodiments, the first submodule 331 of the first extended data processing module 330-a can be based on the 0th extended data W0 of the first processing level 120-a.) a Extended Data W1 a and the 9th extended data W9 a Calculate the initial sum and initial carry, then proceed to a similar manner. Figure 22 , Figure 24 The initial sum and initial carry are then processed as the first and second numbers by an addition circuit according to various embodiments of the teachings of this disclosure, which will not be elaborated here.

[0206] This disclosure may also provide a computing chip including the circuitry described in any of the above embodiments. This disclosure may also provide a computing device including the computing chip described above.

[0207] The words "left," "right," "front," "back," "top," "bottom," "over," "under," "upper," "lower," and the like in the description and the claims, if any, are used for descriptive purposes and not necessarily for describing permanent relative positions. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in other orientations than those illustrated or otherwise described herein. For example, if the device is inverted, then the features originally described as above other features can be described as below the other features. The device can also be oriented in other ways (rotated at 90 degrees or at other orientations), and the relative spatial relationships would be correspondingly interpreted.

[0208] In the description and claims, when an element is referred to as being "on," "attached," "connected" or "coupled" to another element, it can be directly on, attached to, connected to, or coupled to the other element or one or more intervening elements can be present. In contrast, when an element is referred to as being "directly on," "directly attached" "directly connected" or "directly coupled" to another element, there are no intervening elements present. In the description and claims, a feature can be arranged "adjacent" to another feature, which can mean that the feature has a portion that overlaps the adjacent feature or a portion that is above or below the adjacent feature.

[0209] As used herein, the word "exemplary" means "serving as an example, instance, or illustration," and not "preferred" or "advantageous over other implementations." Furthermore, the disclosure is not to be limited to any expressed or implied theory of operation by any stated or implied theories of operation. As used herein, the word "substantially" means including any small variations as tolerances, imperfections, or adjustments, within the design, fabrication, or manufacturing of devices or components, environmental influences, and / or other factors. The word "substantially" also allows for differences to perfect or ideal circumstances due to parasitic effects, noise, and other practical implementation considerations.

[0210] Additionally, for purpose of reference only, the terms "first", "second", and like terms can also be used herein and, therefore, are not intended to limit the scope of the disclosure. For example, unless otherwise clear from context, the words "first", "second", and other such numerical terms when used in conjunction with describing a structure or element are not meant to connote a sequential or chronological order. It is also to be understood that the term "comprising" or "including" when used herein is taken to specify the presence of stated features, integers, steps, operations, elements, or components but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. In the present disclosure, the term "providing" is used in a broad sense to encompass all means of obtaining an object, and thus "providing an object" includes, but is not limited to, "purchasing", "preparing / manufacturing", "arranging / setting", "installing / fitting", and / or "ordering" the object, etc.

[0211] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the present disclosure. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0212] Those skilled in the art will realize that the boundaries between the above described operations merely illustrative. The multiple operations can be combined into a single operation, a single operation can be distributed in additional operations and operations can be executed at least partially overlapping in time. Moreover, alternative embodiments can include a number of instances of a particular operation, and the order of the operations can be altered in other various embodiments. However, other modifications, variations, and alternatives are also possible. The aspects and elements of all such embodiments can be combined in any manner and / or with other aspects or elements, without departing from the scope of the present disclosure. It is intended that the description and examples be considered as illustrative only, with the true scope of the disclosure being indicated by the following claims.

[0213] While certain specific embodiments of the present disclosure have been described with specificity, those skilled in the art will appreciate that the above examples are merely meant to be illustrative and not limiting of the scope of the disclosure. The various embodiments disclosed herein can be combined in any manner and / or with other embodiments without departing from the spirit and scope of the present disclosure. Those skilled in the art will further appreciate that modifications, variations, and alternatives of the embodiments described herein can be made without departing from the spirit and scope of the present disclosure. The scope of the present disclosure is defined by the appended claims.

Claims

1. An adder circuit, characterized in that, The adder circuit is used to calculate the sum of a first number and a second number. The adder circuit has a first input representing the first number and a second input representing the second number, and an output representing the sum of the first and second numbers. Each of the first and second inputs is correspondingly divided into parts 1 to N, where N is an integer greater than 1. The parts 1 to N represent portions of the input from least significant bit to most significant bit. The adder circuit includes: The carry logic module is configured to calculate one or more carry-in, each of the one or more carry-in corresponding to the carry-out generated by adding a corresponding part of a first input to a corresponding part of a second input; The first register module is configured to store the first to N-1th portions of the first input; The second register module is configured to store the first to N-1th portions of the second input; The third register module is coupled to the carry logic module and is configured to store the one or more carry bits; The first summation logic module is configured to sum the Nth part of the first input and the Nth part of the second input to generate an intermediate sum. The fourth register module, coupled to the first summation logic module, is configured to store intermediate sums; and The second summation logic module is coupled to the first through fourth register modules and is configured to sum the first through N-1 parts of the first input, the second through N-1 parts of the second input, the intermediate sum, and one or more carry-in numbers. In this module, the sum output by the second summing logic module represents a portion of the output bits from the least significant bit to the most significant bit.

2. The adder circuit according to claim 1, characterized in that, The carry logic module is configured to calculate the one or more carries using carry-lookahead logic.

3. The adder circuit according to claim 1, characterized in that, The first summation logic module is implemented as a ripple carry adder.

4. The adder circuit according to claim 1, characterized in that, The second summation logic module is implemented as multiple parallel ripple carry adders.

5. The adder circuit according to claim 1, characterized in that, N is an integer greater than 2, and where: The carry logic module is configured to calculate N-2 carry-in, wherein the i-th carry-in corresponds to the carry-in generated by adding the i-th part of the first input to the i-th part of the second input, i=1,…,N-2; The first register module and the second register module each include units 1 to N-1, and the second summation logic module includes adders 1 to N-1. The j-th unit of the first register module is configured to store the j-th part of the first input, the j-th unit of the second register module is configured to store the j-th part of the second input, and the j-th adder of the second summing logic module is coupled to the j-th unit of the first register module and the j-th unit of the second register module, j=1,…,N-1; The first adder of the second summation logic module is configured to sum the first part of the first input and the first part of the second input; and The (N-1)th adder of the second summing logic module is also coupled to the third and fourth register modules and is configured to sum the (N-1)th part of the first input, the (N-1)th part of the second input, the intermediate sum, and the (N-2)th carry of the (N-2)th carry.

6. The adder circuit according to claim 5, characterized in that, N is an integer greater than 3, and wherein the k-th adder of the second summation logic module is also coupled to the third register module and is configured to sum the k-th part of the first input, the k-th part of the second input and the (k-1)-th carry of the N-2 carry, k=2, ..., N-2.

7. The adder circuit according to claim 5, characterized in that, Each of the first and second inputs has a first digit in each of its parts 1 to N-2, and the input has a total of two second digits in its parts N-1 to N, which are equal to the first digit.

8. The adder circuit according to claim 5, characterized in that, The carry logic module includes: The preprocessor is configured to perform XOR and AND operations on each bit of the first to N-2 portions of the first input and the corresponding bits of the second input in parallel, thereby generating corresponding transmission and generation signals; and The carry generator is configured to generate the N-2 carries using a transfer signal and a generation signal generated by a preprocessor.

9. The adder circuit according to claim 1, characterized in that: The carry logic module is configured to calculate N-1 carry-values, where the i-th carry-value corresponds to the carry-value generated by adding the i-th part of the first input to the i-th part of the second input, i=1,…,N-1; The first register module and the second register module each include units 1 to N-1, and the second summation logic module includes adders 1 to N; The j-th unit of the first register module is configured to store the j-th part of the first input, the j-th unit of the second register module is configured to store the j-th part of the second input, and the j-th adder of the second summing logic module is coupled to the j-th unit of the first register module and the j-th unit of the second register module, j=1,…,N-1; The first adder of the second summation logic module is configured to sum the first part of the first input and the first part of the second input; as well as The Nth adder of the second summing logic module is also coupled to the third and fourth register modules and is configured to sum the intermediate sum with the (N-1)th carry of the N-1 carries.

10. The adder circuit according to claim 9, characterized in that, N is an integer greater than 2, and wherein the k-th adder of the second summing logic module is also coupled to the third register module and is configured to sum the k-th part of the first input, the k-th part of the second input, and the (k-1)-th carry of the N-1 carry, k=2, ...,N-1.

11. The adder circuit according to claim 9, characterized in that, Each part of the first and second inputs has the same number of bits.

12. The adder circuit according to claim 9, characterized in that, The carry logic module includes: The preprocessor is configured to perform XOR and AND operations on each bit of the first to N-1 portions of the first input and the corresponding bits of the second input in parallel, thereby generating corresponding transmission and generation signals; and The carry generator is configured to generate the N-1 carries using a transfer signal and a generation signal generated by a preprocessor.

13. The adder circuit according to claim 8 or 12, characterized in that, The carry generator includes a parallel prefix network.

14. An operational circuit, characterized in that, The arithmetic circuit includes: The summation module includes an adder circuit according to any one of claims 1 to 13; and A first arithmetic module coupled to the summing module to provide the first and second inputs of the adder circuit.

15. The operational circuit according to claim 14, characterized in that, The arithmetic circuit includes multiple arithmetic stages, each of which includes a corresponding register module. The multiple arithmetic stages include a first arithmetic stage and a second arithmetic stage immediately following the first arithmetic stage. The second arithmetic stage further includes the first to fourth register modules of the adder circuit. A first arithmetic module is disposed between the first and second arithmetic stages and coupled to a first corresponding register module of the first arithmetic stage. The first arithmetic module is configured to perform operations on data from the first corresponding register module, thereby generating the first and second inputs of the adder circuit. The carry logic module and the first summation logic module of the addition circuit are arranged between the first operation stage and the second operation stage.

16. The operational circuit according to claim 15, characterized in that, The plurality of operational stages also includes a third operational stage immediately following the second operational stage, wherein a third corresponding register module of the third operational stage is coupled to the summing module to receive the output of the addition circuit, and The second summation logic module of the adder circuit is arranged between the second and third operation stages.

17. The operational circuit according to claim 16, characterized in that, The arithmetic circuit also includes: The second arithmetic module is located between the second arithmetic stage and the third arithmetic stage and coupled to the second corresponding register module of the second arithmetic stage. The second arithmetic module is configured to perform operations on data from the second corresponding register module.

18. The operational circuit according to claim 17, characterized in that, The summation module is a first summation module, the addition circuit is a first addition circuit, and the arithmetic circuit further includes: The second summing module includes a second adding circuit, which is the adding circuit according to any one of claims 1 to 13. The third arithmetic stage also includes the first to fourth register modules of the second adder circuit. The second arithmetic module is coupled to the second summing module to provide the first and second inputs of the second adder circuit, and is configured to perform operations on data from the second corresponding register module to generate the first and second inputs of the second adder circuit. The carry logic module and the first summation logic module of the second adder circuit are arranged between the second and third operation stages.

19. A circuit for performing a hash algorithm, characterized in that, The circuit includes: The input section is configured to receive data; and The arithmetic unit is configured to calculate hash values ​​based on received data and includes multiple arithmetic stages arranged in a pipelined architecture, wherein: The plurality of operation levels include a first operation level and a second operation level immediately following the first operation level. Each operation level in the first and second operation levels includes a 0th to a 15th extended register module, respectively configured to store 0th to 15th extended data of that operation level. The 15th extended register module includes a first sum register submodule, a second sum register submodule, a first carry register submodule, and a second carry register submodule. The circuit further includes a first extended data processing module disposed between the first processing stage and the second processing stage. The first extended data processing module includes a first submodule, a second submodule, and a third submodule. The first submodule is configured to calculate an initial sum and an initial carry based on the 0th extended data of the first arithmetic level and at least two of the 1st, 9th, and 14th extended data of the first arithmetic level. Each of the initial sum and the initial carry is divided into parts 1 to N, where N is an integer greater than 2. The parts 1 to N represent the bits of each part from least significant bit to most significant bit. Parts 1 to N-1 of the initial sum are stored in the first sum register submodule of the 15th extended register module of the second arithmetic level, and parts 1 to N-1 of the initial carry are stored in the first carry register submodule of the 15th extended register module of the second arithmetic level. The second submodule is configured to calculate N-2 carries, where the i-th carry corresponds to the carry generated by adding the i-th part of the initial sum to the i-th part of the initial carry, i=1,…,N-2. These N-2 carries are stored in the second carry register submodule of the 15th extended register module of the second arithmetic stage. The third submodule is configured to sum the Nth part of the initial sum with the Nth part of the initial carry, thereby generating an intermediate sum, which is stored in the second sum register submodule of the 15th extended register module of the second arithmetic stage.

20. The circuit according to claim 19, characterized in that, The plurality of operation levels also include a third operation level immediately following the second operation level, the third operation level including a 14th extended register module configured to store the 14th extended data of the operation level, and The circuit further includes a second extended data processing module arranged between the second and third processing stages. This second extended data processing module includes a fourth sub-module, which comprises adders 1 to N-1. The first adder is configured to sum the first part of the initial sum and the first part of the initial carry. The (N-1)th adder is configured to sum the (N-1)th part of the initial sum, the (N-1)th part of the initial carry, the intermediate sum, and the (N-2)th carry from the (N-2)th carry. The N-1 sums output by the first to N-1 adders are stored in the 14th extended register module of the third arithmetic stage.

21. The circuit according to claim 20, characterized in that, N is an integer greater than 3, where the k-th adder of the fourth submodule is configured to sum the k-th part of the initial sum, the k-th part of the initial carry, and the (k-1)-th carry in the N-2 carries, k=2, ..., N-2.

22. A circuit for performing a hash algorithm, characterized in that, The circuit includes: The input section is configured to receive data; and The arithmetic unit is configured to calculate hash values ​​based on received data and includes multiple arithmetic stages arranged in a pipelined architecture, wherein: The plurality of operation levels include a first operation level and a second operation level immediately following the first operation level. Each operation level in the first and second operation levels includes a 0th to a 15th extended register module, respectively configured to store 0th to 15th extended data of that operation level. The 15th extended register module includes a first sum register submodule, a second sum register submodule, a first carry register submodule, and a second carry register submodule. The circuit further includes a first extended data processing module disposed between the first processing stage and the second processing stage. The first extended data processing module includes a first submodule, a second submodule, and a third submodule. The first submodule is configured to calculate an initial sum and an initial carry based on the 0th extended data of the first arithmetic level and at least two of the 1st, 9th, and 14th extended data of the first arithmetic level. Each of the initial sum and the initial carry is correspondingly divided into parts 1 to N, where N is an integer greater than 1. The parts 1 to N represent the bits of each part from least significant bit to most significant bit. Parts 1 to N-1 of the initial sum are stored in the first sum register submodule of the 15th extended register module of the second arithmetic level, and parts 1 to N-1 of the initial carry are stored in the first carry register submodule of the 15th extended register module of the second arithmetic level. The second submodule is configured to calculate N-1 carries, where the i-th carry corresponds to the carry generated by adding the i-th part of the initial sum to the i-th part of the initial carry, i=1,…,N-1. These N-1 carries are stored in the second carry register submodule of the 15th extended register module of the second arithmetic stage. The third submodule is configured to sum the Nth part of the initial sum with the Nth part of the initial carry, thereby generating an intermediate sum, which is stored in the second sum register submodule of the 15th extended register module of the second arithmetic stage.

23. The circuit according to claim 22, characterized in that, The plurality of operation levels also include a third operation level immediately following the second operation level, the third operation level including a 14th extended register module configured to store the 14th extended data of the operation level, and The circuit further includes a second extended data processing module disposed between the second and third processing stages. This second extended data processing module includes a fourth sub-module, which comprises adders 1 through N. The first adder is configured to sum the first part of the initial sum and the first part of the initial carry. The Nth adder is configured to sum the intermediate sum with the (N-1)th carry out of the (N-1)th carry, and The N sums output by the first to Nth adders are stored in the 14th extended register module of the third arithmetic stage.

24. The circuit according to claim 23, characterized in that, N is an integer greater than 2, where the k-th adder of the fourth submodule is configured to sum the k-th part of the initial sum, the k-th part of the initial carry, and the (k-1)-th carry among the N-1 carries, k=2, ...,N-1.

25. A computing chip, characterized in that, The computing chip includes the circuitry according to any one of claims 1 to 24.

26. A computing device, characterized in that, The computing device includes the computing chip according to claim 25.

Citation Information

Patent Citations

  • Circuit for executing hash algorithm, computing chip, cryptocurrency mining machine and method

    CN114648319A

  • Systems and computer-implemented methods for generating pseudo random numbers

    US20230047518A1