FIXED VALUE MULTIPLICATION USING FIELD-PROGRAMMABLE GATE ARRAY

Information

  • Patent Application
  • 20210342119
  • Publication Number
    20210342119
  • Date Filed
    May 04, 2020
    4 years ago
  • Date Published
    November 04, 2021
    3 years ago
Abstract
A method for multiplying two binary numbers includes configuring, in an integrated circuit, a plurality of lookup tables based on a known binary number (w). The lookup tables can be configured in three layers. The method further includes receiving, by the integrated circuit, an input binary number (d). The method further includes determining, by the integrated circuit, a multiplication result (p) of the known binary number w and the input binary number d by determining each bit (pi) from p using the lookup tables based on specific combinations of bits from the known binary number w and from the input binary number d, wherein a notation jx represents the xth bit of j from the right, with bit j0 being the rightmost bit of j.
Description
BACKGROUND

The present invention relates to computing technology, and particularly to improvement to a fixed-value multiplier used by computing systems, where the improvement is achieved by using a field-programmable gate array (FPGA).


An FPGA is an integrated circuit designed to be configured by a customer or a designer after manufacturing. The FPGA configuration is generally specified using a hardware description language (HDL), similar to that used for an application-specific integrated circuit (ASIC). Computing a multiplication of two numbers is a common operation performed by various computing systems. Several computing systems require a multiplication in which one of the values is known or fixed, and the second is a dynamic input value.


SUMMARY

According to one or more embodiments of the present invention, a method for multiplying two binary numbers includes configuring, in an integrated circuit, a plurality of lookup tables based on a known binary number (w). The lookup tables can be configured in three layers. The method further includes receiving, by the integrated circuit, an input binary number (d). The method further includes determining, by the integrated circuit, a multiplication result (p) of the known binary number w and the input binary number d by determining each bit (pi) from p using the lookup tables based on specific combination of bits from the known binary number w and from the input binary number d, wherein a notation jx represents the xth bit of j from the right, with bit j0 being the rightmost bit of j.


In one or more embodiments of the present invention, the known binary number w has a predetermined number of bits. For example, the known binary number is an 8-bit binary number. Further, in one or more embodiments of the present invention, the input binary number has a predetermined number of bits. For example, the input binary number is a 12-bit binary number.


In one or more embodiments of the present invention, the bits p5, p4, p3, p2, p1, and p0 of p are determined by a first circuit that includes a first layer of the lookup tables from the integrated circuit based on the bits d5, d4, d3, d2, d1, and do of the input binary number d. Further, the bits p8, p7, and p6, of p are determined by a second circuit from the integrated circuit based on the first set of auxiliary bits computed by the first circuit. The second circuit includes a second layer of the lookup tables. Further yet, the bits p16, p15, p14, p13, p12, p11, and p10 of p are determined by a third circuit from the integrated circuit based on auxiliary bits computed by the second circuit. The third circuit includes a third layer of the lookup tables. In one or more embodiments of the present invention, determining the bit p19 of p includes determining, using a subset of lookup tables, that t≤d, wherein t=┌219/w┐ is precomputed, and in response to t≤d, p19 is set to 1, and otherwise p19 is set to 0.


In one or more embodiments of the present invention, determining the bit p18 of p includes precomputing threshold values t01, t10, and t11:






t
01=┌218/w┐,






t
10=└(219−1)/w┘, and






t
11=┌(219+218)/w┐.


In response to (t11≤d) or (t01≤d≤t10), p18 is set to 1, and otherwise to 0.


Further, in one or more embodiments of the present invention, determining the bit p17 of p includes precomputing threshold values:






t
001=┌217/w┐,






t
010=└(218−1)/w┘,






t
011=┌(218+217)/w┐,






t
100=└(219−1)/w┘,






t
101=┌(219+217)/w┐,






t
110=└(219+218−1)/w┘, and






t
111=┌(219+218+217)/w┐.


P17 is set to 1 in response to t111≤d, t101≤d≤t110, t011≤d≤t100, and t001≤d≤t010, and to 0 otherwise.


The technical solutions described herein can also be achieved by implementing a system that includes a memory device that stores a known binary number (w), and a multiplication circuit that performs the method to determine the multiplication result (p) of the known binary number with an input binary number (d) that is received dynamically.


Alternatively, in one or more embodiments of the present invention, a neural network system includes a multiplication circuit for performing a method to determine a multiplication result of a weight value with an input value (d) that is received dynamically, the method including configuring several lookup tables in an integrated circuit based on the weight value (w) that is a known value. The lookup tables can be configured in three layers. The method further includes determining a multiplication result (p) of the weight value w and the input value d by determining each bit (pi) from p using the lookup tables based on a specific combination of bits from the weight value w and from the input value d, wherein a notation jx represents the xth bit of j from the right, with bit j0 being the rightmost bit of j.


In yet another embodiment of the present invention, an electronic circuit determines a multiplication result (p) of a weight value (w) and an input value (d) that is received dynamically. Determining the multiplication result includes configuring several lookup tables based on the weight value (w), and determining each respective bit (pi) of the multiplication result (p) using the lookup tables based on specific combination of bits from the weight value w and from the input value d. The notation jx represents the xth bit of j from the right, with bit j0 being the rightmost bit of j.


In another embodiment of the present invention, a field programmable gate array includes several lookup tables, wherein the field programmable gate array performs a method for determining a multiplication result (p) of a weight value (w) and an input value (d) that is received dynamically. The lookup tables can be configured in three layers.


Embodiments of the present invention can include various other implementations such as machines, devices, and apparatus.


Additional technical features and benefits are realized through the techniques of the present invention. Embodiments and aspects of the invention are described in detail herein and are considered a part of the claimed subject matter. For a better understanding, refer to the detailed description and to the drawings.





BRIEF DESCRIPTION OF THE DRAWINGS

The specifics of the exclusive rights described herein are particularly pointed out and distinctly claimed in the claims at the conclusion of the specification. The foregoing and other features and advantages of the embodiments of the invention are apparent from the following detailed description taken in conjunction with the accompanying drawings in which:



FIG. 1 depicts a block diagram of a system that uses a multiplication circuit according to one or more embodiments of the present invention;



FIG. 2 depicts an exemplary neural network system according to one or more embodiments of the present invention;



FIG. 3 depicts a block diagram of a multiplication circuit according to one or more embodiments of the present invention;



FIG. 4 depicts a flowchart of a method for determining a multiplication result of a known value, w, with input value, d, according to one or more embodiments of the present invention;



FIG. 5 depicts a first circuit used in a multiplication circuit according to one or more embodiments of the present invention;



FIG. 6 depicts a second circuit used in a multiplication circuit according to one or more embodiments of the present invention;



FIG. 7 depicts a third circuit used in a multiplication circuit according to one or more embodiments of the present invention;



FIG. 8 depicts a lookup table used in a multiplication circuit according to one or more embodiments of the present invention;



FIG. 9 depicts several lookup tables used in a multiplication circuit according to one or more embodiments of the present invention;



FIG. 10 depicts a lookup table used in a multiplication circuit according to one or more embodiments of the present invention;



FIG. 11 depicts a lookup table used in a multiplication circuit according to one or more embodiments of the present invention;



FIG. 12 depicts a lookup table used in a multiplication circuit according to one or more embodiments of the present invention;



FIG. 13 depicts a circuit used to determine a most significant bit of a multiplication result according to one or more embodiments of the present invention;



FIG. 14 depicts a circuit used to determine a second most significant bit of a multiplication result according to one or more embodiments of the present invention;



FIG. 15 depicts several lookup tables used in a multiplication circuit according to one or more embodiments of the present invention;



FIG. 16 depicts a circuit used to determine a third most significant bit of a multiplication result according to one or more embodiments of the present invention; and



FIG. 17 depicts a computing system that can be used to implement one or more embodiments of the present invention.





The diagrams depicted herein are illustrative. There can be many variations to the diagrams or the operations described therein without departing from the spirit of the invention. For instance, the actions can be performed in a differing order, or actions can be added, deleted, or modified. Also, the term “coupled” and variations thereof describe having a communications path between two elements and do not imply a direct connection between the elements with no intervening elements/connections between them. All of these variations are considered a part of the specification.


DETAILED DESCRIPTION

Exemplary embodiments of the present invention provide improved efficiency for computing a multiplication in computing systems, particularly in the case where one of the values to be multiplied is a fixed (known) value, and the second value to be multiplied is dynamically input. Exemplary embodiments of the present invention provide a multiplication circuit for performing such a computation efficiently. The values are represented in digital format using binary numbers. In one or more embodiments of the present invention, a field-programmable gate array (FPGA) includes a plurality of lookup tables (LUTs), the LUTs being configured in n layers to realize the multiplication circuit.


As a brief introduction, FPGAs typically contain an array of programmable logic blocks and a hierarchy of reconfigurable interconnects that allow the blocks to be “wired together,” like several logic gates that can be coupled together in different configurations. Logic blocks can be configured to perform combinational functions, logic gates like AND and XOR, and other functions. The logic blocks also include memory elements, such as flip-flops or more complete blocks of memory. It should be noted that FPGAs can include components different from those described herein; the above is an exemplary FPGA.


A technical challenge with computing systems is improving the time required for the computing system to perform calculations such as multiplication of numbers represented as binary numbers. Technical solutions provided by embodiments of the present invention address such technical challenges by providing an n layered multiplication circuit that performs a multiplication in deterministic time for two binary numbers—one fixed-value number and one variable number that is input at runtime. One or more embodiments of the present invention use FPGAs to implement the multiplication circuit using LUTs. As used herein, a “k-to-1 Boolean function” is implemented as a k-input LUT that provides a 1-bit output given a k-bit input.


Further, the present document denotes B={0,1}, Bn is the set of all n-tuples of zeros and ones, and Bn is the set of all Boolean functions Bn→B. Also, the present document uses the same symbol x interchangeably to denote both a Boolean vector x=(x0, . . . , xk-1)∈Bk and a natural number x=Σi=0k-1xi2k. The operation of the addition of two Boolean vectors, including two Boolean scalars, is denoted without confusion by the same ‘+’ sign. Accordingly, the technical challenge restated using the terminology just established is to compute the product of an input value d and a fixed-value weight w.



FIG. 1 depicts a block diagram of a system for computing a fixed-value binary number multiplication according to one or more embodiments of the present invention. For example, the multiplication circuit 115 that is described herein can be a part of a computing system 110 that receives an input-value (d) from an input source 120. The multiplication circuit 115 calculates an output p of a product of d with a known fixed value w.


In one or more embodiments of the present invention, the computing system 110 can be an artificial neural network system. Alternatively, the computing system 110 is a desktop computer, a server computer, a tablet computer, or any other type of computing device that uses the multiplication circuit 115 to compute a product of two binary numbers, one of which has a known value (w).


In one or more embodiments of the present invention, the input source 120 can be a memory, a storage device, from which the input-value is provided to the multiplication circuit 115. Alternatively, or in addition, the input-value can be input to the multiplication circuit 115 directly upon acquisition, for example, the input source 120 is a sensor, such as a camera, an audio input device, or any other type of sensor that captures data in a form that can be input to the multiplication circuit 115.



FIG. 2 illustrates an example, non-limiting neural network system for which efficiency can be facilitated in accordance with one or more embodiments of the invention. The neurons of a neural network 200 can be connected so that the output of one neuron can serve as an input to another neuron. Neurons within a neural network can be organized into layers, as shown in FIG. 2. The first layer of a neural network can be called the input layer (224), the last layer of a neural network can be called the output layer (228), and any intervening layers of a neural network can be called a hidden layer (226). Aspects of systems (e.g., system 200 and the like), apparatuses, or processes explained herein can constitute machine-executable component(s) embodied within machine(s), e.g., embodied in one or more computer-readable mediums (or media) associated with one or more machines. Such component(s), when executed by the one or more machines, e.g., computer(s), computing device(s), virtual machine(s), etc. can cause the machine(s) to perform the operations described. Repetitive description of like elements employed in respective embodiments is omitted for the sake of brevity.


The system 200 and/or the components of the system 200 can be employed to use hardware and/or software to solve problems that are highly technical in nature, that are not abstract and that cannot be performed as a set of mental acts by a human. For example, system 200 and/or the components of the system 200 can be employed to use hardware and/or software to perform operations, including facilitating an efficiency within a neural network. Furthermore, some of the processes performed can be performed by specialized computers for carrying out defined tasks related to facilitating efficiency within a neural network. System 200 and/or components of the system 200 can be employed to solve new problems that arise through advancements in technology, computer networks, the Internet, and the like. System 200 can further provide technical improvements to live and Internet-based learning systems by improving processing efficiency among processing components associated with facilitating efficiency within a neural network.


System 200, as depicted in FIG. 2, is a neural network that includes five neurons—neuron 202, neuron 204, neuron 206, neuron 208, and neuron 210. The input layer 224 of this neural network is comprised of neuron 202 and neuron 204. The hidden layer 226 of this neural network is comprised of neuron 206 and neuron 208. The output layer 228 of this neural network is comprised of neuron 210. Each of the neurons of input layer 224 is connected to each of the neurons of hidden layer 226. That is, a possibly-weighted output of each neuron of input layer 224 is used as an input to each neuron of hidden layer 226. Then, each of the neurons of hidden layer 226 is connected to each of the neurons (here, one neuron) of output layer 228.


The neural network of system 200 presents a simplified example so that certain features can be emphasized for clarity. It can be appreciated that the present techniques can be applied to other neural networks, including ones that are significantly more complex than the neural network of system 200.


In the context of artificial neural networks, each of the neurons performs a computation, for example, during various phases, such as forward propagation, backward propagation, and weight update. Such computations can include multiplication. In one or more embodiments of the present invention, the computations include multiplication of a weight-value assigned to the neuron (which is a known and fixed value), and an input value (which can be variable). Here, the “weight-value” represents the weight that is assigned to a neuron in the neural network 200, and the “input-value” is a value received by that neuron to calculate the output. The calculation can be performed during the training of the neural network or during inference using the neural network. In one or more embodiments of the present invention, the calculation can be performed during any phase of the training, forward propagation, backward propagation, weight update, or any other phase. The performance of the neural network 200 can be improved if the efficiency of the multiplication operation can be improved. One or more embodiments of the present invention facilitate a faster way of calculating a multiplication of an input-value (d) with the weight-value (w). Further, one or more embodiments of the present invention facilitate hardware components to support such calculation using LUTs.


It is noted that although FIG. 2 depicts an embodiment of the present invention with the computing system 110 as a neural network system (200), in one or more embodiments of the present invention, the computing system 110 can be other types of computing systems that include the multiplication circuit 115.


The technical solutions provided by one or more embodiments of the present invention are now described using an exemplary case where w is an 8-bit value, and d is a 12-bit value. It is understood that in other embodiments of the present invention, the values can have a different number of bits. However, for explaining the operation of the technical solutions of the present invention, the above example scenario is chosen. Accordingly, the computational problem is defined by a fixed nonzero weight-value, which is a vector of bit-values w=(w0, . . . , w7)∈B8, so w=Σi=07wi2i. The input-value is a vector of bit-values d=(d0, . . . , d11)∈B12, so d=Σi=011di2i.


The input-value d can also be represented as d=g 26+h, where g and h are integers such that 0≤g, h<26. Accordingly,






g
=



d

2
6








and h=d−g·26.


In this case, p is a vector of bit-values such that p=(p0, . . . , p19)∈B20, so p=Σi=019pi2i, and hence, 0≤p≤220−1. In this document, a function is denoted Pi(d)=Pi(d;w), where the function returns p i=0, . . . , 19.


Now, if n is any natural number, and if g is an n-to-1 Boolean function, and if ƒ1, . . . , ƒn are n 6-to-1 Boolean functions, the composition h(x)=g(ƒ1, (x), . . . , ƒn(x)) is also a 6-to-1 Boolean function. Further, let x={0, . . . , 26−1} and let y=x+1, where x and y are Boolean vectors. For i=0, . . . , 5:











J
i



(
x
)




{





1





if






x
j


=
1






for





j

=
0

,
1
,





,
i





0


otherwise








(
1
)







Under these conditions, for i=0, . . . , 5, y, =x, if and only if Ji(x)=0, and y6=1 if and only if J5(x)=1.


It can be proven that for every natural n E N, there exists a 2-level circuit of 6-to-1 Boolean functions, where the circuit decides for every d∈B12 whether or not d<n. If n≥212, then because d<212, the problem is trivial. Hence, consider that n<212. In this case, the number n can be uniquely represented as n=a·26+b, where a and b are integers such that 0≤a, b<26. Here, d<n if and only if either (i) g<a, or (ii) g=a and h<b. Defining the following functions:







G


(
d
)


=


G


(
g
)


=

{





1




if





g

<
a





0




if





g


a










E


(
d
)



=


E


(
g
)


=

{





1




if





g

=
a





0




if





g


a









and






H


(
d
)



=


H


(
g
)


=

{



1




if





h

<
b





0




if





h


b
















Each of these functions is a 6-to-1 Boolean function. It should be noted that although d∈B1-2 each of these functions operates on only six bits of d. Let J: B3→B be the following:







J


(


x
1

,

x
2

,

x
3


)


=

{




1




if






x
1


=
1





1




if






x
2


=


1





and






x
3


=
1






0




if






x
2


=


1





and






x
3


=
0






0




if






x
1


=


0





and






x
2


=
0





.






It follows that






d<n⇔J[G(d),E(d),H(d)]=1.


Accordingly, to improve the operation of the computing system 110, the multiplication circuit 115 has to be a circuit of FPGAs of minimum possible depth (i.e., number of layers) so that given a fixed weight-value w, the LUTs can be programmed for calculating the product w×d for any input d∈B1-2:






















































d
11




d
10




d
9




d
8




d
7




d
6




d
5




d
4




d
3




d
2




d
1




d
0























































×








w
7




w
6




w
5




w
4




w
3




w
2




w
1




w
0






p
19




p
18




p
17




p
16




p
15




p
14




p
13




p
12




p
11




p
10




p
9




p
8




p
7




p
6




p
5




p
4




p
3




p
2




p
1




p
0












Here, each of the di, wi, and pi is a bit-value.



FIG. 3 depicts a block diagram of the multiplication circuit according to one or more embodiments of the present invention. The multiplication circuit 115 can be an FPGA in one or more embodiments of the present invention. Alternatively, or in addition, the multiplication circuit 115 can be an application-specific integrated circuit (ASIC), or any other type of electronic circuit that includes transistors, flip-flops, and other such components to implement lookup tables. The multiplication circuit 115, for this particular case of 8-bit 14) and 12-bit d, includes three levels, a first circuit 310, a second circuit 320, and a third circuit 330, each level being a separate circuit. Here, each circuit can be a collection of LUTs implemented by the FPGA. In the case where the w and/or the d has/have a different number of bits, the number of levels in the multiplication circuit 115 can change. The circuits (310, 320, and 330) can communicate auxiliary bit-values among each other to facilitate calculations to be efficient. The circuits (310, 320, and 330) include several LUTs 350 to provide an output based on the input-value d. The LUTs 350 are configured based on the weight-value iv, which is a known value.



FIG. 4 depicts a flowchart of a method for computing the product p of the input-value d and the weight-value))) according to one or more embodiments of the present invention. FIG. 5, FIG. 6, and FIG. 7, each depicts a block diagram of the first circuit 310, the second circuit 320, and the third circuit 330, respectively, according to one or more embodiments of the present invention.


The method 400 includes configuring the several LUTs 350 in the multiplier circuit 115 based on the weight-value iv, at block 402. Each LUT 350 provides an output bit based on a set of input bits. The input bits to the LUT 350 can include one or more bit-values from d. In addition, the input bits to the LUT 350 can include one or more auxiliary bit-values output by another LUT 350. In one or more cases, the auxiliary bit-values from the first circuit 310 are used as input bits to one or more LUTs 350 in the other circuits (320 and 330). Similarly, auxiliary bits from the second circuit 320 can be used as input bits to LUTs 350 of the third circuit 330.


The method 400 includes determining an output of the first circuit 310, at block 410. Part of the output from the first circuit 310 includes a predetermined number of LSBs 510 of p, at block 412. As shown in FIG. 5, in the case with the 12-bit d and 8-bit w, the first circuit 310 computes the first 6-bits of p (p0 to p5). The first circuit 310 further determines a first set of auxiliary bit-values (r6 to r13) 520 that is used as input bit-values to other LUTs 350 from the multiplication circuit 115, at block 414. The LSBs 510 and the first set of auxiliary bit-values 520 are both determined based on the six LSBs of d (d0 to d5). The computation of the LSBs 510 and the first set of auxiliary bit-values 520 can be expressed as:






























































d
5




d
4




d
3




d
2




d
1




d
0






























×








w
7




w
6




w
5




w
4




w
3




w
2




w
1




w
0





=



r
13




r
12




r
11




r
10




r
9




r
8




r
7




r
6




p
5




p
4




p
3




p
2




p
1




p
0












(
2
)







Further, the first circuit 310 determines a second set of auxiliary bit-values (q0 to q13) 530 that is used as input bit-values to other LUTs 350 from the multiplication circuit 115, at block 416. The second set of auxiliary bit-values 520 is determined based on the six most significant bits (MSBs) of d (d6 to d11). The computation of the second set of auxiliary bit-values 530 can be expressed as:






























































d
11




d
10




d
9




d
8




d
7




d
6






























×








w
7




w
6




w
5




w
4




w
3




w
2




w
1




w
0





=



q
13




q
12




q
11




q
10




q
9




q
8




q
7




q
6




q
5




q
4




q
3




q
2




q
1




q
0












(
3
)







In addition, the first circuit 310 determines a first ancillary bit-value (q9.8) 540, at block 418. The first ancillary bit-value is communicated to the second circuit 320 and represents:






q
9.8
=q
9
∧q
8.


the output bit-values of the second circuit 320, at block 420. Part of the output of the second circuit 320 includes a predetermined number of bits 610 of p, at block 422. As shown in FIG. 6, in the case with the 12-bit d and 8-bit w, the second circuit 320 computes p6 to p8 (610). The second circuit 320 further determines a second ancillary bit-value (x9) 620 that is used as input bit-values to other LUTs 350 from the multiplication circuit 115, at block 424. The bit-values 610 and the second ancillary bit-value 620 are both determined based on subsets of the first set of auxiliary bit-values 520 and the second set of auxiliary bit-values 530 (r8, r7, r6, and q2, q1, q0). The computation can be expressed as:




























r
8




r
7




r
6





+








q
2




q
1




q
0





=



x
9




p
8




p
7




p
6








.





(
4
)







Further, the second circuit 320 determines a third set of auxiliary bit-values (y9 to y12) 630, at block 426. The third set of auxiliary bit-values is determined using subsets of the first set of auxiliary bit-values 520 and the second set of auxiliary bit-values 530 (r11, r10, r9, and q5, q4, q3). The computation can be expressed as:



























r
11




r
10




r
9





+








q
5




q
4




q
3





=



y
12




y
11




y
10




y
9












(
5
)







The second circuit 320 further determines a third ancillary bit-value (y10.8) 640 and a fourth ancillary value (y11.9) 650, at block 427. The ancillary bit-values are used by the third circuit 330. In one or more embodiments of the present invention, the third ancillary bit-value (y10.8) 640 and the fourth ancillary value (y11.9) 650 are part of the third set of auxiliary values 630. The ancillary bit-values represent a combination of one or more bit-values from the third set of auxiliary bit-values, and the computation can be expressed as:






y
10.9
=y
10
∧y
9






y
11.9
=y
11
∧y
10
∧y
9  (6)


Further, the second circuit 320, using (r13, r12, and q10, q9, q8, q7, q6), determines a fourth set of auxiliary bit-values (z16 to z12) 660, at block 428. The computation can be expressed as:






















0


0


0



r
13




r
12





+



q
10




q
9




q
8




q
7




q
6





=



z
16




z
15




z
14




z
13




z
12








.





(
7
)







Further yet, the second circuit 320 further determines a fifth ancillary bit-value (z14.13) 670 and a sixth ancillary value (z15.13) 680, at block 429. The computation of the ancillary bit-values can be expressed as:






z
14.13
=z
14
∧z
13  (8)






z
15.13
=z
15
∧z
14
∧z
13.  (9)


Additionally, the bit-value z16 662 represents the combination:






z
16
=q
10⊗((q9∧q8)∧((r13∧q7)∨(r13∧r12∧q5)∨(q7∧r12∧q6)),  (16)


Here, a⊗b=(a∧¬b)∨(¬a∧b). This implies that q9 can be replaced by q9.8=q9 ∧q8 for the computation of z16. Accordingly, z16 662 can be obtained as a function of six input bit-values (r13, r12, and q10, q9.8, q7, q6) to a LUT 350. FIG. 8 depicts the LUT 350 for obtaining z16 662.


Referring back to FIG. 4, the method 400 further includes determining the remaining bit-values (MSBs) 710 of the product p using the third circuit 330, at block 430. Determining the MSBs 710 includes using several combinations of the input bit-values of d, the sets of auxiliary bit-values, and the several ancillary bit-values computed by the first circuit 310 and the second circuit 320.


The bit p9 is determined using bits (y9, x9) based on:






p
9
≡p
9(y9,x9)=(y9+x9)(mod 2)


The corresponding LUT 350 is depicted in view 910 of FIG. 9 to determine p9 based on the input bit-values.


The bit p10 is determined using bits (y10, y9, x9) based on:








p
10




p
10



(


y
10

,

y
9

,

x
9


)



=

{




y
10





if






(


y
9

,

x
9


)




(

1
,
1

)







1
-

y
10






if






(


y
9

,

x
9


)


=

(

1
,
1

)










The corresponding LUT 350 is depicted in view 920 of FIG. 9 to determine p10 based on the input bit-values.


The bit p11 is determined using bits (y11, y10, y9, x9) based on:








p
11




p
11



(


y
11

,

y
10

,

y
9

,

x
9


)



=

{





y
11





if






(


y
10

,

y
9

,

x
9


)




(

1
,
1
,
1

)







1
-

y
11






if






(


y
10

,

y
9

,

x
9


)


=

(

1
,
1
,
1

)





.






The dependence of p11 on y10 and y9 is only to check whether or not (y10, y9)=(1, 1). Hence, y10 and y9 can be replaced by the third ancillary bit 640 (y10.9). The corresponding LUT 350 is depicted in view 930 of FIG. 9 to determine pH based on such input bit-values.


Calculating p12 requires computing the addition:













0



y
12



0


0



x
9





+


0



z
12




y
11




y
10




y
9





=



c
13




p
12




p
11




p
10





p
9

,







where c13 is not used, and p9, p10, and p11, are determined as described earlier. Here, the dependence of p12 on y11, y10, and y9 is only to check whether or not (y11, y10, y9)=(1, 1, 1). Hence, y11, y10, and y9 can be replaced by the fourth ancillary bit 650 (y11.9). The corresponding LUT 350 is depicted in view 940 of FIG. 9 to determine p12 based on such input bit-values.


Calculating p13 requires computing the addition:














0


0



y
12



0


0



x
9





+


0



z
13




z
12




y
11




y
10




y
9





=



c
14




p
13




p
12




p
11




p
10




p
9




,




where c14 is not used, and p9, p10, p11, and p12, are determined as described earlier. Here, the dependence of p13 on y11, y10, and y9 is only to check whether or not (y11, y10, y9)=(1, 1, 1). Hence, y11, y10, and y9 can be replaced by a single bit—the fourth ancillary bit 650 (y11.9). Accordingly, p13 can be determined as a function of five variables (z13, z12, y12, y11.9, x9). The corresponding LUT 350 is depicted in view 950 of FIG. 9 to determine p13 based on such input bit-values. In view 950, the calculation of c14 is depicted for denotational purposes. However, c14 is not used.


Calculating p14 requires computing the addition:














0


0


0



y
12



0


0



x
9





+


0



z
14




z
13




z
12




y
11




y
10




y
9





=



c
15




p
14




p
13




p
12




p
11




p
10




p
9




,




where c15 is not used, and p9, p10, p11, p12, and p13 are determined as described earlier.


Here, the addition is a function of eight variables. As noted earlier, the technical solutions herein overcome the technical challenge of handling such cases with more than six input bit-values. In this particular case, y11, y10, and y9 can be replaced by a single bit—the fourth ancillary bit 650 (y11.9) so that p14 can be determined using the LUT 350 shown in view 1010 of FIG. 10.


Calculating p15 requires computing the addition:














0


0


0


0



y
12



0


0



x
9





+


0



z
15




z
14




z
13




z
12




y
11




y
10




y
9





=



c
16




p
15




p
14




p
13




p
12




p
11




p
10




p
9




,




where c16 is not used, and p9, p10, p11, p12, p13, and p14 are determined as described earlier.


Here, the addition is a function of nine variables. Again, y11, y10, and y9 can be replaced by a single bit—the fourth ancillary bit 650 (y11.9). Furthermore, the dependence of p15 on z14 and z13 is only to check whether or not (z14, z13) by the fifth ancillary bit-value 670 (z14.13) can be determined using the LUT 350 shown in view 1110 of FIG. 11 as a function of six variables.


Calculating p16 requires computing the addition:














0


0


0


0



r
13




r
12



0


0


0




+


0



q
10




q
9




q
8




q
7




q
6



0


0



x
9










0


0


0


0


0



y
12




y
11




y
10




y
9





=



c
17




p
16




p
15




p
14




p
13




p
12




p
11




p
10




p
9




,




where (q13, . . . , q6) and (r13, r12) are computed in first circuit 310, and (y12, y11, y10, y9) and x9 are computed in the second circuit 320.


As mentioned earlier, the third circuit 330 uses several ancillary bit-values and auxiliary bit-values that are determined by the first circuit 310 and the second circuit 320. For example, the ancillary bit-value (q10.8) 550 is computed at the first circuit 310 to represent:






q
10.8
=q
10
∧q
9
∧q
8
=q
10
·q
9
·q
8.


Further, in the second circuit 320, the result of the following addition can be determined using the LUTs 350:













0


0


0


0



r
13




r
12





+


0



q
10




q
9




q
8




q
7




q
6





=



t
17




z
16




z
15




z
14




z
13




z
12







The result of the addition can be computed as a Boolean function of at most six inputs that are computed in the first circuit 310 as follows:






z
12
=z
12(r12,q6)






z
13
=z
13(r13,r12,q7,q6)






z
14
=z
14(r13,r12,q8,q7,q6)






z
15
=z
15(r13,r12,q9,q8,q7,q6)






z
16
=z
16(r13,r12,q10,q9.8,q7,q6),





and the bit






z
15.13
=z
15.13(r13,r12,q9,q8,q7,q6)=z15·z14·z13


The z15.13 bit-value is the sixth ancillary bit-value 680. The bit p16 can be determined in the third circuit 330 as a Boolean function of six inputs that are determined by the LUTs 350 in the first circuit 310 and/or the second circuit 320:






p
16
=p
16(z16,z15.13,z12,y12,y11.9,x9)


The view 1210 in FIG. 12 depicts the LUT 350 for determining p16 using the above six bit-value input.


Determining the final three MSBs using LUTs 350 is based on the following description of correctness. If N, d, and w, are integers, then:










w
×
d



N





if





and





only





if





d






N
w



.





(
i
)







w
×
d

<

N





if





and





only





if





d







N
-
1

w



.





(
ii
)







The part (i) above holds true because if








w
×
d


N

,

d


N
w


,



d





N
w



.







Conversely, if






d




N
w




,



w
×
d



w
×



N
w






w
×

N
w



=

N
.






In the case (ii) above, if








w
×
d

<
N

,


w
×
d



N
-
1


,



d



N
-
1

w



,


and





d







N
-
1

w



.






Conversely, if






d





N
-
1

w




,



w
×
d



w
×




N
-
1

w






w
×


N
-
1

w



=

N
-
1.






Now, a description is provided for determining the MSB p19 using two LUTs 350. Consider t=┌219/w┐. P19(d)=1↔d≥t. This holds true because P19(d)=1 if and only if w×d≥219. It should be noted that here, 19 is used because the result of a 12-bit d and an 8-bit w cannot exceed 219. However, in the cases where w or d have a different number of bits, the exponent in the above condition is different. Based on the description herein, a person skilled in the art can determine that for every dεB12, the function P19(d) can be evaluated using two layers of LUTs 350.


Accordingly, referring back to the flowchart in FIG. 4, the third circuit 330 determines whether d≥t, which can be precomputed as a threshold based on the known w, at block 440. If the condition is satisfied, the p19 is set to 1, at block 442, else p19 is set to 0, at block 444.



FIG. 13 depicts lookup tables for determining p19 according to one or more embodiments of the present invention. The LUTs 350 include a first LUT 1310, a second LUT 1320, and a third LUT 1330 that compares d with the precomputed threshold t. For this purpose, t is represented as t=┌219/w┐=u·26+v, where v<26. Further, d is represented as d=g·26+h (g<26, and h<26). Accordingly, setting p19 to 1 if and only if d≥t, implies setting p19 to 1 if and only if ((u<g) OR (g=u AND v≤h)).


Using only 6-to-1 Boolean functions, the first LUT 1310 determines if u<g, the second LUT 1320 determines if g=u and the third LUT 1330 determines if v≤h. The output of the LUTs is a 1, if the respective conditions hold true, and 0 otherwise. Further, a fourth LUT 1340 receives the outputs from the first LUT 1310, the second LUT 1320, and the third LUT 1330. Depending on the received bit-values, the fourth LUT 1340 determines the value of p19.


Now, a description is provided for determining the MSB p18 using two LUTs 350. It should be noted that p18=1, if and only if one of the following conditions holds:





218≤w×d<219  (i)





219+218≤w×d  (ii)


The following three thresholds can be precomputed based on the known w:







t
01

=






2
18

w









t
10


=







2
19

-
1

w









t
11


=





2
19

+

2
18


w









Accordingly, the method 400 includes setting p18 to 1, at block 452, and else to 0, at block 454, based on the third circuit 330 determining, at block 450, whether the following condition holds:






t
01
≤d≤t
10  (i)






t
11
≤d.  (ii)


The above is further equivalent to setting p18 to 1 if and only if one of the following conditions holds:





(t01<d<t10) or (t11<d)  (i)






d∈{t
01
,t
10
,t
11}.  (ii)


Again, consider d represented as d=g·26+h. Let us denote B2={01, 10, 11}, and then, for every β∈B2, tβ=uβ·26+vβ, where 0≤vβ≤26. Accordingly, determining the value for p18 can be stated as p18=1 if and only if one of the following conditions holds:





1. g>u01 or (g=u01 and h≥v01)(i.e. d≥t01)





and





2. g<u10 or (g=u10 and h≤v10)(i.e., d≤t10)  (i)






g>u
11 or (g=u11 and h≥v11)(i.e.,d≥t11)  (ii)


This can be simplified as p18=1 if and only if one of the following eight conditions holds:





00:(u01<g<u10) or (u11<g)





01:g=u01 and h≥v01





10:g=u10 and h≤v10





11: g=u11 and h≥v11


Consider the notation, that with any inequality of variables x<y, z≤w, etc., a truth value ∅(x<y)∈{0,1}, where 1 is “true,” and 0 is “false,” and logical connectives can be applied in the form, for example, ∅(x=y)=∅(x≤y)∧∅(x≥y).


Accordingly, the above eight conditions can be succinctly stated as:






P
18(d)=[ϕ(t01≤d)∧ϕ(d≤t10)]∨ϕ(t11≤d).


The values for t01, t10, and t11 can be represented as:






t
01
=u
01·26+v01 where 0≤v01<26,






t
10
=u
10·26+v10 where 0≤v10<26,






t
11
=u
11·26+v11 where 0≤v11<26.


Now, for every β∈{01, 10, 11}, uβ=tβ/26; hence, u01≤u10≤u11. Each possible number g is related to u01, u10, and u11 in one of seven possible ways, which can be labeled with three bits as follows:





(001):g<u01





(010):g=u01





(011):u01<g<u10





(100):g=u10





(101):u10<g<u11





(110):g=u11





(111):u11<g


It follows that given g, the particular case label (x1, x2, x3) can be returned by three 6-to-1 Boolean functions, x1(g), x2(g), x3(g). Given (x1, x2, x3), the information required for the evaluation of P18(d) can be expressed as:





(u01<g)≡x1∨(¬x1∧x2∧x3)





(u01=g)≡x1∧¬x2∧x3





(g<u10)≡¬x1





(g=u10)≡x1∧¬x2∧¬x3





(u11<g)≡x1∧x2∧x3





(u11=g)≡x1∧x2∧¬x3


The situation with respect to the relation of h to the vβ is simpler. The only information required for the evaluation of P18(d) is captured by the following 6-to-1 Boolean functions:








y
1



(
h
)


=

{





1




if





h



v
01






0


otherwise










y
2



(
h
)



=

{





1




if





h



v
10






0


otherwise










y
3



(
h
)



=

{



1




if





h



v
11






0



otherwise
.













At this stage, it can be shown that for every d∈B12 the function P18(d) can be evaluated in two layers. The evaluation of P18(d) relies on the inequality relations of d to the tβs. Accordingly:






d≥t
01↔(g>u01)∨[(g=u01)∧(h≥v01)]






d≤t
10↔(g<u10)∨[(g=u10)∧(h≤v10)]






d≥t
11↔(g>u11)∨[(g=u11)∧(h≥v11)]





Further:





ϕ(d≥t01)=ϕ(g>u01)∨(ϕ(g=u01)∧y1(h))





ϕ(d≤t10)=ϕ(g<u10)∨(ϕ(g=u10)∧y2(h))





ϕ(d≥t11)=ϕ(g>u11)∨(ϕg=u11)∨h3(y))


Thus, it follows that the relations of d to the tβs can be evaluated by the following 6-to-1 Boolean function, applied to the 6-tuple (x1(g), x2(g), x3(g), y1(h), y1(h), y3(h)).



FIG. 14 depicts lookup tables for determining p18 according to one or more embodiments of the present invention. The LUTs 350 for determining p18 are in a two-layer setup. The LUTs 350 include a first LUT 1410, a second LUT 1420, and a third LUT 1430 that determine x1(g), x2(g), x3(g), respectively. Further, the LUTs 350 include a fourth LUT 1440, a fifth LUT 1450, and a sixth LUT 1460 that determine y1(h), y2(h), y3(h), respectively. The bit-values of the x1(g), x2(g), x3(g), y1(h), y2(h), y3(h), are used to determine p18.


It can be shown that if 1≤w≤256, then u01<u10. That is because even if w=256,








u
01

=








2
18



/


256




2
6




=





2
10


2
6




=

2
4




;
and







u
10

=








(


2
19

-
1

)



/


256




2
6




=






2
11

-
1


2
6




=


2
5

-
1







Now, a description is provided for determining the third MSB p17 using three layers of LUTs. p17=1 if and only if one of the following conditions holds:





217≤w×d<218  (i)





218+217≤w×d<219  (ii)





219+217≤w×d<219+217  (iii)





219+218+217≤w×d  (iv)


The conditions can be restated using seven thresholds:







t
001

=






2
17

w









t
010


=







2
18

-
1

w









t
011


=







2
18

+

2
17


2









t
100


=





2
19

-
1

w













t
101

=







2
19

+

2
17


w









t
110


=







2
19

+

2
18

-
1

w









t
111


=





2
19

+

2
18

+

2
17


w









The conditions can be restated using these seven thresholds as:






t
001
≤d≤t
010  (i)






t
011
≤d≤t
100  (ii)






t
101
≤d≤t
110  (iii)






t
111
≤d.  (iv)


Referring to the flowchart in FIG. 4, method 400 includes setting p17=1, at block 462, if the above conditions using the thresholds are met, at block 460; otherwise, p17=0, at block 464. The conditions can be further restated as p17=1 if and only if one of the following conditions holds:





(t001<d<t010) or (t011<d<t100) or (t101<d<t110) or (t111<d)  (i)






d∈{t
001
,t
010
,t
011
,t
100
,t
110
,t
111}.  (ii)


Again, consider d represented as d=g·26+h. Let us denote B3={001, 010, 011, 100, 101, 110, 111}, and then, for every β∈B3, tβ=uβ·26+vβ, where 0≤vβ≤26. Accordingly, determining the value for p18 can be stated as p17=1 if and only if one of the following conditions holds:





1. g>u001 or (g=u001 and h≥v001)(i.e., d≥t001)





and





2. g<u010 or (g=u010 and h≤v010)(i.e., d≤t010)  (i)





1. g>u011 or (g=u011 and h≥v011)(i.e., d≥t011)





and





2. g<u100 or (g=u100 and h≤v100)(i.e., d≤t100)  (ii)





1. g>u101 or (g=u101 and h≥v101)(i.e., d≥t101)





and





2. g<u110 or (g=u110 and h≤v110)(i.e., d≤t110)  (iii)






g<u
111 or (g=u111 and h≥v111)(i.e., d≥t111).


This can be simplified as p17=1 if and only if one of the following eight conditions holds:





000:(u001<g<u010) or (u011<g<u100) or (u101<g<u110) or (u111<g)





001:g=u001 and h≥v001





010:g=u010 and h≤v010





011:g=u011 and h≥v011





100:g=u100 and h≤v100





101:g=u101 and h≥v101





110:g=u110 and h≤v110





111:g=u111 and h≥v111


Any Boolean function of (x1, . . . , x4) is also a Boolean function of g, so it can be evaluated in the first circuit 310. Accordingly, to compress the representation to three bits based on the following:


If g satisfies one of the following, then P17(d)=1:






u
001
<g<u
010  (i)






u
011
<g<u
100  (ii)






u
101
<g<u
110  (iii)






u
111
<g  (iv)


If g satisfies one of the following, then P17(d)=0:






g<u
001  (i)






u
010
<g<u
011  (ii)






u
100
<g<u
101  (iii)






u
110
<g<u
113  (iv)


However, this still needs encoding of seven possible equalities, namely g=uβ, β∈B3, and so, three bits cannot be used to encode nice cases. However, for every E B3, the case g=up can be encoded by 0β; for example, g=u011 is encoded by 011. Accordingly, the case for P17(d)=1 can be encoded by:





(u001<g<u010) or (u011<g<u100) or (u101<g<u110) or (u111<g)


Additionally, the case for P17(d)=0 can be encoded by:





(u010<g<u011) or(u100<g<u101) or(u110<g<u111)


This four-bit encoding is denoted as (z1, z2, z3, z4). The encoding is depicted by view 1510 in FIG. 15. Thus, the four Boolean functions are:






z
1=ϕ(u001<g<u010)∨ϕ(u011<g<u100)∨ϕ(u101<g<u110)∨ϕ(u111<g)






z
2=ϕ(g=u100)∨ϕ(g=u101)∨ϕ(g=u110)∨ϕ(g=u111)






z
3=ϕ(g=u010)∨ϕ(g=u011)∨ϕ(g=u110)∨ϕ(g=u111)






z
4=ϕ(g=u001)∨ϕ(g=u011)∨ϕ(g=u101)∨ϕ(g=u111)


The situation with respect to the relation of h to the vβs is simpler but more complicated than the case of p18. Here, the following truth-values are required:





ϕ(h≥v001),ϕ(h≤v010),





ϕ(h≥v011),ϕ(h≤v100),





ϕ(h≥v101),ϕ(h≤v110),





ϕ(h≥v111).


Let v1<v2< . . . <vl (l≤7) be the distinct elements of {vβ:β∈B3} and let ψ(β)∈{1, . . . , l} be the index such that vψ(β)=vβ. Thus, the above seven values can be expressed as:





ϕ(h≥vψ(001)),ϕ(h≤vψ(010)),





ϕ(h≥vψ(011)),ϕ(h≤vψ(100)),





ϕ(h≥vψ(101)),ϕ(h≤vψ(110)),





ϕ(h≥vψ(111)),


The relations of h to all of these seven values can be captured by three bits (y1, y2, y3) as follows. First note, that each occurrence of vβ is involved in precisely one inequality, namely, depending on β either ∅(h≥vp) has to be known or ∅(h≤vp) has to be known. The former occurs when β∈{001, 011, 101, 111}, and the latter when β∈{010, 100, 110}. Therefore, there are precisely seven cases that are needed to characterize the location of h with respect to v1<v2< . . . <vl so that the information required is retrieved. The cases can be viewed as a partition of the set {0, 1, . . . , 63} into at most eight intervals, some of which may consist of a single point. These seven cases are defined by inserting the seven inequality signs that occur in the above seven conditions in the appropriate places. The inequality signs also take into account v1, . . . , vl as follows. Let 1≤i≤1, and consider a certain value vi. If i=ψ(β), then (i) if β∈{001, 011, 101, 111}, then include an inequality≤vi, and (ii) if β∈{010, 100, 110}, then include an inequality vi≤. If there exists β1∈{001, 011, 101, 111}, and β2 ∈{010,100,110}, such that i=ψ(β1)=ψ(β2), then two inequalities are included: ≤vi, and vi≤. If it has to be known whether or not h≤vβ, then in the partition vβ must be the right endpoint of one of the intervals, and if it has to be known whether or not h≥vβ, then in the partition vβ must be the left endpoint of one of the intervals. This way, if it is known which of the intervals contains h, then the information that is required about its relation to any vβ is known. For example, suppose:


v001=3 v010=4


v011=7 v100=8


v101=11 v110=12


v111=15


Here, it is to be determined whether or not h≥3, whether or not h<4, whether or not h≥7, whether or not h≤8, whether or not h≥11, whether or not h≤12, and whether or not h≥15. Therefore, the partition into eight intervals is the following:





000:0≤h≤2





001:3≤h≤4





010:5≤h≤6





011:7≤h≤8





100:9≤h≤10





101:11≤h≤12





110:13≤h≤14





111:15≤h≤63


The labels on the left provide the encoding with three bits, so the corresponding three Boolean functions are represented in view 1520 in FIG. 15. The Boolean functions b1, b2, and b3 are the following:






b
1(h)=ϕ(9≤h≤63)






b
2(h)=ϕ(5≤h≤8)∨ϕ(13≤h≤63)






b
3(h)=ϕ(3≤h≤4)∨ϕ(7≤h≤8)∨ϕ(11≤h≤12)∨ϕ(15≤h≤63).


Thus, it follows that the relations of d to the tβs can be evaluated by a single 7-to-1 Boolean function ƒ(z1, . . . , z4, b1, b2, b3). This evaluation can be carried out as follows. First, a Boolean function ƒ(z2, z3, z4, b1, b2, b3) is defined and implemented in the second circuit 320 by setting its value to 1 when (z2, z3, z4)≠(0, 0, 0), and every x in the interval indicated by (b1, b2, b3) satisfies the bound on h that is required given that g has the value indicated by (z2, z3, z4); otherwise, ƒ(z2, z3, z4, b1, b2, b3)=0. In the third circuit 330, the value of P17 is set to 1 if z1=1 or ƒ(z2, z3, z4, b1, b2, b3)=1; otherwise, P17 is set to 0.



FIG. 16 depicts a three-layer LUT circuit for determining p17 according to one or more embodiments of the present invention. The LUTs 350 include a set of four LUTs—a first LUT 1610, a second LUT 1620, a third LUT 1630, and a fourth LUT 1640—for determining results of z1, z2, z3, and z4, respectively by comparing portions of g and u as described above. Further, the LUTs 350 include another set of three LUTs—a fifth LUT 1650, a sixth LUT 1660, and a seventh LUT 1670—for determining b1, b2, b3, respectively by encoding h as described above. An eighth LUT 1680 uses the z2, Z3, Z4, and b1, b2, b3 to determine an output a1. A ninth LUT 1690 uses z1 and a1 to determine p17.


Accordingly, embodiments of the present invention provide a circuit of 6-input Boolean gates for multiplying a given (known) Boolean vector w=(w7, w6, w5, w4, w3, w2, w1, w0) by any Boolean input vector d=(d11, d10, d9, d8, d7, d6, d5, d4, d3, d2, d1, d0). w has a predetermined length, for example, eight bits. d has a predetermined length, for example, twelve bits. By implementing the circuit using LUTs, for example, in an FPGA, an ASIC, or any other electronic circuit or device, embodiments of the present invention improve the efficiency of determining the product result in lesser time than performing the computation. The circuit can be used in a variety of computing environments, such as a neural network system, a computing device, a quantum computer, a mainframe computer, a memory controller, or any other type of apparatus that requires computing multiplications, and particularly where one of the numbers in the multiplication is a known value.


Further, embodiments of the present invention use FPGAs that limit each of the LUTs to use at most six inputs. Accordingly, embodiments of the present invention facilitate a practical application of determining a multiplication result and improving the efficiency of such computations performed by present solutions. Embodiments of the present invention, accordingly, provide an improvement to a particular technology, in this case, computing technology. Further yet, embodiments of the present invention facilitate improvements to present solutions such as neural networks and other types of computing systems by improving their efficiency at computing such multiplications, the results of which are used in various applications.


The neural network system 200 can be implemented using a computer system or any other apparatus. Turning now to FIG. 17, a computer system 1700 is generally shown in accordance with an embodiment. The computer system 1700 can be an electronic, computer framework comprising and/or employing any number and combination of computing devices and networks utilizing various communication technologies, as described herein. The computer system 1700 can be easily scalable, extensible, and modular, with the ability to change to different services or reconfigure some features independently of others. The computer system 1700 may be, for example, a server, desktop computer, laptop computer, tablet computer, or smartphone. In some examples, the computer system 1700 may be a cloud computing node. Computer system 1700 may be described in the general context of computer system executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, and so on that perform particular tasks or implement particular abstract data types. Computer system 1700 may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media, including memory storage devices.


As shown in FIG. 17, the computer system 1700 has one or more central processing units (CPU(s)) 1701a, 1701b, 1701c, etc. (collectively or generically referred to as processor(s) 1701). The processors 1701 can be a single-core processor, multi-core processor, computing cluster, or any number of other configurations. The processors 1701, also referred to as processing circuits, are coupled via a system bus 1702 to a system memory 1703 and various other components. The system memory 1703 can include a read-only memory (ROM) 1704 and a random access memory (RAM) 1705. The ROM 1704 is coupled to the system bus 1702 and may include a basic input/output system (BIOS), which controls certain basic functions of the computer system 1700. The RAM is read-write memory coupled to the system bus 1702 for use by the processors 1701. The system memory 1703 provides temporary memory space for operations of said instructions during operation. The system memory 1703 can include random access memory (RAM), read-only memory, flash memory, or any other suitable memory systems.


The computer system 1700 comprises an input/output (I/O) adapter 1706 and a communications adapter 1707 coupled to the system bus 1702. The I/O adapter 1706 may be a small computer system interface (SCSI) adapter that communicates with a hard disk 1708 and/or any other similar component. The I/O adapter 1706 and the hard disk 1708 are collectively referred to herein as a mass storage 1710.


Software 1711 for execution on the computer system 1700 may be stored in the mass storage 1710. The mass storage 1710 is an example of a tangible storage medium readable by the processors 1701, where the software 1711 is stored as instructions for execution by the processors 1701 to cause the computer system 1700 to operate, such as is described hereinbelow with respect to the various Figures. Examples of computer program product and the execution of such instruction is discussed herein in more detail. The communications adapter 1707 interconnects the system bus 1702 with a network 1712, which may be an outside network, enabling the computer system 1700 to communicate with other such systems. In one embodiment, a portion of the system memory 1703 and the mass storage 1710 collectively store an operating system, which may be any appropriate operating system, such as the z/OS or AIX operating system from IBM Corporation, to coordinate the functions of the various components shown in FIG. 17.


Additional input/output devices are shown as connected to the system bus 1702 via a display adapter 1715 and an interface adapter 1716 and. In one embodiment, the adapters 1706, 1707, 1715, and 1716 may be connected to one or more I/O buses that are connected to the system bus 1702 via an intermediate bus bridge (not shown). A display 1719 (e.g., a screen or a display monitor) is connected to the system bus 1702 by a display adapter 1715, which may include a graphics controller to improve the performance of graphics intensive applications and a video controller. A keyboard 1721, a mouse 1722, a speaker 1723, etc. can be interconnected to the system bus 1702 via the interface adapter 1716, which may include, for example, a Super I/O chip integrating multiple device adapters into a single integrated circuit. Suitable I/O buses for connecting peripheral devices such as hard disk controllers, network adapters, and graphics adapters typically include common protocols, such as the Peripheral Component Interconnect (PCI). Thus, as configured in FIG. 17, the computer system 1700 includes processing capability in the form of the processors 1701, and, storage capability including the system memory 1703 and the mass storage 1710, input means such as the keyboard 1721 and the mouse 1722, and output capability including the speaker 1723 and the display 1719.


In some embodiments, the communications adapter 1707 can transmit data using any suitable interface or protocol, such as the internet small computer system interface, among others. The network 1712 may be a cellular network, a radio network, a wide area network (WAN), a local area network (LAN), or the Internet, among others. An external computing device may connect to the computer system 1700 through the network 1712. In some examples, an external computing device may be an external web server or a cloud computing node.


It is to be understood that the block diagram of FIG. 17 is not intended to indicate that the computer system 1700 is to include all of the components shown in FIG. 17. Rather, the computer system 1700 can include any appropriate fewer or additional components not illustrated in FIG. 17 (e.g., additional memory components, embedded controllers, modules, additional network interfaces, etc.). Further, the embodiments described herein with respect to computer system 1700 may be implemented with any appropriate logic, wherein the logic, as referred to herein, can include any suitable hardware (e.g., a processor, an embedded controller, or an application-specific integrated circuit, among others), software (e.g., an application, among others), firmware, or any suitable combination of hardware, software, and firmware, in various embodiments.


The present invention may be a system, a method, and/or a computer program product at any possible technical detail level of integration. The computer program product may include a computer-readable storage medium (or media) having computer-readable program instructions thereon for causing a processor to carry out aspects of the present invention.


The computer-readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer-readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer-readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer-readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.


Computer-readable program instructions described herein can be downloaded to respective computing/processing devices from a computer-readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and/or a wireless network. The network may comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium within the respective computing/processing device.


Computer-readable program instructions for carrying out operations of the present invention may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state-setting data, configuration data for integrated circuitry, or either source-code or object code written in any combination of one or more programming languages, including an object-oriented programming language such as Smalltalk, C++, or the like, and procedural programming languages, such as the “C” programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) may execute the computer-readable program instruction by utilizing state information of the computer-readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present invention.


Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.


These computer-readable program instructions may be provided to a processor of a general-purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, a programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable storage medium having instructions stored therein comprises an article of manufacture including instructions which implement aspects of the function/act specified in the flowchart and/or block diagram block or blocks.


The computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer-implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions/acts specified in the flowchart and/or block diagram block or blocks.


The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the Figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts or carry out combinations of special purpose hardware and computer instructions.


The descriptions of the various embodiments of the present invention have been presented for purposes of illustration, but are not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen to best explain the principles of the embodiments, the practical application or technical improvement over technologies found in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments described herein.


Various embodiments of the invention are described herein with reference to the related drawings. Alternative embodiments of the invention can be devised without departing from the scope of this invention. Various connections and positional relationships (e.g., over, below, adjacent, etc.) are set forth between elements in the following description and in the drawings. These connections and/or positional relationships, unless specified otherwise, can be direct or indirect, and the present invention is not intended to be limiting in this respect. Accordingly, a coupling of entities can refer to either a direct or an indirect coupling, and a positional relationship between entities can be a direct or indirect positional relationship. Moreover, the various tasks and process steps described herein can be incorporated into a more comprehensive procedure or process having additional steps or functionality not described in detail herein.


The following definitions and abbreviations are to be used for the interpretation of the claims and the specification. As used herein, the terms “comprises,” “comprising,” “includes,” “including,” “has,” “having,” “contains” or “containing,” or any other variation thereof, are intended to cover a non-exclusive inclusion. For example, a composition, a mixture, process, method, article, or apparatus that comprises a list of elements is not necessarily limited to only those elements but can include other elements not expressly listed or inherent to such composition, mixture, process, method, article, or apparatus.


Additionally, the term “exemplary” is used herein to mean “serving as an example, instance or illustration.” Any embodiment or design described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments or designs. The terms “at least one” and “one or more” may be understood to include any integer number greater than or equal to one, i.e., one, two, three, four, etc. The terms “a plurality” may be understood to include any integer number greater than or equal to two, i.e., two, three, four, five, etc. The term “connection” may include both an indirect “connection” and a direct “connection.”


The terms “about,” “substantially,” “approximately,” and variations thereof, are intended to include the degree of error associated with measurement of the particular quantity based upon the equipment available at the time of filing the application. For example, “about” can include a range of ±8% or 5% or 2% of a given value.


For the sake of brevity, conventional techniques related to making and using aspects of the invention may or may not be described in detail herein. In particular, various aspects of computing systems and specific computer programs to implement the various technical features described herein are well known. Accordingly, in the interest of brevity, many conventional implementation details are only mentioned briefly herein or are omitted entirely without providing the well-known system and/or process details.

Claims
  • 1. A method for multiplying two binary numbers, the method comprising: configuring, in an integrated circuit, a plurality of lookup tables based on a known binary number (w), the lookup tables being configured in three layers;receiving, by the integrated circuit, an input binary number (d); anddetermining, by the integrated circuit, a binary multiplication result (p) of the known binary number w and the input binary number d by determining each bit (pi) from p using the lookup tables, based on a specific combination of bits from the known binary number w and from the input binary number d, wherein the notation jx is binary notation to represent the xth rightmost bit of a binary number j, bit j0 being the rightmost bit of j.
  • 2. The method of claim 1, wherein the known binary number w is an 8-bit binary number.
  • 3. The method of claim 1, wherein the input binary number d has a predetermined number of bits.
  • 4. The method of claim 3, wherein the input binary number d is a 12-bit binary number.
  • 5. The method of claim 4, wherein the input binary number d is received from a 12-bit image sensor.
  • 6. The method of claim 1, wherein bits p5, p4, p3, p2, p1, and p0 of the multiplication result p are determined by a first circuit from the integrated circuit based on bits d5, d4, d3, d2, d1, and do of the input binary number d, the first circuit comprising a first one of the layers of the lookup tables.
  • 7. The method of claim 6, wherein bits p8, p7, and p6, of the multiplication result p are determined by a second circuit from the integrated circuit based on a first set of auxiliary bits computed by the first circuit, the second circuit comprising a second one of the layers of the lookup tables.
  • 8. The method of claim 7, wherein bits p16, p15, p14, p13, p12, p11, and p10 of the multiplication result p are determined by a third circuit from the integrated circuit based on auxiliary bits computed by the second circuit, the third circuit comprising a third one of the layers of the lookup tables.
  • 9. The method of claim 8, wherein determining bit p19 of the multiplication result p comprises: determining, by using a subset of the lookup tables, that t≤d, wherein t=┌219/w┐ is a precomputed threshold, and d is the input binary number; andin response to t≤d, setting p19 to 1, and otherwise setting p19 to 0.
  • 10. The method of claim 8, wherein determining bit p18 of the multiplication result p comprises: precomputing threshold values t01, t10, and t11 using the known binary number w: t01=┌218/w┐, t10=└(219−1)/w┘, andt11=┌(219+218)/w┐; andin response to (t11≤d) or (t01≤d≤t10), setting the bit p18 to 1, and otherwise setting the bit p18 to 0, d being the input binary number.
  • 11. The method of claim 8, wherein determining bit p17 of the multiplication result p comprises: precomputing a plurality of threshold values using the known binary number w: t001=┌217/w┐, t010=└(218−1)/w┘, t011=┌(218+217)/w┐, t100=└(219−1)/w┘, t101=┌(219+217)/w┐, t110=└(219+218−1)/w┘, andt111=┌(219+218+217)/w┐; andsetting the bit p17 to 1 in response to a subset of the plurality of threshold values: t111≤d, t101≤d≤t110,t011≤d≤t100, andt001≤d≤t010; andsetting p17 to 0 otherwise, wherein d is the input binary number.
  • 12. A system comprising: a memory device that stores a known binary number (w); anda multiplication circuit that is configured to perform a method to determine a multiplication result (p) of the known binary number w with an input binary number (d) that is received dynamically, the method comprising: configuring a plurality of lookup tables in the multiplication circuit based on the known binary number w, wherein the lookup tables are setup in three layers; anddetermining the multiplication result p of the known binary number w and the input binary number d using the lookup tables, wherein each bit (pi) from the multiplication result p is determined from the lookup tables based on specific combinations of bits from the known binary number w and from the input binary number d, wherein jx is a binary notation that represents the xth rightmost bit of j, with bit j0 being the rightmost bit of j.
  • 13. The system of claim 12, wherein bits p5, p4, p3, p2, p1, and p0 of the multiplication result p are determined by a first layer of the lookup tables from the multiplication circuit based on bits d5, d4, d3, d2, d1, and d0 of input binary number d.
  • 14. The system of claim 13, wherein the bits p8, p7, and p6, of the multiplication result p, are determined by a second layer of the lookup tables from the multiplication circuit based on a first set of auxiliary bits computed by the first layer.
  • 15. The system of claim 14, wherein bits p16, p15, p14, p13, p12, p11, and p10 of the multiplication result p are determined by a third layer of the lookup tables from the multiplication circuit based on auxiliary bits computed by the second layer.
  • 16. The system of claim 13, wherein determining bit p19 of the multiplication result p comprises: determining, using a subset of lookup tables, that t≤d, wherein t=┌219/w┐ is a precomputed threshold; andin response to t≤d, setting p19 to 1, and otherwise setting the bit p19 to 0, d being the input binary number.
  • 17. The system of claim 13, wherein determining bit p18 of the multiplication result p comprises: precomputing a plurality of threshold values t01, t10, and t11 based on the known binary number w: t01=┌218/w┐, t10=└(219−1)/w┘, andt11=┌(219+218)/w┐; andin response to (t11≤d) or (t01≤d≤t10), setting the bit p18 to 1, and otherwise setting the bit p18 to 0, wherein d is the input binary number.
  • 18. The system of claim 11, wherein determining bit p17 of the multiplication result p comprises: precomputing a plurality of threshold values using the known binary number: t001=┌217/w┐, t010=└(218−1)/w┘, t011=┌(218+217)/w┐, t100=└(219−1)/w┘, t101=┌(219+217)/w┐, t110=└(219+218−1)/w┘, andt111=┌(219+218+217)/w┐; andsetting the bit p17 to 1 in response to: t111≤d, t101≤d≤t110,t011≤d≤t100, andt001≤d≤t010; andsetting the bit p17 to 0 otherwise, wherein d is the input binary number.
  • 19. A neural network system comprising: a multiplication circuit configured to determine a multiplication result (p) of multiplying a weight value (w) that has a known value with an input value (d) that is received dynamically, wherein, p, d, and w are binary numbers, determining the multiplication result p comprises:configuring a plurality of lookup tables in an integrated circuit based on the weight value w that is a known value, the lookup tables are arranged in three layers; andoutputting the multiplication result p using the lookup tables, wherein each bit of the multiplication result p is independently determined from the lookup tables based on specific combination of bits from the weight value w and from the input value d, wherein a notation jx represents the xth bit of j from the right, with bit j0 being the rightmost bit of j.
  • 20. The neural network system of claim 19, wherein the integrated circuit is a field programmable gate array.
  • 21. The neural network system of claim 20, wherein each of the lookup tables receives at most 6 input bit-values and outputs a single bit-value in response.
  • 22. An electronic circuit for determining a multiplication result (p) of a weight value (w) and an input value (d) that is received dynamically, wherein determining the multiplication result comprises: configuring a plurality of lookup tables based on the weight value (w), wherein the lookup tables are configured in three layers; andoutputting a respective bit (pi) of the multiplication result (p) using the lookup tables based on specific combination of bits from the weight value w and from the input value d, wherein a notation jx represents the xth bit of j from the right, with bit j0 being the rightmost bit of j.
  • 23. The electronic circuit of claim 22, wherein: a first subset of the lookup tables determines bits p5, p4, p3, p2, p1, and p0 of the multiplication result p;a second subset of the lookup tables determines bits p8, p7, and p6, of the multiplication result p;a third subset of the lookup tables determines bits p16, p15, p14, p13, p12, p11, and p10 of the multiplication result p; anda fourth subset of the lookup tables determines bits p19, p18, and p17 of the multiplication result p.
  • 24. A device comprising: a field programmable gate array that includes a plurality of lookup tables configured in three layers to realize a multiplication circuit for two binary numbers.
  • 25. The field programmable gate array of claim 24, wherein each of the lookup tables includes at most 6 inputs.
  • 26. A method comprising: using the device of claim 24 to multiply (i) a 12-bit variable input binary number by (ii) an 8-bit known value binary number.
  • 27. The method of claim 26, wherein the input binary number is obtained from a 12-bit sensor.