Convolutional computation device
A convolutional computation device includes a two-dimensional circulation shift register unit and one or more multiplier-accumulators. The two-dimensional circulation shift register has storage elements, cyclically shifts the data among the storage elements, provides one or more input window in a predetermined area, and selects the data stored in one of the storage elements disposed in the input window as input data. The one or more multiplier-accumulators generate output data by performing a multiply-accumulate operation on the input data input from the two-dimensional circulation shift register unit and weight data from a predetermined filter.
1 . A convolutional computation device comprising:
a two-dimensional circulation shift register unit that has a plurality of storage elements arranged two-dimensionally and respectively storing data, cyclically shifts the data among the plurality of storage elements, provides at least one input window in a predetermined area, and selects the data stored in one of the plurality of storage elements disposed in the at least one input window as input data; and
at least one multiplier-accumulator that generates output data by performing a multiply-accumulate operation on the input data input from the two-dimensional circulation shift register unit and weight data from a predetermined filter,
wherein:
each storage element of the plurality of storage elements includes a multiplexer and a flip-flop, the flip-flop in each storage element is configured to store data output by the multiplexer in each storage element, the multiplexer in each storage element is directly connected by signal lines to the flip-flops of directly adjacent storage elements of the plurality of storage elements, the directly adjacent storage elements being directly adjacent via signal lines in each of an up direction and a down direction from each storage element and directly adjacent via signal lines in each of a left direction and a right direction from each storage element, and the multiplexer in each storage element is configured to select one data element of the directly adjacent storage elements and output data from the selected one data element.
2 . The convolutional computation device according to claim 1 , wherein:
the at least one multiplier-accumulator performs the multiply-accumulate operation based on a Winograd algorithm;
the predetermined filter is a 3 rows and 3 columns matrix filter;
the input data is a 5 rows and 5 columns matrix input data; and
the output data is a 3 rows and 3 columns matrix output data.
3 . The convolutional computation device according to claim 2 ,
wherein the Winograd algorithm is defined by an equation:
Y=A T [[GgG T ]⊙[B T dB]] A (2)
where
Y is an output data;
A, B and G are constant matrixes;
g is a weight data;
d is an input data;
a weight term of GgG T is calculated in advance; and
the constant matrixes B and A have one of the elements 0, ±1, ±2, ±3, and ±4.
4 . The convolutional computation device according to claim 1 , wherein:
the two-dimensional circulation shift register unit has a plurality of input windows including the at least one input window to select a plurality of the input data,
the at least one multiplier-accumulator further comprises a plurality of multiplier-accumulators into which the plurality of the input data are input from the two-dimensional circulation shift register unit, respectively.
5 . The convolutional computation device according to claim 1 , wherein:
the two-dimensional circulation shift register unit changes an input window area of the at least one input window or a shift amount of the shift that cyclically shifts the data.
6 . The convolutional computation device according to claim 1 , wherein:
each storage element is connected to only four storage elements arranged vertically and horizontally of the each storage element.
7 . The convolutional computation device according to claim 1 , further comprising a memory interface connected to the two-dimensional circulation shift register unit, wherein
data elements are sequentially input from the memory interface to each storage element in a bottom row of the two-dimensional circulation shift register unit.
8 . The convolutional computation device according to claim 1 , wherein
the at least one multiplier-accumulator includes an input register, a weight register, at least one multiplier, and an adder tree,
the input register is configured to hold the input data in a plurality of input data element storage areas,
the weight register is configured to hold the weight data in a plurality of weight data element storage areas,
the at least one multiplier is configured to multiply each input data element of the plurality of input data element storage areas with respectively each weight data element of the plurality of weight data element storage areas to generate multiplier results, and
the adder tree is configured to calculate a total multiplication result from the multiplier results generated by the at least one multiplier.
9 . The convolutional computation device according to claim 1 , wherein
the at least one input window comprises a plurality of input window areas which are configured to be switched with each other in the two-dimensional circulation shift register unit.
10 . The convolutional computation device according to claim 1 , wherein the at least one input window comprises a plurality of input window areas which are configured to be sequentially switched to select the input data, and the output data is sequentially generated from the input data.
11 . The convolutional computation device according to claim 1 , wherein the multiply-accumulate operation is performed only by a bit shift operation and an addition operation.
12 . The convolutional computation device according to claim 1 , wherein
the plurality of storage elements which are arranged two-dimensionally are arranged in rows and columns.