Carry logic circuit, carry cascade circuit and chip
By designing cascaded-connected carry operation modules and output modules, the carry signal is calculated according to the preset strategy, the delay problem caused by excessive carry chain is solved and the performance of the carry circuit is improved.
Patent Information
- Application Number
- CN202411067839.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-11-19
AI Technical Summary
As the operating number bit width increases, the number of carriage cascades increases, resulting in too long carry chains and large carry delays, which affects the real-time performance of the carry circuit and data processing performance.
Design a carry logic circuit, which connects the Y-level carry operation module and the carry output module by cascaded connection. Each carry operation module receives arithmetic signal, outputs the carry signal according to the preset carry generation and transmission strategy, and the carry output module is based on the initial signal. and advanced carry signals calculate the final carry signal to realize the compression of the carry chain.
Compressing the carry chain of logic values of any bit width to one level reduces the delay of carry operations and improves the performance of carry logic circuits.
Smart Images

Figure CN118981302A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of integrated circuit technology, and in particular to a carry logic circuit, a carry cascade circuit and a chip. Background Art
[0002] The carry circuit is a key component for integrated circuits to achieve high-performance computing. Its principle is to use multiple carry devices to perform logical operations on the input signal and then transmit the carry signal to the next level of the carry device of the carry circuit with a small delay. However, after multiple carry devices are cascaded, as the bit width of the operand increases, the number of cascaded carry devices also increases, resulting in a too long carry chain, which makes the carry delay introduced when the carry circuit processes the operand data longer, and ultimately causes the data processing and operation of the carry circuit to be not real-time. Summary of the invention
[0003] In view of the above problems, the present application provides a carry logic circuit, a carry cascade circuit and a chip to solve the above technical problems.
[0004] In a first aspect, the present application provides a carry logic circuit, comprising Y-level carry operation modules and a carry output module connected in cascade, each level of the carry operation module is used to receive i pairs of arithmetic signals, Y>1, i≥1;
[0005] The first-level carry operation module is used to output the first-level carry generation signal according to the preset carry generation operation strategy, and output the first-level carry transfer signal according to the preset carry transfer operation strategy;
[0006] The x-th level carry operation module is further used to receive the previous level carry generation signal and the previous level carry transfer signal, output the x-th level carry generation signal according to the carry generation operation strategy, and output the x-th level carry transfer signal according to the carry transfer operation strategy, 2≤x≤Y;
[0007] The carry output module is used to receive a preset initial carry signal, a Y-th level carry occurrence signal and a Y-th level carry transfer signal, and is used to output a first carry signal according to a preset carry operation strategy;
[0008] Among them, the first-level carry generation signal is the carry generation signal of the i-th pair of arithmetic signals received by the first-level carry operation module, and the first-level carry transfer signal is the carry transfer signal of the i-th pair of arithmetic signals received by the first-level carry operation module; the x-level carry generation signal is the carry generation signal of the i-th pair of arithmetic signals received by the x-level carry operation module, and the x-level carry transfer signal is the carry transfer signal of the i-th pair of arithmetic signals received by the x-level carry operation module.
[0009] In a second aspect, the present application further provides a carry cascade circuit, comprising:
[0010] Z cascade-connected carry logic circuits as described in the first aspect above, the carry output module of each level of the carry logic circuit is used to receive the first carry signal output by the previous level of the carry logic circuit, the Yth level carry generation signal and the Yth level carry transmission signal of the current level of the carry logic circuit, and output the first carry signal of the current level of the carry logic circuit according to the carry operation strategy.
[0011] In a third aspect, the present application also provides a chip, comprising the carry logic circuit of the first aspect mentioned above.
[0012] The carry logic circuit, carry cascade circuit and chip provided by the present application respectively input the Y×i pairs of arithmetic signals in the logical operation into the Y-level carry operation modules, so that each level of the carry operation module calculates the carry transfer signal and carry generation signal of the i-th pair of arithmetic signals received by it according to the preset carry generation operation strategy. Based on this, the carry transfer signal and carry generation signal output by the Y-level carry operation module are the carry transfer signal and carry generation signal of the last pair of arithmetic signals in the Y×i pairs of arithmetic signals. The carry output module only needs to calculate the first carry output signal according to the initial carry signal, the carry transfer signal and carry generation signal output by the Y-level carry operation module. The first carry output signal is the carry signal finally obtained after the Y×i pairs of arithmetic signals are logically operated. The carry logic circuit provided in the embodiment of the present application compresses the carry chain of logic values of arbitrary bit width to one level through a cascade-connected multi-level carry operation module and a carry output module connected to the carry operation module, thereby reducing the carry delay of the carry operation during the logic operation process and improving the carry operation performance of the carry logic circuit.
[0013] These and other aspects of the present application will become more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0015] Figure 1 A schematic diagram of a traditional carry logic circuit is shown.
[0016] Figure 2 A module schematic diagram of a carry logic circuit provided in an embodiment of the present application is shown.
[0017] Figure 3 Another module schematic diagram of the carry logic circuit provided in an embodiment of the present application is shown.
[0018] Figure 4 A structural schematic diagram of a carry logic circuit provided in an embodiment of the present application is shown.
[0019] Figure 5 Another structural schematic diagram of the carry logic circuit provided in an embodiment of the present application is shown.
[0020] Figure 6 Another structural schematic diagram of the carry logic circuit provided in an embodiment of the present application is shown.
[0021] Figure 7 Another structural schematic diagram of the carry logic circuit provided in an embodiment of the present application is shown.
[0022] Figure 8 Another structural schematic diagram of the carry logic circuit provided in an embodiment of the present application is shown.
[0023] Fig. 9 Another structural schematic diagram of the carry logic circuit provided in an embodiment of the present application is shown.
[0024] Fig.10 A schematic diagram of a carry cascade circuit provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.
[0026] In the embodiments of the present application, it should be noted that, in this article, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.
[0027] Moreover, the terms "comprises," "comprising," or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0028] In addition, the "plurality" in the embodiments of the present application refers to two or more than two. In view of this, the "plurality" in the embodiments of the present application can also be understood as "at least two". "At least one" can be understood as one or more, for example, one, two or more. For example, including at least one means including one, two or more, and there is no limit on which ones are included. For example, including at least one of A, B and C, then A, B, C, A and B, A and C, B and C, or A, B and C can be included.
[0029] It should be noted that in the embodiments of the present application, "connection" can be understood as electrical connection, and the connection between two electrical components can be a direct or indirect connection between the two electrical components. For example, the connection between A and B can be either a direct connection between A and B or an indirect connection between A and B through one or more other electrical components.
[0030] Figure 1 A schematic diagram of a conventional carry logic circuit is shown, Figure 1 As shown, the conventional carry logic circuit includes a plurality of cascaded lookup tables, the two input terminals of each level of the lookup table are used to receive a pair of arithmetic signals, the output terminal of each level of the lookup table is used to output the logic operation result of the pair of arithmetic signals received by it, the carry input terminal of each level of the lookup table is connected to the carry output terminal of the previous level of the lookup table, and is used to receive the carry signal of the pair of arithmetic signals received by the previous level of the lookup table, and the carry input terminal of the first level of the lookup table is used to receive the initial carry signal. Obviously, in the conventional carry logic circuit, for n arithmetic signals [i: i+n-1] with a bit width of n, it is necessary to calculate the carry values of these n arithmetic signals by cascading n lookup table units, that is, the conventional carry logic circuit requires n levels of carry chains to realize the calculation of the carry values of n arithmetic signals.
[0031] In view of this, an embodiment of the present application provides a carry logic circuit to solve the above technical problem.
[0032] The embodiment of the present application provides a carry logic circuit, Figure 2 A module schematic diagram of a carry logic circuit provided in an embodiment of the present application is shown, such as Figure 2As shown, the carry logic circuit includes Y-level carry operation modules and a carry output module connected in cascade, and each level of the carry operation module is used to receive i pairs of arithmetic signals (such as Figure 2 As shown, A and B are a pair of arithmetic signals), Y>1, i≥1. Optionally, the i pairs of arithmetic signals received by each level of carry operation module are the values of each bit width of the two operands in the logical operation. Exemplarily, for the two operands "1010" and "0011" in the logical operation, assuming i=2, then the first pair of arithmetic signals received by the first level carry operation module are "0" "1", and the second pair of arithmetic signals are "1" "1", and the first pair of arithmetic signals received by the second level carry operation module are "0" "0", and the second pair of arithmetic signals are "1" "0".
[0033] The first-level carry operation module is used to output a first-level carry generation signal according to a preset carry generation operation strategy, and to output a first-level carry transfer signal according to a preset carry transfer operation strategy, i≥1. The x-th level carry operation module is also used to receive a previous level carry generation signal and a previous level carry transfer signal, output an x-th level carry generation signal according to the carry generation operation strategy, and output an x-th level carry transfer signal according to the carry transfer operation strategy, 2≤x≤Y. Among them, the first-level carry generation signal is the carry generation signal of the i-th pair of arithmetic signals received by the first-level carry operation module, and the first-level carry transfer signal is the carry transfer signal of the i-th pair of arithmetic signals received by the first-level carry operation module; the x-th level carry generation signal is the carry generation signal of the i-th pair of arithmetic signals received by the x-th level carry operation module, and the x-th level carry transfer signal is the carry transfer signal of the i-th pair of arithmetic signals received by the x-th level carry operation module.
[0034] The carry output module is used to receive a preset initial carry signal, a Y-th level carry occurrence signal and a Y-th level carry transfer signal, and output a first carry signal according to a preset carry operation strategy.
[0035] The carry logic circuit provided in the embodiment of the present application inputs the Y×i pairs of arithmetic signals in the logical operation into Y-level carry operation modules respectively, so that each level of carry operation module calculates the carry transfer signal and carry generation signal of the i-th pair of arithmetic signals received in the i pairs of arithmetic signals according to the preset carry generation operation strategy. Based on this, the carry transfer signal and carry generation signal output by the Y-th level carry operation module are the carry transfer signal and carry generation signal of the last pair of arithmetic signals in the Y×i pairs of arithmetic signals. The carry output module only needs to calculate the first carry output signal based on the initial carry signal, the carry transfer signal and carry generation signal output by the Y-th level carry operation module. The first carry output signal is the carry signal finally obtained after the Y×i pairs of arithmetic signals are logically operated. The carry logic circuit provided in the embodiment of the present application compresses the carry chain of logic values of arbitrary bit width to one level through a cascade-connected multi-level carry operation module and a carry output module connected to the carry operation module, thereby reducing the carry delay of the carry operation during the logic operation process and improving the carry operation performance of the carry logic circuit.
[0036] It can be understood that, for a programmable logic circuit, the executable logic operations thereof include at least addition, subtraction, comparison of input values for equality, logical AND, logical OR, logical XOR and other operation rules.
[0037] Next, the carry generation operation strategy, carry propagation operation strategy and carry operation strategy provided in the embodiments of the present application are described.
[0038] Optionally, in the embodiment of the present application, the preset carry generation and transmission strategy is implemented based on the following formula (1):
[0039] propagate k =(A k ^B k )&propagate k-1 , k = [1:Y×i] (1);
[0040] Among them, propagate k Propagate the carry signal of the kth pair of arithmetic signals, k-1 A is the carry transfer signal of the k-1th pair of arithmetic signals. k and B k is the kth pair of arithmetic signals, “^” is the logical exclusive OR operator, and & is the logical AND operator.
[0041] The preset carry generation strategy is implemented based on the following formula (2):
[0042] generate k =(A k ^B k)? generate k-1 :A k / B k , k = [1: Y × i] (2);
[0043] Among them, generate k Generates the carry signal for the kth pair of arithmetic signals. k-1 A is the carry signal of the k-1th pair of arithmetic signals. k and B k is the kth pair of arithmetic signals, “^” is the logical XOR operator, A k / B k A k and B k One of them,?: is a ternary operator, which means if (A k ^B k ) is true, generate k-1 Assign to generate k , if. (A k ^B k ) is false, then A k / B k Assign to generate k .
[0044] The preset carry operation strategy is implemented based on the following formula (3):
[0045] Cout k =propagate k ? Cin:generate k , k = [1: Y × i] (3);
[0046] Among them, Cout k is the carry signal of the 1st to kth pair of arithmetic signals, propagate k The carry transfer signal of the kth pair of arithmetic signals, Cin is the preset initial carry signal, that is, the carry signal set for the first pair of arithmetic signals in the carry operation, generate k Is the carry signal of the kth pair of arithmetic signals generated? : It is a ternary operator symbol, indicating that if propagate k If true, Cin is assigned to Cout k If propagate k If false, generate k Assign to Cout k .
[0047] Optionally, in the above formula (1), formula (2) and formula (3), when k=1, that is, for the first pair of arithmetic signals of the first-stage carry operation module, the carry propagation signal is implemented based on the following formula (4) or formula (5):
[0048] propagate1=(A1^B1)(4);
[0049] propagate1=(A1^B1)&1(5);
[0050] Wherein, propagate1 is the carry propagation signal of the first pair of arithmetic signals, A1^B1 is the logical exclusive OR operation result of the first pair of arithmetic signals A1 and B1, and & is the logical AND operation symbol.
[0051] The carry signal is realized based on the following formula (6):
[0052] generate1=A1∧B1?1′b0:B1(6);
[0053] Wherein, generate1 is the carry generation signal of the first pair of arithmetic signals, A1^B1 is the XOR operation result of the first pair of arithmetic signals A1 and B1, 1′b0 is a binary number 1 or a binary number 0, and ?: is a ternary operation symbol.
[0054] In some embodiments, Figure 3 Another module schematic diagram of the carry logic circuit provided in the embodiment of the present application is shown, such as Figure 3 As shown, in the carry logic circuit provided in the embodiment of the present application, the carry output module is also used to receive j pairs of arithmetic signals, to execute a carry operation strategy on the received j pairs of arithmetic signals, the initial carry signal, the Yth level carry generation signal and the Yth level carry transfer signal, and to output a second carry signal.
[0055] The carry logic circuit provided in the embodiment of the present application can also calculate the carry generation signal and carry propagation signal of the last j pairs of arithmetic signals in sequence for the carry operation in the logical operation process of two operands of multi-bit width through the carry output module, and calculate the second carry signal according to the carry generation signal, carry propagation signal and initial carry signal of the last pair of arithmetic signals, and the second carry signal is the carry value of the two operands of multi-bit width. For example, for two operands with a bit width of Y×i+j, the embodiment of the present application obtains the carry generation signal and carry transfer signal of the Y×ith pair of arithmetic signals through a Y-level carry operation module, and calculates the carry generation signal and carry transfer signal of the Y×i+jth pair of arithmetic signals through a carry output module, and calculates the carry value of the two operands with a bit width of Y×i+j through the carry output module. Based on this, the embodiment of the present application can place the operation of the carry generation signal and carry transfer signal of multiple pairs of arithmetic signals in the carry output module, thereby reducing the cascade number of carry operation modules, further reducing the carry operation timing, and saving circuit resources.
[0056] It can be understood that in the embodiment of the present application, the first carry signal and the second carry signal have the same meaning, and both represent the final carry signal obtained by performing a carry operation on a multi-bit-wide arithmetic value.
[0057] In some embodiments, Figure 4 and Figure 5 Two structural schematic diagrams of the carry logic circuit provided in the embodiments of the present application are shown respectively, such as Figure 4 and Figure 5 As shown, in the carry logic circuit provided in the embodiment of the present application, each carry operation module includes a first lookup table unit, and each first lookup table unit includes at least 2i+1 signal input terminals, a signal output terminal, a carry input terminal and a carry output terminal.
[0058] In the first-level carry operation module, the 2i signal input terminals of the first lookup table unit are used to receive i pairs of arithmetic signals, the signal output terminal of the first lookup table unit is used to output the first-level carry transfer signal, and the carry output terminal of the first lookup table unit is used to output the first-level carry generation signal. In the x-level carry operation module, the 2i+1 signal input terminals of the first lookup table unit are used to receive i pairs of arithmetic signals and the previous-level carry transfer signal, the carry input terminal of the first lookup table unit is used to receive the previous-level carry generation signal, the carry output terminal of the first lookup table unit is used to output the x-level carry generation signal, and the signal output terminal of the first lookup table unit is used to output the x-level carry transfer signal. Optionally, in the first-level carry operation module, it is not necessary to receive the carry generation signal and the carry transfer signal.
[0059] Next, Figure 4 and Figure 5The ports of the first lookup table unit illustrate the carry generation operation strategy and the carry propagation operation strategy.
[0060] Optionally, in the embodiment of the present application, for the first lookup table unit, the preset carry propagation operation strategy is implemented based on the following formula (7):
[0061] Z=(I0^I1)&(I2^I3)&I4(7);
[0062] The preset carry generation operation strategy is implemented based on the following formula (8):
[0063] COUT=I2∧I3? (I0∧I1?CIN:I1):I3(8);
[0064] Wherein, for formulas (7) and (8), Z is the signal output terminal of the first lookup table unit, COUT is the carry output terminal of the first lookup table unit, I0, I1, I2, I3, and I4 are respectively the four signal input terminals of the first lookup table unit, and CIN is the carry input terminal of the first lookup table unit.
[0065] Optionally, for the first-level carry operation module, in the above formula (7), I4 can be configured as a binary number 1, or configured as an idle state, that is, I4 is not connected in the circuit. In the above formula (8), CIN can be configured as a binary number 1 or a binary number 0, or CIN can be configured as an idle state, that is, CIN is not connected in the circuit.
[0066] It can be understood that the above formulas (7) and (8) are essentially the same as the above formulas (1) and (2). The difference is that formulas (7) and (8) use the port of the first lookup table unit to represent the carry propagation operation strategy and the carry generation operation strategy. Substituting the port input signal into formulas (7) and (8) can obtain the above formulas (1) and (2).
[0067] It is understandable that in the embodiments of the present application, Figure 4 and Figure 5 The structural schematic diagram of the carry logic circuit shown only shows the implementation method of the carry operation module provided in the embodiment of the present application when i=2 and the lookup table is LUT6. However, in fact, the carry operation module provided in the embodiment of the present application does not limit the input level of the lookup table and the value of i, where the value of i is determined according to the computing power of the lookup table. Specifically, two LUTs (2n) can calculate the carry generation signal and the carry transfer signal of n pairs of arithmetic signals.
[0068] In some embodiments, Figure 6 and Figure 7 Two structural schematic diagrams of the carry logic circuit provided in the embodiments of the present application are shown respectively, such as Figure 6 and Figure 7 As shown, in the carry logic circuit provided in the embodiment of the present application, each second lookup table unit and each third lookup table unit includes at least 2i signal input terminals, a carry input terminal and a carry output terminal.
[0069] In the first-level carry operation module, the 2i signal input terminals of the second lookup table unit are used to receive i pairs of arithmetic signals, and the carry output terminal of the second lookup table unit is used to output the first-level carry generation signal. The 2i signal input terminals of the third lookup table unit and the first-level carry transfer signal. In the x-level carry operation module, the 2i signal input terminals of the second lookup table unit are used to receive i pairs of arithmetic signals, the carry input terminal of the second lookup table unit is used to receive the previous-level carry generation signal, and the carry output terminal of the second lookup table unit is used to output the x-level carry generation signal; the 2i signal input terminals of the third lookup table unit and the second lookup table unit multiplex i pairs of arithmetic signals, the carry input terminal of the third lookup table unit is used to receive the previous-level carry transfer signal, and the carry output terminal of the third lookup table unit is used to output the x-level carry transfer signal. Optionally, the first-level carry operation module does not need to receive the carry generation signal and the carry transfer signal.
[0070] Next, Figure 6 and Figure 7 The ports of the second lookup table unit describe the carry propagation operation strategy of the second lookup table unit and the carry generation operation strategy of the third lookup table unit.
[0071] Optionally, in the embodiment of the present application, for the second lookup table unit, the preset carry propagation operation strategy is implemented based on the following formula (9):
[0072] COUT=(I0^I1)&(12^13)&CIN(9);
[0073] Wherein, for formula (9), COUT is the carry output terminal of the second lookup table unit, I0, I1, I2, and I3 are respectively four signal input terminals of the second lookup table unit, and CIN is the carry input terminal of the second lookup table unit.
[0074] Optionally, for the first-stage carry operation module, in the above formula (9), CIN can be configured as a binary number 1, or CIN can be configured as an idle state, that is, CIN has no wiring in the circuit.
[0075] In the embodiment of the present application, for the third lookup table unit, the preset carry generation operation strategy is implemented based on the following formula (10):
[0076] COUT=I2∧I3? (I0∧I1?CIN:I1):I3(10);
[0077] Wherein, for formula (10), COUT is the carry output terminal of the third lookup table unit, I0, I1, I2, and I3 are respectively four signal input terminals of the third lookup table unit, and CIN is the carry input terminal of the third lookup table unit.
[0078] Optionally, for the first-level carry operation module, in the above formula (10), CIN can be configured as a binary number 1 or a binary number 0, or CIN can be configured as an idle state, that is, CIN has no wiring in the circuit.
[0079] It can be understood that the above formulas (9) and (10) are essentially the same as the above formulas (1) and (2). The difference is that formulas (9) and (10) use the ports of the second lookup table unit and the third lookup table to represent the carry propagation operation strategy and the carry generation operation strategy respectively. Substituting the port input signals into formulas (9) and (10) can obtain the above formulas (1) and (2).
[0080] It is understandable that in the embodiments of the present application, Figure 6 and Figure 7 The structural schematic diagram of the carry logic circuit shown only shows the implementation method of the carry operation module provided in the embodiment of the present application when i=2 and the lookup table is LUT6. However, in fact, the carry operation module provided in the embodiment of the present application does not limit the input level of the lookup table and the value of i, where the value of i is determined according to the computing power of the lookup table. Specifically, two LUTs (2n) can calculate the carry generation signal and the carry transfer signal of n pairs of arithmetic signals.
[0081] It is understandable that in the embodiments of the present application, Figure 6 and Figure 7 The carry logic circuit shown in the figure outputs the carry propagation signal and the carry generation signal through the carry output port of the lookup table. In practical application, it can also be set to output the carry propagation signal and the carry generation signal through the signal output port of the lookup table. For example, Figure 8 FIG. 1 shows another structural schematic diagram of the carry logic circuit provided in an embodiment of the present application. Taking the two operands with a bit width of 4 as an example, that is, there are four pairs of arithmetic signals, as shown in FIG. Figure 8 In the carry logic circuit shown, the carry operation module is a first-level one, and the carry operation module outputs the carry generation signal and the carry transfer signal of the third pair of arithmetic signals through the signal output ends of two LUT6s (six-input lookup tables), and the carry output module includes a LUT6. The carry output module receives the initial carry signal, the fourth pair of arithmetic signals, the carry generation signal and the carry transfer signal of the third pair of arithmetic signals output by the carry operation module through the carry input end and four signal input ends, calculates the carry signal of the carry operation of the four pairs of arithmetic signals, and outputs it through its carry output port.
[0082] like Figure 8 As shown in the figure, in the carry operation module, the carry propagation operation strategy is expressed through the port as follows:
[0083] Z=(I0∧I1)&(12∧13)&(14∧15)(11);
[0084] Wherein, in formula (11), Z is the signal output terminal of LUT6A, and I0, I1, I2, I3, I4, and I5 are six signal input terminals of LUT6A.
[0085] like Figure 8 As shown, in the carry operation module, the carry operation strategy is expressed through the port as follows:
[0086] Z=I4∧I5? (I3∧I2?(I0∧I1?0:I1):I2):I5(12)
[0087] Wherein, in formula (12), Z is the signal output terminal of LUT6B, and I0, I1, I2, I3, I4, and I5 are the six signal input terminals of LUT6B.
[0088] like Figure 8 As shown in the figure, in the carry output module, the carry operation strategy is expressed through the port as follows:
[0089] COUT=I0∧I1&I2?Cin i :(I0∧I1?I3:I1)(13)
[0090] Among them, in formula (13), COUT is the carry output terminal of LUT6C, and I0, I1, I2, and I3 are the four signal input terminals of LUT6C.
[0091] It can be understood that the above formulas (11) and (12) are essentially the same as the above formulas (1) and (2). The difference is that formulas (11) and (12) use the ports of the lookup table LUT6A and the ports of the lookup table LUT6B to represent the carry propagation operation strategy and the carry generation operation strategy, respectively. Substituting the port input signals into formulas (11) and (12) can obtain the above formulas (1) and (2).
[0092] The above formula (13) uses the port of the lookup table LUT6C to represent the carry operation strategy. Substituting the signal input to the port into formula (11) and formula (12) can obtain the above formula (3).
[0093] In some embodiments, Fig. 9 Another structural schematic diagram of the carry logic circuit provided in the embodiment of the present application is shown. Fig. 9As shown, in the carry logic circuit provided in the embodiment of the present application, each carry operation module includes i first combinational logic units and i second combinational logic units.
[0094] Each first combination logic unit includes a first XOR unit and a first selection unit, wherein two input terminals of the first XOR unit are used to receive a pair of arithmetic signals, and one of the input terminals of the first XOR unit is also connected to an input terminal of the first selection unit (used to receive one of the pair of arithmetic signals), and the output terminal of the first XOR unit is connected to the selection terminal of the first selection unit; the other input terminal of the first selection unit is connected to the output terminal of the first selection unit of the previous first combination logic unit. Optionally, the first combination logic unit is used to implement the carry generation operation strategy described in the above formula (2) through a logic circuit formed by combining an XOR gate and a selector.
[0095] Wherein, in the first-stage carry operation module, another input end of the first selection unit of the first first combinational logic unit is used to receive a preset selection signal. Optionally, the preset selection signal (1′b0) is either a binary number 1 or a binary number 0, and the first first combinational logic unit of the first-stage carry operation module is used to implement the carry generation operation strategy described in the above formula (6).
[0096] Each second combinational logic unit includes an AND unit and a second XOR unit, one input end of the AND unit is connected to the output end of the AND unit of the previous second combinational logic unit, the other input end of the AND unit is connected to the output end of the second XOR unit, and the two input ends of the XOR unit are used to receive a pair of arithmetic signals. Optionally, the second combinational logic unit is used to implement the carry propagation operation strategy described in the above formula (1) through a logic circuit formed by an XOR gate and an AND gate.
[0097] Wherein, in the first-level carry operation module, the first second combinational logic unit further includes a third XOR unit, two input ends of the third XOR unit are used to receive a pair of arithmetic signals, and the output end of the third XOR unit is connected to an input end of the unit. Optionally, the third XOR unit of the first second combinational logic unit of the first-level carry operation module is used to implement the carry propagation operation strategy described in the above formula (4).
[0098] It can be understood that in the embodiment of the present application, the first XOR unit and the second XOR unit are used to indicate a logic circuit that can perform an XOR operation, that is, the first XOR unit and the second XOR unit can be the same logic circuit, or can be a logic circuit with different hardware but the same function. The purpose of using the first XOR unit and the second XOR unit here is to distinguish between the first combinational logic unit and the second combinational logic unit.
[0099] It can be understood that the embodiment of the present application constructs the following through logic gates: Fig. 9 The carry logic circuit shown in Fig. 9 When the carry logic circuit shown is applied to a programmable logic device chip, a synthesis tool should also be used to map each logic gate into a logic circuit supported by the programmable logic device. Fig. 9 When the carry logic circuit shown in the figure is applied to FPGA chip, the FLGA synthesis tool should be used to map each logic gate to a logic circuit supported by FPGA, such as LUT (lookup table), specific CARRY (carry circuit), etc. That is, when the carry logic circuit shown in the figure is applied to a programmable logic device chip, it will be mapped as follows Figures 4 to 7 The carry logic circuit shown.
[0100] In some embodiments, Figure 4 , Figure 6 As shown, in the carry logic circuit provided in the embodiment of the present application, the carry output module includes:
[0101] The fourth lookup table unit includes at least two signal input terminals, a carry input terminal and a carry output terminal. The two signal input terminals of the fourth lookup table unit are respectively used to receive the Y-th level carry occurrence signal and the Y-th level carry transfer signal. The carry input terminal of the fourth lookup table unit is used to receive the initial carry signal, and the carry output terminal of the fourth lookup table unit is used to output the first carry signal.
[0102] Next, Figure 4 , Figure 6 The carry operation strategy of the fourth lookup table unit is described for each port.
[0103] Optionally, in the embodiment of the present application, for the fourth lookup table unit, the preset carry operation strategy is implemented based on the following formula (14):
[0104] COUT = I2? CIN: I3 (14);
[0105] In formula (14), COUT is the signal output terminal of the fourth lookup table unit, I2 and I3 are two signal input terminals of the fourth lookup table unit, and CIN is the carry input terminal of the fourth lookup table unit.
[0106] It can be understood that the above formula (14) is essentially the same as the aforementioned formula (3), the difference being that formula (13) uses the port of the fourth lookup table unit to represent the carry propagation operation strategy and the carry generation operation strategy, and the aforementioned formula (3) can be obtained by substituting the signal input by the port into formula (14).
[0107] In some embodiments, Figure 5 , Figure 7As shown, in the carry logic circuit provided in the embodiment of the present application, the carry output module includes:
[0108] The fifth lookup table unit includes at least j+2 signal input terminals, a carry input terminal and a carry output terminal. The j+2 signal input terminals of the fifth lookup table unit are respectively used to receive j pairs of arithmetic signals, the Yth level carry generation signal and the Yth level carry transfer signal. The carry input terminal of the fifth lookup table unit is used to receive an initial carry signal, and the carry output terminal of the fifth lookup table unit is used to output a second carry signal.
[0109] Optionally, in the embodiment of the present application, for the fifth lookup table unit, the preset carry operation strategy is implemented based on the following formula (15):
[0110] COUT=I0∧I1&I2?Cin i :(I0∧I1?I3:I1)(14);
[0111] Wherein, for formula (15), COUT is the signal output terminal of the fifth lookup table unit, I0, I1, I2, and I3 are respectively the four signal input terminals of the fourth lookup table unit, and CIN is the carry input terminal of the fifth lookup table unit.
[0112] It can be understood that the above formula (15) is essentially the same as the above formula (3), wherein I0^I1&I2 is the carry transfer signal of the i-th pair of arithmetic signals received by the carry output module, and I0^I1?I3:I1 is the carry generation signal of the i-th pair of arithmetic signals received by the carry output module.
[0113] It is understandable that in the embodiments of the present application, Figures 4 to 7 The structural schematic diagram of the carry logic circuit shown only shows the implementation method of the carry output module provided in the embodiment of the present application when j=1 and the lookup table is LUT6. However, in fact, the carry output module provided in the embodiment of the present application does not limit the input level of the lookup table and the value of j, where the value of j is determined according to the computing power of the lookup table. Specifically, two LUTs (2n) can calculate the carry generation signal and the carry transfer signal of n pairs of arithmetic signals.
[0114] In some embodiments, Fig. 9 As shown, in the carry logic circuit provided in the embodiment of the present application, the carry output module includes:
[0115] A second selection unit, a selection end of the second selection unit is used to receive the Y-th level carry transfer signal, an input end of the second selection unit is used to receive the Y-th level carry occurrence signal, another input end of the second selection unit is used to receive the initial carry signal, and an output end of the second selection unit is used to output the first carry signal. Optionally, the second selection unit is used to implement the carry operation strategy described in the above formula (3) through a selector.
[0116] It can be understood that in the embodiment of the present application, the first selection unit and the second selection unit are used to indicate a logic circuit that can execute the selection logic, that is, the first selection unit and the second selection unit can be the same logic circuit, or can be a logic circuit with different hardware but the same function. The purpose of using the first selection unit and the second selection unit here is to distinguish the first combinational logic unit from the carry output module.
[0117] The carry logic circuit provided in the embodiment of the present application inputs the Y×i pairs of arithmetic signals in the logical operation into Y-level carry operation modules respectively, so that each level of carry operation module calculates the carry transfer signal and carry generation signal of the i-th pair of arithmetic signals received in the i pairs of arithmetic signals according to the preset carry generation operation strategy. Based on this, the carry transfer signal and carry generation signal output by the Y-th level carry operation module are the carry transfer signal and carry generation signal of the last pair of arithmetic signals in the Y×i pairs of arithmetic signals. The carry output module only needs to calculate the first carry output signal based on the initial carry signal, the carry transfer signal and carry generation signal output by the Y-th level carry operation module. The first carry output signal is the carry signal finally obtained after the Y×i pairs of arithmetic signals are logically operated. The carry logic circuit provided in the embodiment of the present application compresses the carry chain of logic values of arbitrary bit width to one level through a cascade-connected multi-level carry operation module and a carry output module connected to the carry operation module, thereby reducing the carry delay of the carry operation during the logic operation process and improving the carry operation performance of the carry logic circuit.
[0118] Furthermore, the embodiments of the present application can place the operations of carry generation signals and carry transfer signals of multiple pairs of arithmetic signals in the carry output module, thereby reducing the cascade number of carry operation modules, further reducing the carry operation timing, and saving circuit resources.
[0119] The embodiment of the present application also provides a carry cascade circuit, Fig.10 FIG. 4 shows a schematic diagram of a carry cascade circuit provided in an embodiment of the present application, such as Fig.10As shown, the carry cascade circuit includes Z cascade-connected carry logic circuits as described in the above embodiment, and the carry output module of each level of the carry logic circuit is used to receive the first carry signal output by the previous level of the carry logic circuit, the Yth level carry generation signal and the Yth level carry transfer signal of the current level of the carry logic circuit, and outputs the first carry signal of the current level of the carry logic circuit according to the carry operation strategy.
[0120] The carry cascade circuit provided in the embodiment of the present application can compress the carry chain to 1 / Z for logical operations on two operands of multi-bit width according to design requirements, thereby reducing the timing of the carry operation and improving the carry operation performance of the carry logic circuit.
[0121] The embodiment of the present application also provides a chip, which includes the above-mentioned carry logic circuit. A chip (Integrated Circuit, IC) is also called a chip, and the chip can be, but is not limited to, a SOC (System on Chip) chip or a SIP (system in package) chip.
[0122] The above contents are further detailed descriptions of the present application in combination with specific implementation methods, and it cannot be determined that the specific implementation of the present application is limited to these descriptions. For ordinary technicians in the technical field to which the present application belongs, several simple deductions or substitutions can be made without departing from the concept of the present application, which should be regarded as the protection scope of the present application.
Claims
1. A carry logic circuit, characterized in that: It includes Y-level carry operation modules and a carry output module connected in cascade, and each level of the carry operation module is used to receive i pairs of arithmetic signals, Y>1, i≥1; The first-level carry operation module is used to output the first-level carry generation signal according to the preset carry generation operation strategy, and output the first-level carry transfer signal according to the preset carry transfer operation strategy; The x-th level carry operation module is further used to receive the previous level carry generation signal and the previous level carry transfer signal, output the x-th level carry generation signal according to the carry generation operation strategy, and output the x-th level carry transfer signal according to the carry transfer operation strategy, 2≤x≤Y; The carry output module is used to receive a preset initial carry signal, a Y-th level carry occurrence signal and a Y-th level carry transfer signal, and output a first carry signal according to a preset carry operation strategy; Among them, the first-level carry generation signal is the carry generation signal of the i-th pair of arithmetic signals received by the first-level carry operation module, and the first-level carry transfer signal is the carry transfer signal of the i-th pair of arithmetic signals received by the first-level carry operation module; the x-level carry generation signal is the carry generation signal of the i-th pair of arithmetic signals received by the x-level carry operation module, and the x-level carry transfer signal is the carry transfer signal of the i-th pair of arithmetic signals received by the x-level carry operation module.
2. The carry logic circuit according to claim 1, wherein: The carry output module is also used to receive j pairs of arithmetic signals to execute the carry operation strategy on the received j pairs of arithmetic signals, the initial carry signal, the Yth level carry occurrence signal and the Yth level carry transfer signal to output a second carry signal, j≥1.
3. The carry logic circuit according to claim 1 or 2, characterized in that: Each of the carry operation modules comprises a first lookup table unit, and each of the first lookup table units comprises at least 2i+1 signal input terminals, a signal output terminal, a carry input terminal and a carry output terminal; In the first-level carry operation module, the 2i signal input terminals of the first lookup table unit are used to receive i pairs of arithmetic signals, the signal output terminal of the first lookup table unit is used to output the first-level carry transfer signal, and the carry output terminal of the first lookup table unit is used to output the first-level carry occurrence signal; In the x-th level carry operation module, the 2i+1 signal input ends of the first lookup table unit are used to receive i pairs of arithmetic signals and the previous level carry transfer signal, the carry input end of the first lookup table unit is used to receive the previous level carry generation signal, the carry output end of the first lookup table unit is used to output the x-th level carry generation signal, and the signal output end of the first lookup table unit is used to output the x-th level carry transfer signal.
4. The carry logic circuit according to claim 1 or 2, characterized in that: Each of the carry operation modules comprises a second lookup table unit and a third lookup table unit, and each of the second lookup table unit and each of the third lookup table units comprises at least 2i signal input terminals, a carry input terminal and a carry output terminal; In the first-stage carry operation module, the 2i signal input terminals of the second lookup table unit are used to receive i pairs of arithmetic signals, and the carry output terminal of the second lookup table unit is used to output the first-stage carry occurrence signal; 2i signal input terminals of the third lookup table unit and the first stage carry transfer signal; In the x-th level carry operation module, the 2i signal input terminals of the second lookup table unit are used to receive i pairs of arithmetic signals, the carry input terminal of the second lookup table unit is used to receive the previous level carry occurrence signal, and the carry output terminal of the second lookup table unit is used to output the x-th level carry occurrence signal; The 2i signal input ends of the third lookup table unit multiplex i pairs of arithmetic signals with the second lookup table unit, the carry input end of the third lookup table unit is used to receive the carry transfer signal of the previous stage, and the carry output end of the third lookup table unit is used to output the carry transfer signal of the xth stage.
5. The carry logic circuit according to claim 1 or 2, characterized in that: Each of the carry operation modules includes i first combinational logic units and i second combinational logic units; Each of the first combination logic units includes a first XOR unit and a first selection unit, wherein two input terminals of the first XOR unit are used to receive a pair of arithmetic signals, and one of the input terminals of the first XOR unit is also connected to an input terminal of the first selection unit, and the output terminal of the first XOR unit is connected to the selection terminal of the first selection unit; the other input terminal of the first selection unit is connected to the output terminal of the first selection unit of the previous first combination logic unit; Wherein, in the first-stage carry operation module, another input end of the first selection unit of the first combinational logic unit is used to receive a preset selection signal; Each of the second combination logic units includes an AND unit and a second XOR unit, one input end of the AND unit is connected to the output end of the AND unit of the previous second combination logic unit, the other input end of the AND unit is connected to the output end of the second XOR unit, and the two input ends of the XOR unit are used to receive a pair of arithmetic signals; Among them, in the first-level carry operation module, the first of the second combinational logic units also includes a third XOR unit, two input ends of the third XOR unit are used to receive a pair of arithmetic signals, and the output end of the third XOR unit is connected to one input end of the AND unit.
6. The carry logic circuit according to claim 1, wherein: The carry output module comprises: A fourth lookup table unit, the fourth lookup table unit comprises at least two signal input terminals, a carry input terminal and a carry output terminal, the two signal input terminals of the fourth lookup table unit are respectively used to receive the Y-th level carry occurrence signal and the Y-th level carry transfer signal, the carry input terminal of the fourth lookup table unit is used to receive the initial carry signal, and the carry output terminal of the fourth lookup table unit is used to output the first carry signal.
7. The carry logic circuit according to claim 1, wherein: The carry output module comprises: A second selection unit, wherein the selection end of the second selection unit is used to receive the Y-th level carry transfer signal, an input end of the second selection unit is used to receive the Y-th level carry generation signal, another input end of the second selection unit is used to receive the initial carry signal, and the output end of the second selection unit is used to output the first carry signal.
8. The carry logic circuit according to claim 2, wherein: The carry output module comprises: A fifth lookup table unit, the fifth lookup table unit comprises at least j+2 signal input terminals, a carry input terminal and a carry output terminal, the j+2 signal input terminals of the fifth lookup table unit are respectively used to receive j pairs of arithmetic signals, the Y-th level carry generation signal and the Y-th level carry transfer signal, the carry input terminal of the fifth lookup table unit is used to receive the initial carry signal, and the carry output terminal of the fifth lookup table unit is used to output the second carry signal.
9. A carry cascade circuit, characterized in that: include: Z cascade-connected carry logic circuits as described in any one of claims 1 to 8, the carry output module of each level of the carry logic circuit is used to receive the first carry signal output by the previous level of the carry logic circuit, the Yth level carry generation signal and the Yth level carry transmission signal of the current level of the carry logic circuit, and output the first carry signal of the current level of the carry logic circuit according to the carry operation strategy, Z>1.
10. A chip, characterized in that: The invention comprises the carry logic circuit as described in any one of claims 1 to 8.
Citation Information
Cited By
Carry logic circuit, carry cascade circuit, and chip
WO2026032303A1
