Detailed Description
In an embodiment of the present invention, the adder may add one addend and another addend of its ith bit according to the following formula,
And (3) making:
Gi=Ai*Bi (3)
Then:
Ci+1=Gi+Pi*Ci (5)
Wherein Ai is one addend of the ith bit, Bi is the other addend of the ith bit, Ci is the carry input signal of the ith bit, Si is the sum of the addition of the ith bit, Gi is the carry generation signal of the ith bit, Pi is the carry propagation signal of the ith bit, Ci+1 is the carry output signal of the ith bit, i.e. the carry input signal of the (i+1) th bit, and i is an integer greater than or equal to 1.
A one-bit wide arithmetic carry logic block may be implemented by two look-up tables, for example, the existing look-up table circuit structure shown in fig. 1 may be changed to a one-bit wide arithmetic carry logic block. Specifically, one addend ai and the other addend Bi are transferred from two of the five address input ports IN (1) -IN (5) to the first five input look-up table LUT (5) -a, which generates a carry generation signal Gi and outputs to the first output port OUT5; one addend ai and the other addend Bi are transferred from two of the five address input ports IN (1) -IN (5) to a second five input look-up table LUT (5) -B which generates a carry propagate signal Pi which is output via a selector MUX to a second output port OUT6.
In an embodiment of the present invention, the lookup table circuit includes two n-input lookup tables, six multiplexers, two adders, and a plurality of input ports, and the lookup table circuit can be selectively applied as one of two n-input lookup tables, one n+1-input lookup table, a two-bit-wide arithmetic carry logic module, and a one-bit-wide arithmetic carry logic module by controlling outputs of the multiplexers, respectively.
In embodiments of the present invention, the look-up table circuitry may be implemented as an arithmetic carry logic block, thereby reducing the reliance of small scale operations on Digital Signal Processing (DSP) resources.
In embodiments of the present invention, the look-up table circuit may be implemented as an arithmetic carry logic block and may perform a bit-wide or one-bit-wide carry operation.
Compared with an arithmetic carry logic module with one bit width realized by two lookup tables, the lookup table circuit provided by the embodiment of the invention can realize carry operation with two bits width based on the same number of lookup tables, thereby not only having more efficient arithmetic carry logic function, but also improving the utilization rate of the lookup tables.
In the embodiment of the invention, the first adder and the second adder which respectively realize low-order and high-order operations in the lookup table circuit respectively multiplex one address input port and the other address input port of the two n-input lookup tables without additionally increasing the input ports of the lookup table circuit, thereby saving the port resources of the lookup table circuit.
In the embodiment of the invention, the lookup table circuit outputs the second carry output signal through the existing port output signal, for example, outputs the second carry output signal through the carry output port, outputs the first and output signals through the first output port and outputs the second and output signals through the second output port, so that two-bit wide carry operation is realized, and the signals can be selectively output to a register or other calculation modules without additionally increasing the output port of the lookup table circuit, thereby saving the port resources of the lookup table circuit.
In the embodiment of the invention, the lookup table circuit can also realize one-bit-width carry operation, and when the one-bit-width carry operation is realized, the first n-input lookup table can be independently used, and when the first n-input lookup table is independently used, the newly added and independently used address input port can increase the flexibility of the n-input lookup table to realize logic functions.
In order to make the above objects, features and advantages of the embodiments of the present invention more comprehensible, the following detailed description of specific embodiments of the present invention with reference to the accompanying drawings is provided.
Fig. 2 is a schematic diagram of a lookup table circuit including two n-input lookup tables in an embodiment of the invention.
As shown IN fig. 2, the lookup table circuit 200 includes two first address input ports IN (1A) and IN (1B), second to n+1th address input ports IN (2), … …, IN (n), IN (n+1), a carry input port CIN, a carry output port COUT, a first output port OUT1, and a second output port OUT2, wherein the first address input port has two, the second to n+1th address input ports have one, respectively, and n is an integer greater than or equal to 5.
The lookup table circuit 200 further includes first to sixth multiplexers MUX1, MUX2, MUX3, MUX4, MUX5, and MUX6, first and second n-input lookup table LUTs (n) -1 and LUT (n) -2, and first and second adders adder [0] and adder [1].
The first n-input lookup table LUT (n) -1 and the second n-input lookup table LUT (n) -2 both share the second to n-th address input ports IN (2), … …, IN (n), the first n-input lookup table LUT (n) -1 solely uses one IN (1A) of the two first address input ports IN (1A) and IN (1B) as its address input port, and the second n-input lookup table LUT (n) -2 solely uses the other IN (1B) of the two first address input ports IN (1A) and IN (1B) as its address input port.
The first to nth address input ports IN (1A)/IN (1B), IN (2), … …, IN (n) may receive address signals arranged from low to high, respectively; the received address signals may be input signals of a first n-input look-up table LUT (n) -1 and a second n-input look-up table LUT (n) -2, respectively; the first address input port IN (1A) may be input to the first adder adder [0] via the first multiplexer MUX1, and the first address input port IN (1B) may be input to the second adder adder [1] via the second multiplexer MUX 2; the n+1 address input port IN (n+1) is adapted to receive a high level signal or an address signal and to supply it to the control terminal of the third multiplexer MUX 3.
Carry input port CIN is adapted to receive a carry input signal and provide to first adder adder [0] for calculating a carry output signal and a sum output signal. The carry output port COUT is adapted to output a carry output signal, which may be used as a carry input signal for a next stage of arithmetic logic block.
The first output port OUT1 and the second output port OUT2 output different signals based on different applications of the look-up table circuit 200. When the lookup table circuit 200 is applied as two n-input lookup tables, the first output port OUT1 and the second output port OUT2 may be output ports of the first n-input lookup table LUT (n) -1 and the second n-input lookup table LUT (n) -2, respectively; when the lookup table circuit 200 is applied as an n+1 input lookup table, the second output port OUT2 may be used as the output port of the n+1 input lookup table; when the lookup table circuit 200 is applied as a two-bit wide arithmetic carry logic block, the first output port OUT1 and the second output port OUT2 may be used as output ports for neutralizing the output signal of the first adder adder [0] and the second adder adder [1], respectively; when the lookup table circuit 200 is applied as a one-bit-wide arithmetic carry logic module, the second output port OUT2 can be used as an output port for the neutralization output signal of the second adder adder [1], and at this time, the first n-input lookup table can be independently used, and the first output port OUT1 can be used as an output port of the first n-input lookup table LUT (n) -1.
The first multiplexer MUX1 has three inputs and one output, wherein the first input is grounded, the second input is connected to a power supply voltage, the third input is connected to one IN (1A) of two first address input ports IN (1A) and IN (1B), and the output is connected to the second input of the first adder adder [0 ].
The second multiplexer MUX2 has three inputs and one output, wherein the first input is grounded, the second input is connected to the supply voltage, the third input is connected to the other IN (1B) of the two first address input ports IN (1A) and IN (1B), and the output is connected to the second input of the second adder adder [1].
The third multiplexer MUX3 has two inputs, a control and an output, wherein the first input is connected to the output of the first n-input look-up table LUT (n) -1, the second input is connected to the output of the second n-input look-up table LUT (n) -2, the control is connected to the n+1th address input port IN (n+1), and the output is connected to the first input of the fourth multiplexer MUX 4.
The fourth multiplexer MUX4 has two inputs and an output, wherein the first input is connected to the output of the third multiplexer MUX3, the second input is connected to the first output of the second adder adder [1], and the output is connected to the second output OUT2.
The fifth multiplexer MUX5 has two inputs and one output, wherein a first input is connected to the output of the first n-input look-up table LUT (n) -1, a second input is connected to the first output of the first adder adder [0], and an output is connected to the first output port OUT1.
The sixth multiplexer MUX6 has two inputs and an output, wherein the first input is connected to the supply voltage, the second input is connected to the output of the first n-input look-up table LUT (n) -1, and the output is connected to the third input of the first adder adder [0 ].
The first adder adder has three inputs and two outputs, wherein the first input is connected to the carry input port CIN, the second input is connected to the output of the first multiplexer MUX1, the third input is connected to the output of the sixth multiplexer MUX6, the first output is connected to the second input of the fifth multiplexer MUX5 to output and output the carry output signal, and the second output is connected to the first input of the second adder adder [1 ].
The second adder adder [1] has three input terminals and two output terminals, wherein the first input terminal is connected to the second output terminal of the first adder adder [0], the second input terminal is connected to the output terminal of the second multiplexer MUX2, the third input terminal is connected to the output terminal of the second n-input lookup table LUT (n) -2, the first output terminal is connected to the second input terminal of the fourth multiplexer MUX4 to output and output signals, and the second output terminal is connected to the carry output port COUT to output carry output signals.
In an implementation, the fourth multiplexer MUX4 further has a control terminal, and the look-up table circuit 200 further includes a first static memory SRAM0 connected to the control terminal of the fourth multiplexer MUX 4. The first static memory SRAM0 is adapted to store configuration information, which may comprise a first value or a second value, according to an indication of the control module. The fourth multiplexer MUX4 is adapted to output a signal received at its first input based on the first value and to output a signal received at its second input based on the second value.
Specifically, the first value is one of 0 or 1, and the second value is the other of 0 or 1. For example, the first value may be 0 and the second value may be 1.
When the first static memory SRAM0 is configured to a first value, the fourth multiplexer MUX4 is adapted to output the signal output by the output of the third multiplexer MUX3 received at its first input based on the first value. When the first static memory SRAM0 is configured to a second value, the fourth multiplexer MUX4 is adapted to output the signal output by the first output of the second adder adder [1] received by its second input based on the second value.
In an implementation, the fifth multiplexer MUX5 and the sixth multiplexer MUX6 also have control terminals, respectively, and the look-up table circuit 200 further includes a second static memory SRAM1 connected to the control terminals of both the fifth multiplexer MUX5 and the sixth multiplexer MUX 6. The second static memory SRAM1 is adapted to store configuration information, which may comprise a first value or a second value, according to an indication of the control module. The fifth multiplexer MUX5 is adapted to output a signal received at its first input based on a first value and to output a signal received at its second input based on a second value. The sixth multiplexer MUX6 is adapted to output the signal received at its first input based on the first value and to output the signal received at its second input based on the second value.
Specifically, the first value is one of 0 or 1, and the second value is the other of 0 or 1. For example, the first value may be 0 and the second value may be 1.
When the second static memory SRAM1 is configured to a first value, the fifth multiplexer MUX5 is adapted to output a signal output by the first n-input look-up table LUT (n) -1 received at its first input based on the first value, and the sixth multiplexer MUX6 is adapted to output a high level signal (data "1") received at its first input based on the first value.
When the second static memory SRAM1 is configured to a second value, the fifth multiplexer MUX5 is adapted to output the sum output signal output by the first output terminal of the first adder adder [0] received at its second input terminal based on the second value, and the sixth multiplexer MUX6 is adapted to output the signal output by the first n-input look-up table LUT (n) -1 received at its second input terminal based on the second value.
In an embodiment of the present invention, the lookup table circuit 200 may be selectively applied as one of two n-input lookup tables, one n+1-input lookup table, a two-bit wide arithmetic carry logic module, and a one-bit wide arithmetic carry logic module.
Specifically, the application of the lookup table circuit 200 depends on the configuration of the first static memory SRAM0, the second static memory SRAM1, and the n+1th address input port IN (n+1).
IN an implementation, the look-up table circuit 200 may be applied as two n-input look-up tables when the first static memory SRAM0 is configured to a first value, the second static memory SRAM1 is configured to a first value, and the n+1th address input port IN (n+1) is configured to a high level signal.
When the first static memory SRAM0 is configured to a first value and the n+1 th address input port IN (n+1) is configured to the most significant address signal, the lookup table circuit 200 may be applied as an n+1 input lookup table. Further, when the second static memory SRAM1 is configured to the first value, the lookup table circuit 200 may also be applied as the first n-input lookup table.
When the first static memory SRAM0 is configured to a first value, the second static memory SRAM1 is configured to a second value, and the n+1th address input port IN (n+1) is configured to a high level signal, the lookup table circuit 200 may be applied as a one-bit wide arithmetic carry logic module. At this time, the second n-input lookup table LUT (n) -2 is no longer used alone, and outputs a high level signal (data "1"); and a second input terminal of the second adder adder [1] receives a low-level signal (data "0"), and a third input terminal thereof receives a high-level signal (data "1") output from the second n-input lookup table LUT (n) -2. Thus, the carry output signal output from the first adder adder [0] may be transferred to the carry output port COUT through the second adder adder [1 ].
When the first static memory SRAM0 is configured to a second value and the second static memory SRAM1 is configured to a second value, the look-up table circuit 200 may be applied as a two-bit wide arithmetic carry logic block.
When the first static memory SRAM0 is configured to the second value and the second static memory SRAM1 is configured to the first value, the look-up table circuit 200 may be applied as a one-bit wide arithmetic carry logic block, and a first n-input look-up table.
Five of these are illustrated below.
IN the first case, when the first static memory SRAM0 is configured to a first value (e.g., the first value is 0), the second static memory SRAM1 is configured to a first value (e.g., the first value is 0), and the n+1th address input port IN (n+1) receives a high level signal, the lookup table circuit 200 may be applied as two n-input lookup tables.
Specifically, the first address input port IN (1A), the second to n-th address input ports IN (2), … …, IN (n) are commonly used as address input ports of the first n-input look-up table LUT (n) -1, and the fifth multiplexer MUX5 selects a signal received at its first input terminal, i.e., a signal output by the first n-input look-up table LUT (n) -1, based on the first value configured by the second static memory SRAM1, and outputs the signal to the first output port OUT1.
The first address input port IN (1B), the second to nth address input ports IN (2), … …, IN (n) are commonly used as address input ports of the second n-input lookup table LUT (n) -2, the third multiplexer MUX3 selects a signal received at its second input terminal based on a high level signal received at its control terminal, that is, a signal output by the second n-input lookup table LUT (n) -2, and outputs the signal to the first input terminal of the fourth multiplexer MUX4, and the fourth multiplexer MUX4 selects a signal received at its first input terminal, that is, a signal output by the second n-input lookup table LUT (n) -2, based on a first value configured by the first static memory SRAM0 and outputs the signal to the second output port OUT2.
IN the second case, when the first static memory SRAM0 is configured to a first value (e.g., the first value is 0) and the n+1th address input port IN (n+1) receives the most significant address signal, the lookup table circuit 200 may be applied as an n+1 input lookup table.
Specifically, the first address input port IN (1A), the second to n-th address input ports IN (2), … …, IN (n) are commonly used as address input ports of the first n-input lookup table LUT (n) -1, the first address input port IN (1B), the second to n-th address input ports IN (2), … …, IN (n) are commonly used as address input ports of the second n-input lookup table LUT (n) -2, the third multiplexer MUX3 forms one n+1 input lookup table LUT (n+1) together with the highest bit address signal received by the n+1-th address input port IN (n+1) and the second n-input lookup table LUT (n) -2, and outputs the signal output by the n+1 input lookup table LUT (n+1) to the first input terminal of the fourth multiplexer MUX4, and the fourth multiplexer MUX4 selects the signal received by the first input terminal thereof, that is, the n+1 input LUT (n+1), to the second input LUT (n+1) output signal output by the fourth multiplexer MUX4 based on the first value of the first static memory 0 configuration.
In a third scenario, when the first static memory SRAM0 is configured to a second value (e.g., the second value is 1) and the second static memory SRAM1 is configured to the second value (e.g., the second value is 1), the look-up table circuit 200 may be applied as a two-bit wide arithmetic carry logic module.
When the lookup table circuit 200 is applied as a two-bit wide arithmetic carry logic module, for an addition carry operation of two binary numbers, the two binary numbers may be represented as a first addend a and a second addend B, respectively, wherein the first addend a includes a low-order first addend ai and a high-order first addend ai+1, and the second addend B includes a low-order second addend Bi and a high-order second addend Bi+1.
Specifically, carry input signal Ci is input to a first input to first adder adder [0] through carry input port CIN.
The lower first addend ai (IN other embodiments, the lower second addend Bi may be) inputs the first n-input look-up table LUT (n) -1 through one of the two first address input ports IN (1A) and IN (1B), and the lower second addend Bi (IN other embodiments, the lower first addend ai may be) inputs the first n-input look-up table LUT (n) -1 through one of the second through n-th address input ports IN (2), … …, IN (n). The first n-input lookup table LUT (n) -1 obtains a first carry propagation signal Pi according to equation (4) based on the low-order first addend ai and the second addend Bi, and outputs it to the second input of the sixth multiplexer MUX 6. The sixth multiplexer MUX6 selects the first carry propagate signal Pi received at its second input based on the second value configured by the second static memory SRAM1 for output to the third input of the first adder adder [0 ].
IN some embodiments, the first multiplexer MUX1 may select the lower first addend ai (IN other embodiments, the lower second addend Bi) received at the third input terminal thereof and input to the first address input port IN (1A) as the first carry generation signal Gi, and output to the second input terminal of the first adder adder [0 ].
FIG. 3 is a schematic diagram of a portion of the logic of a look-up table circuit in which a first adder is illustrated and a first multiplexer is not illustrated in an embodiment of the present invention; the second adder has a similar structure and operation principle.
As shown in fig. 3, the first adder adder [0] includes a seventh multiplexer MUX7. The seventh multiplexer MUX7 has two inputs, a control terminal and an output terminal, wherein the first input is configured to receive the low-order first addend ai as the first carry generation signal Gi, the second input is configured to receive the carry input signal Ci, the control terminal is configured to receive the first carry propagation signal Pi, and the output terminal is configured to output the first carry output signal Ci+1.
In an implementation, the seventh multiplexer MUX7 may select the lower first addend ai or the carry input signal Ci as the first carry output signal Ci+1 output based on the first carry propagate signal Pi received at its control terminal.
Specifically, when the lower first addend ai and the lower second addend Bi take different values, the first carry generation signal Gi =0, the first carry propagation signal Pi =1, and the first carry output signal Ci+1=Ci are obtained according to formulas (3), (4), and (5). Thus, when the first carry propagate signal Pi =1, the seventh multiplexer MUX7 may select the carry input signal Ci received at its second input terminal as the first carry output signal Ci+1 output.
When both the first addend ai and the second addend Bi of the lower order take "1" entirely, the first carry generation signal Gi =1, the first carry propagation signal Pi =0, and the first carry output signal Ci+1 =1 are obtained according to formulas (3), (4), and (5). Thus, when the first carry propagate signal Pi =0, the seventh multiplexer MUX7 may select the first addend ai of the lower order received at the first input terminal thereof as the first carry output signal Ci+1 to output.
When both the first addend ai and the second addend Bi of the lower order take "0" entirely, the first carry generation signal Gi =0, the first carry propagation signal Pi =0, and the first carry output signal Ci+1 =0 are obtained according to formulas (3), (4), and (5). Thus, when the first carry propagate signal Pi =0, the seventh multiplexer MUX7 may select the first addend ai of the lower order received at the first input terminal thereof as the first carry output signal Ci+1 to output.
Thus, IN the embodiment of the present invention, the first multiplexer MUX1 may select the lower first addend ai (IN other embodiments, the lower second addend Bi) received at the third input terminal of the first multiplexer MUX1 as the first carry generating signal Gi, and output the first carry generating signal to the second input terminal of the first adder adder [0 ].
In other embodiments, the look-up table circuit 200 further comprises a third static memory SRAM2 connected to the first multiplexer MUX1, the third static memory SRAM2 being adapted to store configuration information according to an instruction of the control module. The first multiplexer MUX1 is adapted to output a corresponding first carry generation signal Gi based on configuration information of the third static memory SARM 2.
In particular, the configuration information may comprise a first value or a second value. The first value is one of 0 or 1 and the second value is the other of 0 or 1. For example, the first value may be 0 and the second value may be 1.
When the third static memory SRAM2 is configured to a first value, the first multiplexer MUX1 is adapted to output the low level signal (data "0") received at its first input terminal as the first carry generation signal Gi based on the first value. When the third static memory SRAM2 is configured to a second value, the first multiplexer MUX1 is adapted to output the power supply voltage VDD signal (data "1") received at the second input terminal as the first carry generation signal Gi based on the second value.
In an embodiment of the present invention, when the first carry generation signal Gi is a constant "0", the third static memory SRAM2 may be configured to a first value, so that the first multiplexer MUX1 may output the low-level signal (data "0") received at the first input terminal thereof as the first carry generation signal Gi based on the first value, and the first addend ai of the low bits is 0; when the first carry generation signal Gi is a constant "1", the third static memory SRAM2 may be configured to a second value such that the first multiplexer MUX1 may output the power voltage VDD signal (data "1") received at its second input terminal as the first carry generation signal Gi based on the second value, and the first addend ai of the lower bits is 1.
First adder adder [0] may derive first sum output signal Si and first carry output signal Ci+1 according to formulas (5) and (6) based on carry input signal Ci, first carry generation signal Gi, and first carry propagation signal Pi. The first sum output signal Si is output to the second input terminal of the fifth multiplexer MUX5 through the first output terminal of the first adder adder [0], the fifth multiplexer MUX5 selects the first sum output signal Si received by the second input terminal thereof based on the second value configured by the second static memory SRAM1 to output to the first output port OUT1, and the first carry output signal Ci+1 is output to the first input terminal of the second adder adder [1] through the second output terminal of the first adder adder [0], and can be used as the carry input signal of the high-order arithmetic logic.
The higher first addend ai+1 (IN other embodiments, the higher second addend Bi+1 may also be) inputs the second n-input look-up table LUT (n) -2 through the other one IN (1B) of the two first address input ports IN (1A) and IN (1B), and the higher second addend Bi+1 (IN other embodiments, the higher first addend ai+1 may also be) inputs the second n-input look-up table LUT (n) -2 through the other one of the second through n-th address input ports IN (2), … …, IN (n) which is not occupied. The second n-input lookup table LUT (n) -2 obtains a second carry propagation signal Pi+1 according to equation (4) based on the first addend Ai+1 and the second addend Bi+1 of the high order bits and outputs the second carry propagation signal Pi+1 to the third input of the second adder adder [1 ].
In some embodiments, the structure of the second adder adder [1] may refer to the first adder adder [0] as shown in FIG. 3. Thus, the second multiplexer MUX2 may also select the high-order first addend ai+1 (IN other embodiments, the high-order second addend Bi+1) received at the third input terminal thereof and input to the first address input port IN (1B) as the second carry generation signal Gi+1, and output the second carry generation signal Gi+1 to the second input terminal of the second adder adder [1 ].
In other embodiments, the look-up table circuit 200 further comprises a fourth static memory SRAM3 connected to the second multiplexer MUX2, the fourth static memory SRAM3 being adapted to store configuration information according to an instruction of the control module. The second multiplexer MUX2 is adapted to output a corresponding second carry generation signal Gi+1 based on configuration information of the third static memory SARM 2.
In particular, the configuration information may comprise a first value or a second value. The first value is one of 0 or 1 and the second value is the other of 0 or 1. For example, the first value may be 0 and the second value may be 1.
When the fourth static memory SRAM3 is configured to a first value, the second multiplexer MUX2 is adapted to output the low level signal (data "0") received at its first input terminal as the second carry generation signal Gi+1 based on the first value. When the fourth static memory SRAM3 is configured to a second value, the second multiplexer MUX2 is adapted to output the power supply voltage VDD signal (data "1") received at the second input terminal as the second carry generation signal Gi+1 based on the second value.
In the embodiment of the present invention, when the second carry generation signal Gi+1 is a constant "0", the fourth static memory SRAM3 may be configured to a first value so that the second multiplexer MUX2 may output the low level signal (data "0") received at the first input terminal thereof as the second carry generation signal Gi+1 based on the first value, and the high first addend ai+1 is 0; when the second carry generation signal Gi+1 is a constant "1", the fourth static memory SRAM3 may be configured to a second value such that the second multiplexer MUX2 may output the power voltage VDD signal (data "1") received at its second input terminal as the second carry generation signal Gi+1 based on the second value, and the high first addend ai+1 is 1.
The second adder adder [1] may obtain the second sum output signal Si+1 and the second carry output signal Ci+2 according to formulas (5) and (6) based on the first carry output signal Ci+1, the second carry generation signal Gi+1, and the second carry propagation signal Pi+1. The second sum output signal Si+1 is output to the second input terminal of the fourth multiplexer MUX4 through the first output terminal of the second adder adder [1], the fourth multiplexer MUX4 selects the second sum output signal Si+1 received by the second input terminal thereof based on the second value configured by the first static memory SRAM0 to output to the second output port OUT2, and the second carry output signal Ci+2 is output to the carry output port COUT through the second output terminal of the second adder adder [1] and can be used as the carry input signal of the next arithmetic logic module.
In a fourth scenario, when the first static memory SRAM0 is configured to a second value (e.g., the second value is 1) and the second static memory SRAM1 is configured to a first value (e.g., the first value is 0), the look-up table circuit 200 may be applied as a one-bit wide arithmetic carry logic module.
When the lookup table circuit 200 is applied as a one-bit wide arithmetic carry logic block, for an addition carry operation of two binary numbers, the two binary numbers may be represented as a first addend ai and a second addend Bi, respectively.
Specifically, carry input signal Ci is input to a first input to first adder adder [0] through carry input port CIN.
The third static memory SRAM2 is configured to a first value, and the first multiplexer MUX1 selects a low level signal (data "0") received at a first input terminal thereof based on the first value configured by the third static memory SRAM2 and outputs the low level signal (data "0") to a second input terminal of the first adder adder [0], that is, outputs the carry-in-space generation signal g=0 to the first adder adder [0].
The sixth multiplexer MUX6 selects a high level signal (data "1") received at its first input based on the first value of the second static memory SRAM1 configuration and outputs the high level signal to the third input of the first adder adder [0], i.e., outputs the carry-in-space propagation signal p=1 to the first adder adder [0].
The first adder derives a carry-in signal C, i.e., c=ci, according to equation (5) based on the carry-in signal Ci, the carry-in generation signal G, and the carry-in propagation signal P. The carry-out signal C, Ci, is output to the first input of the second adder adder [1] via the second output of the first adder adder [0] and serves as the carry-in signal for the second adder adder [1 ].
Wherein, the empty bit indicates that the two addend inputs of the first adder adder [0] are empty, which is not used for the logical operation of the two addends, but is used only for transferring the carry input signal Ci.
Thus, when the lookup table circuit 200 is applied as a one-bit wide arithmetic carry logic block, the carry input signal Ci input to the first adder adder [0] through the carry input port CIN can be directly used as the carry input signal of the second adder adder [1 ].
The first addend ai (IN other embodiments, the second addend Bi may be) inputs the second n-input look-up table LUT (n) -2 through the other IN (1B) of the two first address input ports IN (1A) and IN (1B), and the second addend Bi (IN other embodiments, the first addend ai may be) inputs the second n-input look-up table LUT (n) -2 through one of the second through n-th address input ports. The second n-input lookup table LUT (n) -2 obtains the carry propagation signal Pi according to equation (4) based on the first addend Ai and the second addend Bi, and outputs the carry propagation signal Pi to the third input of the second adder adder [1 ].
When the carry generation signal Gi is not always "1" or not always "0", the second multiplexer MUX2 may select the first addend ai (IN other embodiments, the second addend Bi) inputted from the first address input port IN (1B) received by the third input terminal thereof as the carry generation signal Gi, and output the carry generation signal Gi to the second input terminal of the second adder adder [1 ].
When the carry generation signal Gi is a constant "0", the fourth static memory SRAM3 may be configured to a first value so that the second multiplexer MUX2 may output a low-level signal (data "0") received at a first input terminal thereof as the carry generation signal Gi based on the first value.
When the carry generation signal Gi is a constant "1", the fourth static memory SRAM3 may be configured to a second value so that the second multiplexer MUX2 may output the power voltage VDD signal (data "1") received at its second input terminal as the carry generation signal Gi based on the second value.
When the lookup table circuit 200 is applied as a one-bit wide arithmetic carry logic module, one-bit wide arithmetic carry logic operation can be implemented by the second adder adder [1 ]. The second adder adder [1] may derive a sum output signal Si and a carry output signal Ci+1 according to formulas (5) and (6) based on the carry input signal Ci, the carry generation signal Gi, and the carry propagation signal Pi. Wherein the sum output signal Si is output to the second input terminal of the fourth multiplexer MUX4 through the first output terminal of the second adder adder [1], and the fourth multiplexer MUX4 selects the sum output signal Si received by the second input terminal thereof based on the second value configured by the first static memory SRAM0 and outputs the selected sum output signal to the second output port OUT2; the carry output signal Ci+1 is output to the carry output port COUT through the second output terminal of the second adder adder [1], and can be used as a carry input signal of the next stage arithmetic logic module.
When the look-up table circuit 200 is implemented as a one-bit wide arithmetic carry logic block, the first n-input look-up table LUT (n) -1 may be used independently. The fifth multiplexer MUX5 selects the signal output from the first n-input lookup table LUT (n) -1 received at the first input terminal thereof based on the first value configured by the second static memory SRAM1, and outputs the signal to the first output port OUT1.
IN a fifth case, when the first static memory SRAM0 is configured to a first value (e.g., the first value is 0), the second static memory SRAM1 is configured to a second value (e.g., the second value is 1), and the n+1th address input port IN (n+1) is configured to a high level signal, the lookup table circuit 200 may be applied as a one-bit-wide arithmetic carry logic module.
When the lookup table circuit 200 is applied as a one-bit wide arithmetic carry logic block, for an addition carry operation of two binary numbers, the two binary numbers may be represented as a first addend ai and a second addend Bi, respectively.
Specifically, carry input signal Ci is input to a first input to first adder adder [0] through carry input port CIN.
The first addend ai (IN other embodiments, the second addend Bi may be input to the first n-input look-up table LUT (n) -1 through one IN (1A) of the two first address input ports IN (1A) and IN (1B), and the second addend Bi (IN other embodiments, the first addend ai may be input to the first n-input look-up table LUT (n) -1 through one of the second through n-th address input ports IN (2), … …, IN (n). The first n-input lookup table LUT (n) -1 obtains the carry propagation signal Pi according to equation (4) based on the first addend ai and the second addend Bi, and outputs it to the second input of the sixth multiplexer MUX 6. The sixth multiplexer MUX6 selects the carry propagate signal Pi received at its second input based on the second value of the second static memory SRAM1 configuration and outputs it to the third input of the first adder adder [0 ].
IN some embodiments, the first multiplexer MUX1 may select the first addend ai (IN other embodiments, the second addend Bi) input from the first address input port IN (1A) received at the third input terminal thereof as the carry generation signal Gi, and output the carry generation signal Gi to the second input terminal of the first adder adder [0 ].
First adder adder [0] may derive sum output signal Si and carry output signal Ci+1 according to formulas (5) and (6) based on carry input signal Ci, carry generation signal Gi, and carry propagate signal Pi. The sum output signal Si is output to the second input terminal of the fifth multiplexer MUX5 through the first output terminal of the first adder adder [0], the fifth multiplexer MUX5 selects the sum output signal Si received by the second input terminal thereof to output to the first output port OUT1 based on the second value configured by the second static memory SRAM1, and the carry output signal Ci+1 is output to the first input terminal of the second adder adder [1] through the second output terminal of the first adder adder [0 ].
At this time, the fourth static memory SRAM3 is configured to a first value (e.g., the first value is 0), and the second multiplexer MUX2 outputs a low-level signal (data "0") received at its first input terminal based on the configured first value; the second n-input look-up table LUT (n) -2 is no longer used alone and outputs a high level signal (data "1"). A second input terminal of the second adder adder [1] receives the low-level signal (data "0") output from the second multiplexer MUX2, and a third input terminal thereof receives the high-level signal (data "1") output from the second n-input lookup table LUT (n) -2. Thus, the carry output signal Ci+1 output from the first adder adder [0] can be transferred to the carry output port COUT through the second adder adder [1 ].
Fig. 4 is a schematic diagram of a lookup table circuit including two five-input lookup tables in an embodiment of the invention.
As shown IN fig. 4, the lookup table circuit 200 includes two first address input ports IN (1A) and IN (1B), second to sixth address input ports IN (2), IN (3), IN (4), IN (5), IN (6), a carry input port CIN, a carry output port COUT, a first output port OUT1, and a second output port OUT2, wherein the first address input port has two, the second to sixth address input ports have one, respectively, and n is an integer greater than or equal to 5.
The lookup table circuit 200 further includes first to sixth multiplexers MUX1, MUX2, MUX3, MUX4, MUX5, and MUX6, first and second five-input lookup tables LUT (5) -1 and LUT (5) -2, and first and second adders adder [0] and adder [1].
The first five-input lookup table LUT (5) -1 and the second five-input lookup table LUT (5) -2 both share the second to fifth address input ports IN (2), IN (3), IN (4), IN (5), the first five-input lookup table LUT (5) -1 individually using one IN (1A) of the two first address input ports IN (1A) and IN (1B) as its address input port, the second five-input lookup table LUT (5) -2 individually using the other IN (1B) of the two first address input ports IN (1A) and IN (1B) as its address input port.
The first to fifth address input ports IN (1A)/IN (1B), IN (2), IN (3), IN (4), IN (5) may receive address signals arranged from low to high, respectively; the received address signals may be input signals of the first five-input look-up table LUT (5) -1 and the second five-input look-up table LUT (5) -2, respectively; the first address input port IN (1A) may be input to the first adder adder [0] via the first multiplexer MUX1, and the first address input port IN (1B) may be input to the second adder adder [1] via the second multiplexer MUX 2; the sixth address input port IN (6) is adapted to receive a high level signal or an address signal and to supply it to the control terminal of the third multiplexer MUX 3.
Carry input port CIN is adapted to receive a carry input signal and provide to first adder adder [0] for calculating a carry output signal and a sum output signal. The carry output port COUT is adapted to output a carry output signal, which may be used as a carry input signal for a next stage of arithmetic logic block.
The first output port OUT1 and the second output port OUT2 output different signals based on different applications of the look-up table circuit 200. When the lookup table circuit 200 is applied as two five-input lookup tables, the first output port OUT1 and the second output port OUT2 can be respectively used as the output ports of the first five-input lookup table LUT (5) -1 and the second five-input lookup table LUT (5) -2; when the look-up table circuit 200 is applied as a six-input look-up table, the second output port OUT2 may be used as the output port of the six-input look-up table; when the lookup table circuit 200 is applied as a two-bit wide arithmetic carry logic block, the first output port OUT1 and the second output port OUT2 may be used as output ports for neutralizing the output signal of the first adder adder [0] and the second adder adder [1], respectively; when the lookup table circuit 200 is applied as a one-bit-wide arithmetic carry logic module, the second output port OUT2 can be used as an output port for the neutralization output signal of the second adder adder [1], and at this time, the first five-input lookup table can be independently used, and the first output port OUT1 can be used as an output port of the first five-input lookup table LUT (5) -1.
The first multiplexer MUX1 has three inputs and one output, wherein the first input is grounded, the second input is connected to a power supply voltage, the third input is connected to one IN (1A) of two first address input ports IN (1A) and IN (1B), and the output is connected to the second input of the first adder adder [0 ].
The second multiplexer MUX2 has three inputs and one output, wherein the first input is grounded, the second input is connected to the supply voltage, the third input is connected to the other IN (1B) of the two first address input ports IN (1A) and IN (1B), and the output is connected to the second input of the second adder adder [1].
The third multiplexer MUX3 has two inputs, a control and an output, wherein the first input is connected to the output of the first five-input look-up table LUT (5) -1, the second input is connected to the output of the second five-input look-up table LUT (5) -2, the control is connected to the sixth address input port IN (6), and the output is connected to the first input of the fourth multiplexer MUX 4.
The fourth multiplexer MUX4 has two inputs and an output, wherein the first input is connected to the output of the third multiplexer MUX3, the second input is connected to the first output of the second adder adder [1], and the output is connected to the second output OUT2.
The fifth multiplexer MUX5 has two inputs and one output, wherein a first input is connected to the output of the first five-input look-up table LUT (5) -1, a second input is connected to the first output of the first adder adder [0], and an output is connected to the first output port OUT1.
The sixth multiplexer MUX6 has two inputs and an output, wherein the first input is connected to the supply voltage, the second input is connected to the output of the first five-input look-up table LUT (5) -1, and the output is connected to the third input of the first adder adder [0 ].
The first adder adder has three inputs and two outputs, wherein the first input is connected to the carry input port CIN, the second input is connected to the output of the first multiplexer MUX1, the third input is connected to the output of the sixth multiplexer MUX6, the first output is connected to the second input of the fifth multiplexer MUX5 to output and output the carry output signal, and the second output is connected to the first input of the second adder adder [1 ].
The second adder adder [1] has three input terminals and two output terminals, wherein the first input terminal is connected to the second output terminal of the first adder adder [0], the second input terminal is connected to the output terminal of the second multiplexer MUX2, the third input terminal is connected to the output terminal of the second five-input lookup table LUT (5) -2, the first output terminal is connected to the second input terminal of the fourth multiplexer MUX4 to output and output signals, and the second output terminal is connected to the carry output port COUT to output carry output signals.
In an implementation, the fourth multiplexer MUX4 further has a control terminal, and the look-up table circuit 200 further includes a first static memory SRAM0 connected to the control terminal of the fourth multiplexer MUX 4. The first static memory SRAM0 is adapted to store configuration information, which may comprise a first value or a second value, according to an indication of the control module. The fourth multiplexer MUX4 is adapted to output a signal received at its first input based on the first value and to output a signal received at its second input based on the second value.
Specifically, the first value is one of 0 or 1, and the second value is the other of 0 or 1. For example, the first value may be 0 and the second value may be 1.
When the first static memory SRAM0 is configured to a first value, the fourth multiplexer MUX4 is adapted to output the signal output by the output of the third multiplexer MUX3 received at its first input based on the first value. When the first static memory SRAM0 is configured to a second value, the fourth multiplexer MUX4 is adapted to output the signal output by the first output of the second adder adder [1] received by its second input based on the second value.
In an implementation, the fifth multiplexer MUX5 and the sixth multiplexer MUX6 also have control terminals, respectively, and the look-up table circuit 200 further includes a second static memory SRAM1 connected to the control terminals of both the fifth multiplexer MUX5 and the sixth multiplexer MUX 6. The second static memory SRAM1 is adapted to store configuration information, which may comprise a first value or a second value, according to an indication of the control module. The fifth multiplexer MUX5 is adapted to output a signal received at its first input based on a first value and to output a signal received at its second input based on a second value. The sixth multiplexer MUX6 is adapted to output the signal received at its first input based on the first value and to output the signal received at its second input based on the second value.
Specifically, the first value is one of 0 or 1, and the second value is the other of 0 or 1. For example, the first value may be 0 and the second value may be 1.
When the second static memory SRAM1 is configured to a first value, the fifth multiplexer MUX5 is adapted to output a signal output by the first five-input look-up table LUT (5) -1 received at its first input based on the first value, and the sixth multiplexer MUX6 is adapted to output a high-level signal (data "1") received at its first input based on the first value.
When the second static memory SRAM1 is configured to a second value, the fifth multiplexer MUX5 is adapted to output the sum output signal output by the first output terminal of the first adder adder [0] received at its second input terminal based on the second value, and the sixth multiplexer MUX6 is adapted to output the signal output by the first five-input look-up table LUT (5) -1 received at its second input terminal based on the second value.
In an embodiment of the present invention, the lookup table circuit 200 may be selectively applied as one of two five-input lookup tables, one six-input lookup table, two-bit wide arithmetic carry logic modules, and one-bit wide arithmetic carry logic modules.
IN an implementation, when the first static memory SRAM0 is configured to a first value (e.g., the first value is 0), the second static memory SRAM1 is configured to a first value (e.g., the first value is 0), and the sixth address input port IN (6) receives a high level signal, the lookup table circuit 200 may be applied as two five-input lookup tables.
Specifically, the first address input port IN (1A), the second to fifth address input ports IN (2), IN (3), IN (4), IN (5) are commonly used as address input ports of the first five-input lookup table LUT (5) -1, and the fifth multiplexer MUX5 selects a signal received at its first input terminal, that is, a signal output by the first five-input lookup table LUT (5) -1, based on the first value configured by the second static memory SRAM1, and outputs the signal to the first output port OUT1.
The first address input port IN (1B), the second to fifth address input ports IN (2), IN (3), IN (4), IN (5) are commonly used as address input ports of the second five-input lookup table LUT (5) -2, the third multiplexer MUX3 selects a signal received at the second input terminal thereof, that is, a signal output by the second five-input lookup table LUT (5) -2, based on a high level signal received at the control terminal thereof, and outputs the signal to the first input terminal of the fourth multiplexer MUX4, and the fourth multiplexer MUX4 selects a signal received at the first input terminal thereof, that is, a signal output by the second five-input lookup table LUT (5) -2, based on a first value configured by the first static memory SRAM0 and outputs the signal to the second output port OUT2.
IN an implementation, when the first static memory SRAM0 is configured to a first value (e.g., the first value is 0), the sixth address input port IN (6) receives the most significant address signal, the look-up table circuit 200 may be implemented as a six-input look-up table.
Specifically, the first address input port IN (1A), the second to fifth address input ports IN (2), IN (3), IN (4), IN (5) are commonly used as address input ports of the first five input lookup table LUT (5) -1, the first address input port IN (1B), the second to fifth address input ports IN (2), IN (3), IN (4), IN (5) are commonly used as address input ports of the second five input lookup table LUT (5) -2, the third multiplexer MUX3 forms a six input lookup table LUT6 together with the first five input lookup table LUT (5) -1, the second five input lookup table LUT (5) -2 based on the most significant address signal received by the sixth address input port IN (6), and outputs the signal output by the six input lookup table LUT6 to the first input terminal of the fourth multiplexer MUX4, the fourth multiplexer MUX4 selects the signal received by the first input terminal thereof based on the first value of the first static memory SRAM0, that is, and outputs the signal output by the six input table LUT6 to the second output port 2.
IN an implementation, when the first static memory SRAM0 is configured to a second value (e.g., the second value is 1), the second static memory SRAM1 is configured to a second value (e.g., the second value is 1), and the sixth address input port IN (6) receives a high level signal, the lookup table circuit 200 may be applied as a two-bit wide arithmetic carry logic module.
When the lookup table circuit 200 is applied as a two-bit wide arithmetic carry logic module, for an addition carry operation of two binary numbers, the two binary numbers may be represented as a first addend a and a second addend B, respectively, wherein the first addend a includes a low-order first addend ai and a high-order first addend ai+1, and the second addend B includes a low-order second addend Bi and a high-order second addend Bi+1.
Specifically, carry input signal Ci is input to a first input to first adder adder [0] through carry input port CIN.
The first lower addend ai (IN other embodiments, the second lower addend Bi may be) is input to the first five-input lookup table LUT (5) -1 through one IN (1A) of the two first address input ports IN (1A) and IN (1B), and the second lower addend Bi (IN other embodiments, the first lower addend ai may be input to the first five-input lookup table LUT (5) -1 through one of the second to fifth address input ports IN (2), IN (3), IN (4), IN (5). The first five-input lookup table LUT (5) -1 obtains a first carry propagation signal Pi according to equation (4) based on the low-order first addend ai and the second addend Bi, and outputs it to the second input of the sixth multiplexer MUX 6. The sixth multiplexer MUX6 selects the first carry propagate signal Pi received at its second input based on the second value configured by the second static memory SRAM1 for output to the third input of the first adder adder [0 ].
When the first carry generation signal Gi is not always "1" or not always "0", the first multiplexer MUX1 may select the low-order first addend ai (IN other embodiments, the low-order second addend Bi) inputted by the first address input port IN (1A) received by the third input terminal thereof as the first carry generation signal Gi, and output the first carry generation signal Gi to the second input terminal of the second adder adder [1 ].
When the first carry generation signal Gi is a constant "0", the third static memory SRAM2 may be configured to a first value such that the first multiplexer MUX1 may output the low level signal (data "0") received at its first input terminal as the first carry generation signal Gi based on the first value, when the first addend ai of the low order bits is 0; when the first carry generation signal Gi is a constant "1", the third static memory SRAM2 may be configured to a second value such that the first multiplexer MUX1 may output the power voltage VDD signal (data "1") received at its second input terminal as the first carry generation signal Gi based on the second value, and the first addend ai of the lower bits is 1.
First adder adder [0] obtains first sum output signal Si and first carry output signal Ci+1 according to formulas (5) and (6) based on carry input signal Ci, first carry generation signal Gi, and first carry propagation signal Pi. The first sum output signal Si is output to the second input terminal of the fifth multiplexer MUX5 through the first output terminal of the first adder adder [0], the fifth multiplexer MUX5 selects the first sum output signal Si received by the second input terminal thereof based on the second value configured by the second static memory SRAM1 to output to the first output port OUT1, and the first carry output signal Ci+1 is output to the first input terminal of the second adder adder [1] through the second output terminal of the first adder adder [0], and can be used as the carry input signal of the high-order arithmetic logic.
The higher first addend ai+1 (IN other embodiments, the higher second addend Bi+1 may be) inputs the second five-input lookup table LUT (5) -2 through the other IN (1B) of the two first address input ports IN (1A) and IN (1B), and the higher second addend Bi+1 (IN other embodiments, the higher first addend ai+1 may be) inputs the second five-input lookup table LUT (5) -2 through the other unoccupied address input port of the second through fifth address input ports IN (2), IN (3), IN (4), IN (5). The second five-input lookup table LUT (5) -2 obtains a second carry propagation signal Pi+1 according to equation (4) based on the first addend Ai+1 and the second addend Bi+1 of the high order bits and outputs the second carry propagation signal Pi+1 to the third input of the second adder adder [1 ].
When the second carry generation signal Gi+1 is not always "1" or not always "0", the second multiplexer MUX2 may also select the high-order first addend ai+1 (IN other embodiments, the high-order second addend Bi+1) inputted from the first address input port IN (1B) received by the third input terminal thereof as the second carry generation signal Gi+1, and output the second carry generation signal Gi+1 to the second input terminal of the second adder adder [1 ].
When the second carry generation signal Gi+1 is a constant "0", the fourth static memory SRAM3 may be configured to a first value such that the second multiplexer MUX2 may output the low level signal (data "0") received at its first input terminal as the second carry generation signal Gi+1 based on the first value, when the first addend ai+1 of the high order is 0; when the second carry generation signal Gi+1 is a constant "1", the fourth static memory SRAM3 may be configured to a second value such that the second multiplexer MUX2 may output the power voltage VDD signal (data "1") received at its second input terminal as the second carry generation signal Gi+1 based on the second value, and the high first addend ai+1 is 1.
The second adder adder [1] generates a second sum output signal Si+1 and a second carry output signal Ci+2 according to formulas (5) and (6) based on the first carry output signal Ci+1, the second carry generation signal Gi+1, and the second carry propagation signal Pi+1. The second sum output signal Si+1 is output to the second input terminal of the fourth multiplexer MUX4 through the first output terminal of the second adder adder [1], the fourth multiplexer MUX4 selects the second sum output signal Si+1 received by the second input terminal thereof based on the second value configured by the first static memory SRAM0 to output to the second output port OUT2, and the second carry output signal Ci+2 is output to the carry output port COUT through the second output terminal of the second adder adder [1] and can be used as the carry input signal of the next arithmetic logic module.
IN an implementation, when the first static memory SRAM0 is configured to a second value (e.g., the second value is 1), the second static memory SRAM1 is configured to a first value (e.g., the first value is 0), and the sixth address input port IN (6) receives a high level signal, the lookup table circuit 200 may be applied as a one-bit-wide arithmetic carry logic module.
When the lookup table circuit 200 is applied as a one-bit wide arithmetic carry logic block, for an addition carry operation of two binary numbers, the two binary numbers may be represented as a first addend ai and a second addend Bi, respectively.
Specifically, carry input signal Ci is input to a first input to first adder adder [0] through carry input port CIN.
The third static memory SRAM2 is configured to a first value, and the first multiplexer MUX1 selects a low level signal (data "0") received at a first input terminal thereof based on the first value configured by the third static memory SRAM2 and outputs the low level signal (data "0") to a second input terminal of the first adder adder [0], that is, outputs the carry-in-space generation signal g=0 to the first adder adder [0].
The sixth multiplexer MUX6 selects a high level signal (data "1") received at its first input based on the first value of the second static memory SRAM1 configuration and outputs the high level signal to the third input of the first adder adder [0], i.e., outputs the carry-in-space propagation signal p=1 to the first adder adder [0].
The first adder derives a carry-in signal C, i.e., c=ci, according to equation (5) based on the carry-in signal Ci, the carry-in generation signal G, and the carry-in propagation signal P. The carry-out signal C, Ci, is output to the first input of the second adder adder [1] via the second output of the first adder adder [0] and serves as the carry-in signal for the second adder adder [1 ].
Wherein, the empty bit indicates that the two addend inputs of the first adder adder [0] are empty, which is not used for the logical operation of the two addends, but is used only for transferring the carry input signal Ci.
Thus, when the lookup table circuit 200 is applied as a one-bit wide arithmetic carry logic block, the carry input signal Ci input to the first adder adder [0] through the carry input port CIN can be directly used as the carry input signal of the second adder adder [1 ].
The first addend ai (IN other embodiments, the second addend Bi) inputs the second five-input look-up table LUT (5) -2 through the other IN (1B) of the two first address input ports IN (1A) and IN (1B), and the second addend Bi (IN other embodiments, the first addend ai) inputs the second five-input look-up table LUT (5) -2 through one of the second through n-th address input ports. The second five-input lookup table LUT (5) -2 obtains the carry propagation signal Pi according to equation (4) based on the first addend Ai and the second addend Bi, and outputs the carry propagation signal Pi to the third input of the second adder adder [1 ].
When the carry generation signal Gi is not always "1" or not always "0", the second multiplexer MUX2 may select the first addend ai (IN other embodiments, the second addend Bi) inputted from the first address input port IN (1B) received by the third input terminal thereof as the carry generation signal Gi, and output the carry generation signal Gi to the second input terminal of the second adder adder [1 ].
When the carry generation signal Gi is a constant "0", the fourth static memory SRAM3 may be configured to a first value such that the second multiplexer MUX2 may output a low level signal (data "0") received at its first input terminal as the carry generation signal Gi based on the first value, when the first addend ai is 0; when the carry generation signal Gi is a constant "1", the fourth static memory SRAM3 may be configured to a second value such that the second multiplexer MUX2 may output the power voltage VDD signal (data "1") received at its second input terminal as the carry generation signal Gi based on the second value, and the first addend ai is 1.
When the lookup table circuit 200 is applied as a one-bit wide arithmetic carry logic module, one-bit wide arithmetic carry logic operation is implemented by the second adder adder [1 ]. The second adder adder [1] obtains the sum output signal Si and the carry output signal Ci+1 according to formulas (5) and (6) based on the carry input signal Ci, the carry generation signal Gi, and the carry propagation signal Pi. Wherein the sum output signal Si is output to the second input terminal of the fourth multiplexer MUX4 through the first output terminal of the second adder adder [1], and the fourth multiplexer MUX4 selects the sum output signal Si received by the second input terminal thereof based on the second value configured by the first static memory SRAM0 and outputs the selected sum output signal to the second output port OUT2; the carry output signal Ci+1 is output to the carry output port COUT through the second output terminal of the second adder adder [1], and can be used as a carry input signal of the next stage arithmetic logic module.
The first five-input look-up table LUT (5) -1 may be used independently when the look-up table circuit 200 is applied as a one-bit wide arithmetic carry logic block. The fifth multiplexer MUX5 selects the signal output from the first five-input lookup table LUT (5) -1 received at the first input terminal thereof based on the first value configured by the second static memory SRAM1, and outputs the signal to the first output port OUT1.
IN an implementation, when the first static memory SRAM0 is configured to a first value (e.g., the first value is 0), the second static memory SRAM1 is configured to a second value (e.g., the second value is 1), and the sixth address input port IN (6) is configured to a high level signal, the lookup table circuit 200 may be applied as a one-bit wide arithmetic carry logic module.
When the lookup table circuit 200 is applied as a one-bit wide arithmetic carry logic block, for an addition carry operation of two binary numbers, the two binary numbers may be represented as a first addend ai and a second addend Bi, respectively.
Specifically, carry input signal Ci is input to a first input to first adder adder [0] through carry input port CIN.
The first addend ai (IN other embodiments, the second addend Bi) inputs the first five-input lookup table LUT (5) -1 through one IN (1A) of the two first address input ports IN (1A) and IN (1B), and the second addend Bi (IN other embodiments, the first addend ai) inputs the first five-input lookup table LUT (5) -1 through one of the second to fifth address input ports IN (2), … …, IN (5). The first five-input lookup table LUT (5) -1 obtains the carry propagation signal Pi according to equation (4) based on the first addend ai and the second addend Bi, and outputs it to the second input of the sixth multiplexer MUX 6. The sixth multiplexer MUX6 selects the carry propagate signal Pi received at its second input based on the second value of the second static memory SRAM1 configuration and outputs it to the third input of the first adder adder [0 ].
IN some embodiments, the first multiplexer MUX1 may select the first addend ai (IN other embodiments, the second addend Bi) input from the first address input port IN (1A) received at the third input terminal thereof as the carry generation signal Gi, and output the carry generation signal Gi to the second input terminal of the first adder adder [0 ].
First adder adder [0] may derive sum output signal Si and carry output signal Ci+1 according to formulas (5) and (6) based on carry input signal Ci, carry generation signal Gi, and carry propagate signal Pi. The sum output signal Si is output to the second input terminal of the fifth multiplexer MUX5 through the first output terminal of the first adder adder [0], the fifth multiplexer MUX5 selects the sum output signal Si received by the second input terminal thereof to output to the first output port OUT1 based on the second value configured by the second static memory SRAM1, and the carry output signal Ci+1 is output to the first input terminal of the second adder adder [1] through the second output terminal of the first adder adder [0 ].
At this time, the fourth static memory SRAM3 is configured to a first value (e.g., the first value is 0), and the second multiplexer MUX2 outputs a low-level signal (data "0") received at its first input terminal based on the configured first value; the second five-input lookup table LUT (5) -2 is no longer used alone and outputs a high level signal (data "1"). A second input terminal of the second adder adder [1] receives the low-level signal (data "0") output from the second multiplexer MUX2, and a third input terminal thereof receives the high-level signal (data "1") output from the second five-input lookup table LUT (5) -2. Thus, the carry output signal Ci+1 output from the first adder adder [0] can be transferred to the carry output port COUT through the second adder adder [1 ].
The embodiment of the invention also provides a method for configuring the lookup table circuit. The lookup table circuit provided by the embodiment of the invention can be selectively applied to one of two n-input lookup tables, one n+1-input lookup table, a two-bit-wide arithmetic carry logic module and a one-bit-wide arithmetic carry logic module through the method.
Specifically, the application of the lookup table circuit 200 depends on the configuration of the first static memory SRAM0, the second static memory SRAM1, and the n+1th address input port IN (n+1).
IN an implementation, when the first static memory SRAM0 is configured to a first value, the second static memory SRAM1 is configured to a first value, and the n+1th address input port IN (n+1) is configured to a high level signal, the lookup table circuit 200 may be applied as two n-input lookup tables.
When the first static memory SRAM0 is configured to a first value and the n+1 th address input port IN (n+1) is configured to the most significant address signal, the lookup table circuit 200 may be applied as an n+1 input lookup table. Further, when the second static memory SRAM1 is configured to the first value, the lookup table circuit 200 may also be applied as the first n-input lookup table.
When the first static memory SRAM0 is configured to a first value, the second static memory SRAM1 is configured to a second value, and the n+1th address input port IN (n+1) is configured to a high level signal, the lookup table circuit 200 may be applied as a one-bit wide arithmetic carry logic module, and a second n-input lookup table or n+1-input lookup table.
When the first static memory SRAM0 is configured to a second value and the second static memory SRAM1 is configured to a second value, the look-up table circuit 200 may be applied as a two-bit wide arithmetic carry logic block.
When the first static memory SRAM0 is configured to the second value and the second static memory SRAM1 is configured to the first value, the look-up table circuit 200 may be applied as a one-bit wide arithmetic carry logic block, and a first n-input look-up table.
Fig. 5 is a first flowchart of a method of configuring a look-up table circuit in an embodiment of the invention.
As shown in fig. 5, the method 400 includes:
S401, outputting a second value to a sixth multiplexer;
S402, outputting a first carry propagation signal to a first adder by a sixth multiplexer based on the second value;
S403, the first adder receives the carry input signal, the first carry generation signal, and the first carry propagation signal, and generates a first carry output signal and a first sum output signal based thereon;
S404, the second adder receives the first carry output signal, the second carry generation signal and the second carry propagation signal and generates a second carry output signal and a second sum output signal based thereon;
s405, the second adder provides the second carry output signal to the carry output port;
S406, the first adder and the second adder respectively provide the first and the second output signals to the fifth multiplexer and the fourth multiplexer;
s407, outputting respective second values to the fourth multiplexer and the fifth multiplexer;
S408, the fourth multiplexer and the fifth multiplexer output the second and the output signals to the second and the first output ports, respectively, based on the second values received by each.
In the execution of step S401, a second value (for example, the second value is 1) may be output to the sixth multiplexer MUX6 through the second static memory SRAM 1.
In the execution of step S402, the sixth multiplexer MUX6 selects the first carry propagate signal Pi received at its second input based on the second value and outputs it to the first adder adder [0]. The first carry propagate signal Pi is obtained by a first n-input look-up table LUT (n) -1.
In the execution of step S403, the first adder adder [0] receives the carry input signal CIN, the first carry generation signal Gi, and the first carry propagation signal Pi through its three inputs, respectively, and generates the first carry output signal Ci+1 and the first sum output signal Si based on the three inputs. The first carry generation signal Gi is obtained from the first multiplexer MUX 1.
In the execution of step S404, the second adder adder [1] receives the first carry output signal Ci+1, the second carry generation signal Gi+1, and the second carry propagation signal Pi+1 through its three inputs, respectively, and generates the second carry output signal Ci+2 and the second sum output signal Si+1 based thereon. The second carry generation signal Gi+1 is obtained through the second multiplexer MUX2, and the second carry propagation signal Pi+1 is obtained through the second n-input lookup table LUT (n) -2.
In the execution of step S405, the second adder adder [1] provides the second carry output signal Ci+2 to the carry output port COUT.
In the execution of step S406, the first adder adder [0] and the second adder adder [1] supply the first and output signals Si and the second and output signals Si+1, respectively, to the fifth multiplexer MUX5 and the fourth multiplexer MUX4.
In the execution of step S407, the respective second values are output to the fourth multiplexer MUX4 and the fifth multiplexer MUX5, respectively.
In the execution of step S408, the fourth multiplexer MUX4 and the fifth multiplexer MUX5 output the second sum output signal Si+1 and the first sum output signal Si to the second output port OUT2 and the first output port OUT1, respectively, based on the second values received respectively.
When the first static memory SRAM0 is configured to a second value (e.g., the second value is 1), the second static memory SRAM1 is configured to a first value (e.g., the first value is 0), and the n+1th address input port IN (n+1) receives a high level signal, the lookup table circuit 200 may be applied as a one-bit-wide arithmetic carry logic module.
Fig. 6 is a second flowchart of a method of configuring a look-up table circuit in an embodiment of the invention.
As shown in fig. 6, the method 500 includes:
s501, outputting a first value to a sixth multiplexer;
S502, the sixth multiplexer outputs a high level signal to the first adder based on the first value;
S503, the first adder receives the carry input signal, the low level signal, and the high level signal, and outputs the carry input signal based thereon;
S504, the second adder receives the carry input signal, the carry generation signal and the carry propagation signal and generates a carry output signal sum and output signal based thereon;
s505, the second adder provides a carry output signal to the carry output port and a sum output signal to the fourth multiplexer;
S506, outputting a second value to the fourth multiplexer;
S507, the fourth multiplexer outputs and outputs a signal based on the second value it receives, and outputs the signal to the second output port.
In the execution of step S501, the first value is output to the sixth multiplexer MUX6 through the second static memory SRAM 1.
In the execution of step S502, the sixth multiplexer MUX6 outputs a high level signal to the first adder adder [0] based on the first value. Wherein the high level signal is taken through a first input of a sixth multiplexer MUX 6.
In the execution of step S503, the first adder adder [0] receives the carry input signal CIN, the low-level signal, and the high-level signal through its three inputs, respectively, and outputs the carry input signal CIN based on the three inputs. Wherein the low level signal is obtained by the first multiplexer MUX 1.
In the execution of step S504, the second adder adder [1] receives the carry input signal CIN, the carry generation signal Gi, and the carry propagation signal Pi through its three inputs, respectively, and generates the carry output signal Ci+1 and the sum output signal Si based on the three inputs. The carry generation signal Gi is obtained through the second multiplexer MUX2, and the carry propagation signal Pi is obtained through the second n-input lookup table LUT (n) -2.
In the execution of step S505, the second adder adder [1] supplies the carry output signal Ci+1 to the carry output port COUT, and supplies the sum output signal Si to the fourth multiplexer MUX4.
In the execution of step S506, the second value is output to the fourth multiplexer MUX4 through the first static memory SRAM 0.
In the execution of step S507, the fourth multiplexer MUX4 outputs and outputs the signal Si to the second output port OUT2 based on the second value it receives.
When the look-up table circuit 200 is implemented as a one-bit wide arithmetic carry logic block, the first n-input look-up table LUT (n) -1 may be used independently. The fifth multiplexer MUX5 may select the signal output by the first n-input lookup table LUT (n) -1 received at the first input terminal thereof based on the first value configured by the second static memory SRAM1, and output the signal to the first output port OUT1.
In an implementation, the method 500 further includes:
S508, outputting a first value to a fifth multiplexer;
s509, the fifth multiplexer outputs the output signal of the first n-input lookup table to the first output port based on the first value.
In the execution of step S508, the first value is output to the fifth multiplexer MUX5 through the second static memory SRAM 1.
In the execution of step S509, the fifth multiplexer MUX5 selects the output signal of the first n-input look-up table LUT (n) -1 received at its first input terminal based on the first value, and outputs it to the first output port OUT1.
When the first static memory SRAM0 is configured to a first value (e.g., the first value is 0), the second static memory SRAM1 is configured to a first value (e.g., the first value is 0), and the n+1th address input port IN (n+1) receives a high level signal, the lookup table circuit provided by the embodiment of the present invention may be applied as two n-input lookup tables.
Based thereon, the method 400 or 500 further comprises:
s601, a high level signal is provided to a control end of the third multiplexer through an n+1th address input port;
S602, based on the high level signal, enabling the third multiplexer to output the output signal of the second n-input lookup table to the fourth multiplexer;
S603, outputting a first value to a fourth multiplexer and a fifth multiplexer;
s604, the fourth multiplexer and the fifth multiplexer output the output signal of the second n-input lookup table and the output signal of the first n-input lookup table, respectively, based on the first value;
s605 outputs the output signal of the first n-input lookup table and the output signal of the second n-input lookup table to the first output port and the second output port, respectively.
IN the execution of step S601, a high level signal is input to the n+1th address input port IN (n+1) and output to the control terminal of the third multiplexer MUX 3.
In the execution of step S602, the third multiplexer MUX3 outputs the output signal of the second n-input lookup table LUT (n) -2 received at its second input to the first input of the fourth multiplexer MUX4 based on the high level signal received at its control terminal.
In the execution of step S603, a first value (e.g., a first value of 0) is output to the fourth multiplexer MUX4 through the first static memory SRAM0, and a first value (e.g., a first value of 0) is output to the fifth multiplexer MUX5 through the second static memory SRAM 1.
In the execution of step S604, the fourth multiplexer MUX4 outputs the output signal of the second n-input look-up table LUT (n) -2 received at its first input based on the first value, and the fifth multiplexer MUX5 outputs the output signal of the first n-input look-up table LUT (n) -1 received at its first input based on the first value.
In the execution of step S605, the output signal of the first n-input look-up table LUT (n) -1 is output to the first output port OUT1 through the fifth multiplexer MUX5, and the output signal of the second n-input look-up table LUT (n) -2 is output to the second output port OUT2 through the fourth multiplexer MUX 4.
When the first static memory SRAM0 is configured to a first value (e.g., the first value is 0), the n+1-th address input port IN (n+1) receives the most significant address signal, the lookup table circuit provided by the embodiment of the present invention may be applied as one n+1-input lookup table.
Based thereon, the method 400 or 500 further comprises:
S701, the highest address signal is provided to the control end of the third multiplexer through the n+1th address input port;
S702, enabling the third multiplexer to output a signal received by one of the first input terminal and the second input terminal based on the most significant address signal;
S703 outputting the first value to the fourth multiplexer;
S704, the fourth multiplexer outputs the signal received by the first input terminal thereof to the second output port based on the first value.
IN the execution of step S701, the most significant address signal is input to the n+1th address input port IN (n+1), and output to the control terminal of the third multiplexer MUX 3.
IN the execution of step S702, the third multiplexer MUX3 forms an n+1 input lookup table LUT (n+1) together with the first n input lookup table LUT (n) -1 and the second n input lookup table LUT (n) -2 based on the most significant address signal received from the n+1 address input port IN (n+1), and outputs the output signal of the n+1 input lookup table LUT (n+1).
In the execution of step S703, a first value (for example, a first value of 0) is output to the fourth multiplexer MUX4 through the first static memory SRAM 0.
In the execution of step S704, the fourth multiplexer MUX4 outputs the output signal of the n+1 input look-up table LUT (n+1) to the second output port OUT2 based on the first value.
The method for configuring the lookup table circuit according to the embodiment of the present invention may be implemented based on the foregoing description and the lookup table circuit described in connection with fig. 2 to 4, and therefore, the execution of each step and the relationship between each step in the method may also refer to the foregoing description about the lookup table circuit, which is not repeated herein.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications may be made by one skilled in the art without departing from the spirit and scope of the invention, and the scope of the invention should be assessed accordingly to that of the appended claims.