Memory circuit with multiply-accumulate (MAC) circuit and method of operating the same
View Patent ↗A memory circuit includes a memory cell array configured to store a set of stored data, a multiply-accumulate (MAC) circuit and an input output (IO) circuit. The set of stored data is a first set of weight signals or a set of inverted weight signals. The MAC circuit is configured to generate a first set of data in response to a second set of data and the set of stored data. The IO circuit includes a first circuit and a second circuit. The first circuit is configured to send the first set of weight signals in response to a set of enable signals, or generate the set of inverted weight signals in response to a set of inverted enable signals. The second circuit is configured to output a first set of output signals in response to the first set of data and the set of enable signals.
1 . A memory circuit, comprising:
a memory cell array configured to store a set of stored data, the set of stored data being one of a first set of weight signals or a set of inverted weight signals, the set of inverted weight signals being inverted from the first set of weight signals;
a multiply-accumulate (MAC) circuit coupled to the memory cell array, and configured to generate a first set of data in response to a second set of data and the set of stored data; and
an input output (IO) circuit coupled to the MAC circuit, the IO circuit comprising:
a first circuit coupled to the memory cell array, and configured to:
send the first set of weight signals in response to at least a set of enable signals; or
generate the set of inverted weight signals in response to at least a set of inverted enable signals;
a second circuit coupled to the MAC circuit, and configured to output a first set of output signals in response to at least the first set of data and the set of enable signals;
a third circuit coupled to the first circuit and the second circuit, and configured to generate the set of enable signals in response to at least the set of stored data in the memory cell array; and
a fourth circuit coupled to the first circuit and the third circuit, and configured to generate the set of inverted enable signals in response to the set of enable signals;
a set of word lines coupled to the memory cell array; and
an input driver circuit coupled to the memory cell array by the set of word lines, and being configured to send a set of word line signals on the set of word lines, to generate a count signal, and to send the count signal to the IO circuit.
2 . The memory circuit of claim 1 , further comprising:
a weight buffer circuit coupled to the memory cell array and the first circuit, and configured to send the first set of weight signals to the memory cell array.
3 . The memory circuit of claim 2 , wherein the first circuit comprises:
a first set of paths, each path of the first set of paths comprising:
a first inverter coupled to the fourth circuit and the weight buffer circuit, and configured to generate a corresponding first inverted weight signal of the set of inverted weight signals in response to a corresponding first weight signal of a second set of weight signals and a corresponding first inverted enable signal of the set of inverted enable signals; and
a second set of paths, each path of the second set of paths comprising:
a second inverter configured to generate a corresponding first intermediate weight signal of an intermediate set of inverted weight signals in response to the corresponding first weight signal of the second set of weight signals; and
a third inverter coupled to the second inverter, the third circuit and the weight buffer circuit, and configured to generate a corresponding first weight signal of the first set of weight signals in response to the corresponding first intermediate weight signal of the intermediate set of inverted weight signals and a corresponding first enable signal of the set of inverted enable signals,
wherein each path of the first set of paths and each corresponding path in the second set of paths are coupled together.
4 . The memory circuit of claim 1 , wherein the fourth circuit comprises:
a first set of inverters, each inverter of the first set of inverters is configured to generate a corresponding inverted signal of the set of inverted enable signals in response to a corresponding enable signal of the set of enable signals.
5 . The memory circuit of claim 1 , wherein the third circuit comprises:
an accumulator coupled to the first circuit and the fourth circuit, and configured to generate a set of accumulation signals in response to the set of stored data; and
a comparator coupled to the accumulator, and configured to generate a set of output comparison signals in response to the set of accumulation signals and a first count signal, the set of output comparison signals being the set of enable signals, the first count signal corresponding to one half of a number of word lines coupled to the memory cell array.
6 . The memory circuit of claim 1 , wherein the second circuit comprises:
a set of analog-to-digital converters (ADC), each ADC of the set of ADCs is configured to generate a corresponding digital signal of a set of digital signals in response to a corresponding datum of the set of stored data; and
a set of subtractors, each subtractor of the set of subtractors is configured to generate a corresponding output signal of the first set of output signals in response to at least a corresponding enable signal of the set of enable signals or the count signal on the set of word lines,
wherein each ADC of the set of ADCs and each subtractor of the set of subtractors is coupled to a corresponding column of memory cells in the memory cell array.
7 . The memory circuit of claim 1 , wherein the input driver circuit comprises:
a set of input driver circuits, each input driver circuit of the set of input driver circuits is configured to generate a corresponding word line signal of the set of word line signals in response to a corresponding input signal of a set of input signals; and
a counter coupled to the set of input driver circuits, and the counter being configured to count a number of inputs coupled to the set of input driver circuits thereby generating the count signal, and the counter being further configured to send the count signal to the IO circuit, the count signal being a number of the set of word lines.
8 . A memory circuit, comprising:
a compute-in-memory (CIM) macro circuit, the CIM macro circuit comprising:
a memory cell array including rows and columns, and configured to store a set of stored data, the set of stored data being one of a first set of weight signals or a set of inverted weight signals, the set of inverted weight signals being inverted from the first set of weight signals; and
a multiply-accumulate (MAC) circuit coupled to the memory cell array, and configured to generate a first set of data in response to a second set of data and the set of stored data; and
an input output (IO) circuit coupled to the CIM macro circuit, and configured to output a first set of output signals, the IO circuit comprising:
a write circuit coupled to the memory cell array, and configured to:
send the first set of weight signals in response to at least a set of enable signals; or
generate the set of inverted weight signals in response to at least a set of inverted enable signals;
a read circuit coupled to the MAC circuit, and configured to output the first set of output signals in response to at least the first set of data and the set of enable signals;
a first circuit coupled to the write circuit and the read circuit, and configured to generate the set of enable signals in response to at least the set of stored data in the memory cell array; and
a second circuit coupled to the write circuit and the first circuit, and configured to generate the set of inverted enable signals in response to the set of enable signals;
a set of word lines coupled to the memory cell array; and
an input driver circuit coupled to the memory cell array by the set of word lines, and being configured to send a set of word line signals on the set of word lines, to generate a count signal, and to send the count signal to the IO circuit.
9 . The memory circuit of claim 8 , wherein the second circuit comprises:
a first set of inverters, each inverter of the first set of inverters is configured to generate a corresponding inverted signal of the set of inverted enable signals in response to a corresponding enable signal of the set of enable signals.
10 . The memory circuit of claim 8 , wherein the first circuit comprises:
an accumulator coupled to the write circuit and the second circuit, and configured to generate a set of accumulation signals in response to the set of stored data; and
a comparator coupled to the accumulator, and configured to generate a set of output comparison signals in response to the set of accumulation signals and a first count signal, the set of output comparison signals being the set of enable signals, the first count signal corresponding to one half of a number of word lines coupled to the memory cell array.
11 . The memory circuit of claim 8 , wherein the read circuit comprises:
a set of analog-to-digital converters (ADC), each ADC of the set of ADCs is configured to generate a corresponding digital signal of a set of digital signals in response to a corresponding datum of the set of stored data; and
a set of subtractors, each subtractor of the set of subtractors is configured to generate a corresponding output signal of the first set of output signals in response to at least a corresponding enable signal of the set of enable signals or a first count signal on the set of word lines,
wherein each ADC of the set of ADCs and each subtractor of the set of subtractors is coupled to a corresponding column of memory cells in the memory cell array.
12 . The memory circuit of claim 8 , wherein the input driver circuit comprises:
a set of input driver circuits, each input driver circuit of the set of input driver circuits is configured to generate a corresponding word line signal of the set of word line signals in response to a corresponding input signal of a set of input signals; and
a counter coupled to the set of input driver circuits, and the counter being configured to count a number of inputs coupled to the set of input driver circuits thereby generating the count signal, and the counter being further configured to send the count signal to the IO circuit, the count signal being a number of the set of word lines.
13 . The memory circuit of claim 8 , wherein the write circuit comprises:
a first set of paths, each path of the first set of paths comprising:
a first inverter coupled to the second circuit, and configured to generate a corresponding first inverted weight signal of the set of inverted weight signals in response to a corresponding first weight signal of a second set of weight signals and a corresponding first inverted enable signal of the set of inverted enable signals; and
a second set of paths, each path of the second set of paths comprising:
a second inverter configured to generate a corresponding first intermediate weight signal of an intermediate set of inverted weight signals in response to the corresponding first weight signal of the second set of weight signals; and
a third inverter coupled to the second inverter and the first circuit, and configured to generate a corresponding first weight signal of the first set of weight signals in response to the corresponding first intermediate weight signal of the intermediate set of inverted weight signals and a corresponding first enable signal of the set of inverted enable signals,
wherein each path of the first set of paths and each corresponding path in the second set of paths are coupled together.
14 . A method of operating a memory circuit, the method comprising:
receiving, by a first write circuit, a first set of weight signals;
generating, by a second write circuit, a set of enable signals in response to at least a count signal, the count signal corresponding to a number of active word lines coupled to a memory cell array;
generating, by a first circuit, a set of inverted enable signals in response to the set of enable signals, a set of inverted weight signals being inverted from the first set of weight signals;
performing a write operation of the memory cell array, the performing the write operation of the memory cell array comprising:
at least one of:
outputting, by the first write circuit, the first set of weight signals in response to at least the set of enable signals; or
generating, by the first write circuit, the set of inverted weight signals in response to at least the set of inverted enable signals; and
storing a set of stored data in the memory cell array, the set of stored data being one of the first set of weight signals or the set of inverted weight signals;
performing, by a multiply-accumulate (MAC) circuit, a computing-in memory (CIM) operation between the set of stored data and a first set of input signals thereby generating a first set of data, the MAC circuit being coupled to the memory cell array;
performing, by a read circuit, a read operation of a column of memory cells in the memory cell array, the performing the read operation of the column of memory cells in the memory cell array comprises:
generating, by the read circuit coupled to the MAC circuit and the memory cell array, the first set of output signals in response to at least a first set of data, the set of enable signals or the count signal.
15 . The memory circuit of claim 8 , further comprising:
a weight buffer circuit coupled to the memory cell array and the write circuit, and configured to send the first set of weight signals to the memory cell array.
16 . The memory circuit of claim 8 , further comprising:
a bit line driver circuit coupled to the memory cell array by a set of bit lines.
17 . The memory circuit of claim 16 , further comprising:
a bit line bar driver circuit coupled to the memory cell array by a set of bit line bars.
18 . The memory circuit of claim 1 , further comprising:
a bit line driver circuit coupled to the memory cell array by a set of bit lines.
19 . The memory circuit of claim 18 , further comprising:
a bit line bar driver circuit coupled to the memory cell array by a set of bit line bars.
20 . The memory circuit of claim 1 , wherein the memory cell array comprises a static random-access memory (SRAM) cell array.