In-memory processing device

By integrating a storage area and a multiplier/accumulator in the PIM device, combined with error correction code logic circuitry, the data communication limitation between the memory and the processor is solved, improving the efficiency and accuracy of neural network computation and achieving efficient multiplication/accumulation operations and error correction.

CN112540868BActive Publication Date: 2024-08-27SK HYNIX INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010890186.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-09-23
Filing Date
2020-08-28
Publication Date
2024-08-27
Estimated Expiration
2040-08-28

AI Technical Summary

Technical Problem

In existing technologies, the limited data communication between memory and processor in artificial intelligence systems leads to performance degradation, and the lack of effective multiplication/accumulation operations and error correction mechanisms in PIM devices affects the efficiency of neural network computation.

Method used

The PIM device integrates a storage area and a multiplier/accumulator, combined with error correction code logic circuitry, to realize data multiplication calculation and error correction. It detects and corrects data errors through ECC calculation and performs compensation calculations on the multiplication results when necessary.

Benefits of technology

It improves the data processing speed of neural network computing, reduces multiplication calculation time, enhances the computing efficiency and accuracy of PIM devices, and reduces the communication pressure between memory and processor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112540868B_ABST
    Figure CN112540868B_ABST
Patent Text Reader

Abstract

A processing in memory (PIM) device includes a first storage area and a multiplication / accumulation (MAC) calculator. The first storage area is configured to store first data. The MAC operator is configured to perform MAC calculation on the first data and second data in a MAC mode. When there is an error in the first data, the MAC operator compensates for multiplication result data generated by multiplication calculation of the first data and the second data, and performs addition calculation of the compensated multiplication result data.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims the benefit of Korean Patent Application No. 10-2019-0117098, filed on September 23, 2019, which is hereby incorporated by reference in its entirety. Technical Field

[0003] Various embodiments of the disclosed technology relate to a processing-in-memory (PIM) device and a method of performing multiply / accumulate arithmetic operations in the PIM device. Background Art

[0004] Recently, attention to artificial intelligence (AI) has increased not only in the information technology industry, but also in the financial and medical industries. Therefore, in various fields, artificial intelligence, more precisely, deep learning, is being considered and developed. Generally, techniques for effectively learning a deep neural network (DNN) or a deep network with an increased number of layers compared to a general neural network to utilize the deep neural network (DNN) or the deep network in pattern recognition or reasoning are collectively referred to as deep learning.

[0005] One of the backgrounds or causes of this widespread concern can be attributed to the performance improvement of processors that perform arithmetic operations. In order to improve the performance of artificial intelligence, it is necessary to increase the number of layers that constitute the neural network in artificial intelligence to train artificial intelligence. This trend has continued in recent years, resulting in an exponential increase in the amount of calculation required for the hardware that actually performs the calculation. In addition, if artificial intelligence adopts a general hardware system including a memory and a processor that are separate from each other, the performance of artificial intelligence will be degraded due to the limitation of the amount of data communication between the memory and the processor. In order to solve this problem, a PIM device in which a processor and a memory are integrated in one semiconductor chip has been used as a neural network computing device. Since the PIM device directly performs arithmetic operations in the PIM device, the data processing speed in the neural network can be increased. Summary of the invention

[0006] According to one embodiment, a PIM device may include a first storage area and a multiplication / accumulation (MAC) operator. The first storage area may be configured to store first data. The MAC operator may be configured to perform MAC calculation on the first data and second data in a MAC mode. When an error exists in the first data, the MAC operator compensates for multiplication result data generated by multiplication calculation of the first data and the second data and performs addition calculation of the compensated multiplication result data.

[0007] According to another embodiment, a method for performing a multiplication / accumulation (MAC) calculation in a PIM device is provided. The method may include: outputting first data and parity from a first storage area, outputting second data from a second storage area, performing error correction code (ECC) calculation of the first data and the parity and multiplication calculation of the first data and the second data at the same time, generating an error code indicating an error position of the first data as a result of the ECC calculation, outputting multiplication result data corresponding to a result of the multiplication calculation when there is no error in the first data based on the error code, and performing compensation calculation of the multiplication result data to output compensated multiplication result data when there is an error in the first data based on the error code.

[0008] According to another embodiment, a method for performing a multiplication / accumulation (MAC) calculation in a PIM device is provided. The method may include: outputting first data and parity from a first storage area, outputting second data from a second storage area, performing error correction code (ECC) calculation of the first data and the parity and multiplication calculation of the first data and the second data at the same time, generating an error signal indicating whether an error exists in the first data as a result of the ECC calculation, outputting multiplication result data corresponding to the result of the multiplication calculation when there is no error in the first data based on the error signal, generating an error code indicating an error position of the first data when there is an error in the first data based on the error signal, and performing compensation calculation of the multiplication result data according to the error position based on the error code to output compensated multiplication result data.

[0009] According to one embodiment, a PIM device may include: a first storage area configured to store first data and parity; a second storage area configured to store second data; an error correction code (ECC) logic circuit configured to perform ECC calculation on the first data; and a multiplication and accumulation (MAC) operator configured to perform multiplication calculation of the first data and the second data. The ECC calculation and the multiplication calculation may be performed simultaneously.

[0010] According to another embodiment, a method for performing a multiplication / accumulation (MAC) calculation in a PIM device is provided. The method may include: outputting first data and parity from a first storage area; outputting second data from a second storage area; and performing an error correction code (ECC) calculation of the first data and parity and a multiplication calculation of the first data and the second data at the same time.

[0011] According to another embodiment, a method for performing a multiplication / accumulation (MAC) calculation in a PIM device is provided. The method may include: outputting first data and parity from a first storage area; outputting second data from a second storage area; performing an error correction code (ECC) calculation of the first data and the parity; performing a multiplication calculation of the first data and the second data; outputting multiplication result data corresponding to a result of the multiplication calculation when there is no error in the first data, and performing a compensation calculation of the multiplication result data to output compensated multiplication result data when there is an error in the first data. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The specific features of the disclosed technology are described through various embodiments with reference to the accompanying drawings, in which:

[0013] Figure 1 is a block diagram illustrating a PIM system according to the present disclosure;

[0014] Figure 2 is a schematic diagram showing an example of an arrangement structure between a memory bank and a multiplication / accumulation (MAC) operator included in a PIM device according to the present disclosure;

[0015] Figure 3 is a schematic diagram showing another example of an arrangement structure between a memory bank and a MAC operator included in a PIM device according to the present disclosure;

[0016] Figure 4 is a block diagram showing a configuration of a PIM device according to an embodiment of the present disclosure;

[0017] Figure 5 is a block diagram showing a configuration of an error correction code (ECC) logic circuit included in a PIM device according to an embodiment of the present disclosure;

[0018] Figure 6 A multiplication / accumulation (MAC) calculator included in a PIM device according to an embodiment of the present disclosure is shown;

[0019] Figure 7 shows a multiplication calculation performed by a multiplier included in a PIM device according to an embodiment of the present disclosure;

[0020] Figure 8 One of the multiplication result compensators included in the PIM device according to an embodiment of the present disclosure is shown;

[0021] Fig. 9 is a block diagram showing a configuration of an output logic circuit included in a PIM device according to an embodiment of the present disclosure;

[0022] Fig.10is a block diagram illustrating a write operation performed in a memory mode of a PIM device according to an embodiment of the present disclosure;

[0023] Fig.11 is a block diagram illustrating a read operation performed in a memory mode of a PIM device according to an embodiment of the present disclosure;

[0024] Fig.12 is a flowchart showing a MAC operation performed in a MAC mode by a PIM device according to an embodiment of the present disclosure;

[0025] Fig.13 is a block diagram illustrating a MAC operation performed in a MAC mode by a PIM device according to an embodiment of the present disclosure;

[0026] Fig.14 An example of a multiplication calculation performed in a MAC mode by a PIM device according to an embodiment of the present disclosure is shown;

[0027] Fig.15 Shows Fig.14 The processing of the multiplication calculation shown in ;

[0028] Fig.16 It is shown in Fig.14 When no error occurs in the multiplication calculation of Figure 8 A block diagram of a multiplication output compensation operation performed in a multiplication result compensator of;

[0029] Fig.17 It is shown in Fig.14 When an error occurs in the multiplication calculation Figure 8 A block diagram of an example of a multiplication output compensation operation performed in a multiplication result compensator of FIG.

[0030] Fig.18 Shows Fig.17 Processing of addition calculation of multiplication result data and shift data in the multiplication output compensation operation shown in ;

[0031] Fig.19 Shown in Fig.17 Processing of calculation of multiplication result data when no error occurs in the multiplication output compensation operation;

[0032] Fig. 20 It is shown in Fig.14 When an error occurs in the multiplication calculation Figure 8 A block diagram of another example of a multiplication output compensation operation performed in a multiplication result compensator of FIG. 1 ;

[0033] Fig.21 Shown in Fig. 20A process of subtraction calculation for subtracting shift data from multiplication result data in the multiplication output compensation operation shown in ;

[0034] Fig. 22 Shown in Fig. 20 Processing of calculation of multiplication result data when no error occurs in the multiplication output compensation operation;

[0035] Fig.23 is a timing diagram showing a MAC operation performed by a PIM device in a MAC mode when an error occurs according to an embodiment of the present disclosure;

[0036] Fig.24 is a timing diagram showing a MAC operation performed by a PIM device in a MAC mode when no error occurs according to an embodiment of the present disclosure;

[0037] Fig.25 is a block diagram showing a configuration of a PIM device according to another embodiment of the present disclosure;

[0038] Fig.26 is a block diagram showing a configuration of an error correction code (ECC) logic circuit included in a PIM device according to another embodiment of the present disclosure;

[0039] Fig. 27 One of the multiplication result compensators included in the PIM device according to another embodiment of the present disclosure is shown;

[0040] Fig.28 FIG. 2 shows a PIM device according to another embodiment of the present disclosure when no error occurs. Fig. 27 The operation of the multiplication result compensator shown in ; and

[0041] Fig.29 is a timing diagram illustrating a MAC operation performed by a PIM device in a MAC mode when no error occurs according to another embodiment of the present disclosure. DETAILED DESCRIPTION

[0042] In the following description of the embodiment, it will be understood that the term "first" and "second" are intended to identify elements, rather than being used to limit the element itself or to mean a specific order. In addition, when an element is referred to as being located "on", "above", "above", "below" or "below" another element, it is intended to mean a relative positional relationship, rather than being used to limit the specific situation of the element directly contacting the other element or having at least one intermediate element between them. Therefore, the terms such as "on", "above", "above", "below", "below" etc. used in this article are only used to describe the purpose of a specific embodiment, rather than being intended to limit the scope of the present disclosure. In addition, when an element is referred to as "connected" or "coupled" to another element, the element can be directly electrically connected or mechanically connected or coupled to other elements, or can form a connection relationship or a coupling relationship by replacing other elements between them. As used in this article, the character " / " means any and all combinations of the items recorded before and after the character " / ".

[0043] Figure 1 is a block diagram showing a PIM system according to the present disclosure. Figure 1 As shown in , the PIM system 1 may include a PIM device 10 and a PIM controller 20. The PIM device 10 may include a data storage area 11, an arithmetic circuit 12, an interface (I / F) 13-1, and a data input / output (I / O) pad 13-2. The data storage area 11 may include a first storage area and a second storage area. In one embodiment, the first storage area and the second storage area may be a storage body, respectively. In another embodiment, the first storage area and the second storage area may be a storage body and a buffer memory, respectively. The data storage area may include a volatile memory element or a non-volatile memory element. The data storage area may include both a volatile memory element and a non-volatile memory element.

[0044] The arithmetic circuit 12 may perform an arithmetic operation on the data transmitted from the data storage area 11. In one embodiment, the arithmetic circuit 12 may include a multiplication and accumulation (MAC) operator. The MAC operator may perform a multiplication calculation on the data transmitted from the data storage area 11 and may perform an accumulation calculation on the multiplication result data. After the MAC operation, the MAC operator may output MAC result data. The MAC result data may be stored in the data storage area 11 or output from the PIM device 10 through the data I / O pad 13-2.

[0045] The interface 13-1 of the PIM device 10 may receive a command CMD and an address ADDR from the PIM controller 20. The interface 13-1 may output the command CMD to the data storage area 11 or the arithmetic circuit 12 in the PIM device 10. The interface 13-1 may output the address ADDR to the data storage area 11 in the PIM device 10. The data I / O pad 13-2 of the PIM device 10 may be used as a data communication terminal between an external device (e.g., the PIM controller 20) of the PIM device 10 and the data storage area 11 included in the PIM device 10. The external device of the PIM device 10 may correspond to the PIM controller 20 of the PIM system 1 or a host located outside the PIM system 1. Therefore, data output from the host or the PIM controller 20 may be input into the PIM device 10 through the data I / O pad 13-2.

[0046] The PIM controller 20 may control the operation of the PIM device 10. In one embodiment, the PIM controller 20 may control the PIM device 10 so that the PIM device 10 operates in a memory mode or a MAC mode. In the case where the PIM controller 20 controls the PIM device 10 so that the PIM device 10 operates in the memory mode, the PIM device 10 may perform a data read operation or a data write operation to the data storage area 11. In the case where the PIM controller 20 controls the PIM device 10 so that the PIM device 10 operates in the MAC mode, the PIM device 10 may perform a MAC operation of the arithmetic circuit 12. In the case where the PIM controller 20 controls the PIM device 10 so that the PIM device 10 operates in the MAC mode, the PIM device 10 may also perform a data read operation or a data write operation to the data storage area 11 to perform a MAC operation.

[0047] The PIM controller 20 may be configured to include a command queue logic 21, a scheduler 22, a command generator 23, and an address generator 25. The command queue logic 21 may receive a request REQ from an external device (e.g., a host of the PIM system 1) and store a command queue corresponding to the request REQ in the command queue logic 21. The command queue logic 21 may transmit information about a storage state of the command queue to the scheduler 22 whenever the command queue logic 21 stores a command queue. The command queues stored in the command queue logic 21 may be transmitted to the command generator 23 according to an order determined by the scheduler 22.

[0048] The scheduler 22 may adjust the order of the command queues stored in the command queue logic 21 when the command queues are output from the command queue logic 21. In order to adjust the output order of the command queues stored in the command queue logic 21. The scheduler 22 may analyze the information on the storage status of the command queues provided by the command queue logic 21 and may re-adjust the processing order of the command queues so that the command queues are processed according to an appropriate order.

[0049] The command generator 23 may receive a command queue related to the memory mode of the PIM device 10 or the MAC mode of the PIM device 10 from the command queue logic 21. The command generator 23 may decode the command queue to generate and output a command CMD. The command CMD may include a memory command for the memory mode or a MAC command for the MAC mode. The command CMD output from the command generator 23 may be transmitted to the PIM device 10.

[0050] The address generator 25 may receive address information from the command queue logic 21 and generate an address ADDR for accessing an area in the data storage area 11. In one embodiment, the address ADDR may include a bank address, a row address, and a column address. The address ADDR output from the address generator 25 may be input to the data storage area 11 through an interface (I / F) 13-1.

[0051] Figure 2 1 shows an example of an arrangement structure of memory banks BK0, ..., and BK15 and MAC operators MAC0, ..., and MAC7 included in the PIM device 10-1 according to the present disclosure. Figure 2, the PIM device 10-1 may include a storage area and a processing device. In one embodiment, the storage area may be storage banks BK0, ..., and BK15. Although the present embodiment shows an example in which the storage area is the storage banks BK0, ..., and BK15, the storage banks BK0, ..., and BK15 are merely examples applicable to the storage area. In some embodiments, the storage banks BK0, ..., and BK15 may be a memory area corresponding to a volatile memory device (e.g., a DRAM device). In one embodiment, each of the storage banks BK0, ..., and BK15 may be a separately activated component unit and may be configured to have the same data bus width as an external input / output line (e.g., a data input / output (I / O) line). In one embodiment, the storage banks BK0, ..., and BK15 may be operated in an alternative manner as follows: an activation operation of any one storage bank is performed in parallel when another storage bank is selected. Although the present embodiment shows an example in which the PIM device 10 includes storage banks BK0, ..., and BK15, the number of storage banks is not limited to "16", but may be different according to the embodiment. Each of the memory banks BK0, ... and BK15 may include a memory cell array, which may include memory unit cells located at intersections of multiple rows and multiple columns, respectively. The memory banks BK0, ... and BK15 may include a first type of memory bank, such as odd-numbered memory banks BK0, BK2, ... and BK14, and a second type of memory bank, such as even-numbered memory banks BK1, BK3, ... and BK15.

[0052] The core circuit may be arranged adjacent to the memory banks BK0, ... and BK15. The core circuit may include an X decoder XDEC and a Y decoder / IO circuit YDEC / IO. The X decoder XDEC may also be referred to as a word line decoder or a row decoder. In one embodiment, two odd-numbered memory banks arranged adjacent to each other in one row among the odd-numbered memory banks BK0, BK2, ... and BK14 may share one X decoder XDEC with each other. For example, the first memory bank BK0 and the third memory bank BK2 adjacent to each other in the first row may share one X decoder XDEC, and the fifth memory bank BK4 and the seventh memory bank BK6 adjacent to each other in the first row may also share one X decoder XDEC. Similarly, two even-numbered memory banks arranged adjacent to each other in one row among the even-numbered memory banks BK1, BK3, ... and BK15 may share one X decoder XDEC with each other. For example, the second memory bank BK1 and the fourth memory bank BK3 adjacent to each other in the second row may share one X-decoder XDEC, and the sixth memory bank BK5 and the eighth memory bank BK7 adjacent to each other in the second row may also share one X-decoder XDEC. Each X-decoder XDEC may receive a row address from an address latch included in the peripheral circuit PERI, and may decode the row address to select and enable one of rows (i.e., word lines) coupled to a memory bank adjacent to the X-decoder XDEC.

[0053] The Y decoder / IO circuit YDEC / IO can be configured to be assigned to the memory banks BK0, ... and BK15, respectively. For example, the first memory bank BK0 can be assigned to one Y decoder / IO circuit YDEC / IO, and the second memory bank BK1 can be assigned to another Y decoder / IO circuit YDEC / IO. Each Y decoder / IO circuit YDEC / IO may include a Y decoder YDEC and an I / O circuit IO. The Y decoder YDEC may also be referred to as a bit line decoder or a column decoder. Each Y decoder YDEC may receive a column address from an address latch included in the peripheral circuit PERI and may decode the column address to select and enable at least one of the columns (i.e., bit lines) coupled to the selected memory bank. Each I / O circuit IO may include an I / O sense amplifier for sensing and amplifying the level of the read data output from the corresponding memory bank during a read operation, and a write driver for driving the write data during a write operation of the corresponding memory bank.

[0054] In one embodiment, the processing device may include MAC operators MAC0, ... and MAC7. Although the present embodiment shows an example in which MAC operators MAC0, ... and MAC7 are used as processing devices, the present embodiment is only an example of the present disclosure. For example, in some other embodiments, a processor different from the MAC operators MAC0, ... and MAC7 may be used as a processing device. The MAC operators MAC0, ... and MAC7 may be configured so that one of the odd-numbered storage bodies BK0, BK2, ... and BK14 and one of the even-numbered storage bodies BK1, BK3, ... and BK15 share any one of the MAC operators MAC0, ... and MAC7 with each other. Specifically, an odd-numbered storage body and an even-numbered storage body arranged adjacent to each other in a column may constitute a pair of storage bodies that share one of the MAC operators MAC0, ... and MAC7 with each other. One of the MAC operators MAC0, ... and MAC7 and a pair of storage bodies that share one MAC operator with each other will be referred to as a "MAC unit" hereinafter.

[0055] In one embodiment, the number of MAC operators MAC0, ... and MAC7 may be equal to the number of odd-numbered memory banks BK0, BK2, ... and BK14 or the number of even-numbered memory banks BK1, BK3, ... and BK15. The first memory bank BK0, the second memory bank BK1, and the first MAC operator MAC0 between the first memory bank BK0 and the second memory bank BK1 may constitute a first MAC unit. Similarly, the third memory bank BK2, the fourth memory bank BK3, and the second MAC operator MAC1 between the third memory bank BK2 and the fourth memory bank BK3 may constitute a second MAC unit. The first MAC operator MAC0 included in the first MAC unit may receive the first data DA1 output from the first memory bank BK0 included in the first MAC unit and the second data DA2 output from the second memory bank BK1 included in the first MAC unit. In addition, the first MAC operator MAC0 may perform a MAC operation of the first data DA1 and the second data DA2. In the case where the PIM device 10-1 performs neural network calculations (e.g., arithmetic operations in deep learning processing), one of the first data DA1 and the second data DA2 may be weight data and the other may be vector data. The configuration of any one of the MAC operators MAC0, ..., and MAC7 will be described in more detail below.

[0056] In the PIM device 10-1, the peripheral circuit PERI can be set in an area other than the area where the storage bodies BK0, BK1, ... and BK15, the MAC operators MAC0, ... and MAC7, and the core circuit are set. The peripheral circuit PERI may include a control circuit and a transmission path for command / address signals, a control circuit and a transmission path for input / output of data, and a power supply circuit. The control circuit for the command / address signal may include a command decoder for decoding the command included in the command / address signal to generate an internal command signal, an address latch for converting the input address into a row address and a column address, a control circuit for controlling various functions of the row / column operation, and a control circuit for controlling a delay locked loop (DLL) circuit. The control circuit for input / output of data in the peripheral circuit PERI may include a control circuit for controlling a read / write operation, a read / write buffer, and an output driver. The power supply circuit in the peripheral circuit PERI may include a reference power voltage generation circuit for generating an internal reference power voltage (power voltage) and an internal power voltage generation circuit for generating an internal power voltage from an external power voltage.

[0057] The PIM device 10-1 according to the present embodiment can operate in either a memory mode or a MAC mode. In the memory mode, the PIM device 10-1 can operate to perform the same operation as a general memory device. The memory mode may include a memory read operation mode and a memory write operation mode. In the memory read operation mode, the PIM device 10-1 can perform a read operation for reading out data from the memory banks BK0, BK1, ..., and BK15 in response to an external request to output the read data. In the memory write operation mode, the PIM device 10-1 can perform a write operation for storing data provided by an external device into the memory banks BK0, BK1, ..., and BK15 in response to an external request.

[0058] In the MAC mode, the PIM device 10-1 may perform a MAC operation using the MAC operators MAC0, ..., and MAC7. Specifically, for the MAC operation in the MAC mode, the PIM device 10-1 may perform a read operation of the first data DA1 of each of the odd-numbered memory banks BK0, BK2, ..., and BK14 and a read operation of the second data DA2 of each of the even-numbered memory banks BK1, BK3, ..., and BK15. In addition, each of the MAC operators MAC0, ..., and MAC7 may perform a MAC operation of the first data DA1 and the second data DA2 read out from the memory bank to store the result of the MAC operation in the memory bank or output the result of the MAC operation. In some cases, the PIM device 10-1 may perform a data write operation for storing data to be used for the MAC operation in the memory bank before performing a data read operation for the MAC operation in the MAC mode.

[0059] The operation mode of the PIM device 10-1 according to the present embodiment may be determined by a command transmitted from a host or a controller to the PIM device 10-1. In one embodiment, if a first external command requesting a read operation or a write operation of the memory banks BK0, BK1, ..., and BK15 is input to the PIM device 10-1, the PIM device 10-1 may perform a data read operation or a data write operation in the memory mode. Meanwhile, if a second external command requesting a MAC operation from an external host or a controller is input to the PIM device 10-1, the PIM device 10-1 may perform a data read operation and a MAC operation.

[0060] Figure 3 FIG. 2 shows another example of the arrangement structure of the memory bank and the MAC operator included in the PIM device 10-2 according to the present disclosure. Figure 3 , the PIM device 10-2 may include a first storage area such as a plurality of memory banks (e.g., first to sixteenth memory banks BK0, ..., and BK15), a processing device such as a plurality of MAC operators (e.g., first to sixteenth MAC operators MAC0, ..., and MAC15), and a second storage area such as a global buffer GB. The core circuit may be disposed adjacent to the memory banks BK0, ..., and BK15. The core circuit may include an X decoder XDEC and a Y decoder / IO circuit YDEC / IO. The memory banks BK0, ..., and BK15 and the core circuit may have the same Figure 2The same configuration described. Therefore, the description of the memory banks BK0, ... and BK15 and the core circuit will be omitted below. Each of the MAC operators MAC0, ... and MAC15 can be set to be respectively allocated to each of the memory banks BK0, ... and BK15. That is, in the PIM device 10-2, two or more memory banks do not share a MAC operator with each other. Therefore, the number of MAC operators MAC0, ... and MAC15 included in the PIM device 10-2 can be equal to the number of memory banks BK0, ... and BK15 included in the PIM device 10-2. One of the memory banks BK0, ... and BK15 and one of the MAC operators MAC0, ... and MAC15 can constitute a MAC unit. For example, the first memory bank BK0 and the first MAC operator MAC0 can constitute a first MAC unit, and the second memory bank BK1 and the second MAC operator MAC1 can constitute a second MAC unit. Similarly, the sixteenth memory bank BK15 and the sixteenth MAC operator MAC15 can constitute a sixteenth MAC unit. In each of the first to sixteenth MAC units, the MAC operator may receive first data DA1 from a memory bank for a MAC operation.

[0061] The peripheral circuit PERI may be disposed in an area other than an area where the memory banks BK0, BK1, ..., and BK15, the MAC operators MAC0, ..., and MAC15, and the core circuit are disposed, and the peripheral circuit PERI may include a control circuit related to command / address signals, a control circuit related to input / output of data, and a power supply circuit. The peripheral circuit PERI of the PIM device 10-2 may have the same Figure 2 The peripheral circuit PERI of the PIM device 10-1 shown in FIG. is substantially the same configuration as that of the peripheral circuit PERI of the PIM device 10-1. The difference between the peripheral circuit PERI of the PIM device 10-2 and the peripheral circuit PERI of the PIM device 10-1 is that a global buffer GB is provided in the peripheral circuit PERI of the PIM device 10-2. The global buffer GB may receive second data DA2 for MAC operation from an external device and may store the second data DA2 therein. The global buffer GB may output the second data DA2 to each of the MAC operators MAC0, ... and MAC15 through a GIO line. In the case where the PIM device 10-2 performs a neural network calculation (e.g., an arithmetic operation in a deep learning process), the first data DA1 may be weight data and the second data DA2 may be vector data.

[0062] The PIM device 10-2 according to the present embodiment can operate in either a memory mode or a MAC mode. In the memory mode, the PIM device 10-2 can operate to perform the same operation as a general memory device. The memory mode may include a memory read operation mode and a memory write operation mode. In the memory read operation mode, the PIM device 10-2 can perform a read operation for reading out data from the memory banks BK0, BK1, ..., and BK15 in response to an external request to output the read data. In the memory write operation mode, the PIM device 10-2 can perform a write operation for storing data provided by an external device into the memory banks BK0, BK1, ..., and BK15 in response to an external request. In the MAC mode, the PIM device 10-2 can perform a MAC operation using the MAC operators MAC0, ..., and MAC15. For the MAC operation in the MAC mode, the PIM device 10-2 can perform a read operation of the first data DA1 of each of the memory banks BK0, ..., and BK15 and a read operation of the second data DA2 of the global buffer GB. In addition, each of the MAC operators MAC0, ..., and MAC15 may perform a MAC operation of the first data DA1 and the second data DA2 to store the result of the MAC operation in the memory bank or output the result of the MAC operation to an external device. In some cases, the PIM device 10-2 may perform a data write operation for storing data to be used for the MAC operation in the memory bank before performing a data read operation for the MAC operation in the MAC mode.

[0063] The operation mode of the PIM device 10-2 according to the present embodiment may be determined by a command transmitted from an external controller to the PIM device 10-2. In one embodiment, if a first external command requesting a read operation or a write operation of the memory banks BK0, BK1, ..., and BK15 is input from a host or a controller to the PIM device 10-2, the PIM device 10-2 may perform a data read operation or a data write operation in the memory mode. Alternatively, if a second external command requesting a MAC operation is input from a host or a controller to the PIM device 10-2, the PIM device 10-2 may perform a read operation, a write operation, and a MAC operation.

[0064] Figure 4 is a block diagram showing the configuration of a PIM device 100 according to an embodiment of the present disclosure. Figure 4, the PIM device 100 may be configured to include a first storage area 200, an error correction code (ECC) logic circuit 300, a multiplication / accumulation (MAC) operator 400, and a second storage area 500. In one embodiment, the PIM device 100 may be applied to a neural network circuit. In this case, vector data required for neural network calculation may be stored in the first storage area 200, and weight data may be temporarily stored in the second storage area 500. In one embodiment, when the first storage area 200 may be a memory area (e.g., a memory bank) of the PIM device 100, the second storage area 500 may be a buffer memory that is distinguished from the memory area (e.g., a memory bank) of the PIM device 100. In other embodiments, the first storage area 200 may be a memory bank of the PIM device 100, and the second storage area 500 may be another memory bank of the PIM device 100. The first storage area 200 may have a data storage area 210 and a parity storage area 220. The data storage area 210 and the parity storage area 220 may be areas that are physically distinguished from each other. Alternatively, the data storage area 210 and the parity storage area 220 may be areas that are only logically distinguished from each other. Data may be stored in the data storage area 210, and parity for correcting data errors may be stored in the parity storage area 220. In one embodiment, the first storage area 200 may be implemented using a volatile memory device such as a DRAM device. In another embodiment, the first storage area 200 may be implemented using a non-volatile memory device. In yet another embodiment, the first storage area 200 may be implemented to include both a volatile memory device and a non-volatile memory device.

[0065] The ECC logic circuit 300 may perform an ECC operation for error correction during access to the first storage area 200. In one embodiment, the ECC operation may include an ECC encoding operation and an ECC decoding operation. The ECC encoding operation may be performed when writing the write data W_DA to the first storage area 200. In one embodiment, the ECC encoding operation may include an operation of generating a parity PA1 of the write data W_DA. The write data W_DA may be stored in the data storage area 210 of the first storage area 200. The parity PA1 generated by the ECC encoding operation may be stored in the parity storage area 220 of the first storage area 200. The ECC decoding operation may be performed when the read data R_DA is output from the first storage area 200. In one embodiment, the ECC decoding operation may include an operation for generating a syndrome using the parity PA2 of the read data R_DA, an operation for finding an error position of the read data R_DA using the syndrome, and an operation for correcting an error located at the error position.

[0066] The ECC logic circuit 300 may output different data in the memory mode and in the MAC mode. The "memory mode" may be defined as a mode in which the PIM device 100 performs an operation for accessing the first storage area 200 regardless of the calculation operation. The "MAC mode" may be defined as a mode in which the PIM device 100 performs an operation for accessing the first storage area 200 and an operation for calculating the accessed data. The operation of the ECC logic circuit 300 for writing the write data W_DA into the first storage area 200 in the memory mode may be the same as the operation of the ECC logic circuit 300 for writing the write data W_DA into the first storage area 200 in the MAC mode. During a read operation for reading out the read data R_DA stored in the first storage area 200 in the memory mode, the ECC logic circuit 300 may output corrected data of the read data R_DA to an external device (not shown). In contrast, during a read operation for reading out the first data DA1 stored in the first storage area 200 in the MAC mode, the ECC logic circuit 300 does not output corrected data generated by correcting the first data DA1 using the parity PA3 provided by the parity storage area 220. Instead, the ECC logic circuit 300 may generate an error code EC indicating an error position using the parity PA3 and may output the error code EC to the MAC operator 400. That is, during a read operation in the MAC mode, corrected data of the first data DA1 is not output from the ECC logic circuit 300.

[0067] The MAC operator 400 may perform MAC calculations in the MAC mode of the PIM device 100. The MAC operator 400 does not perform MAC calculations in the memory mode of the PIM device 100. In one embodiment, the MAC operator 400 may include a multiplication module 410, a multiplication result compensation circuit 420, and an addition module 430. The multiplication module 410 may receive first data DA1 stored in the data storage area 210 of the first storage area 200 and second data DA2 stored in the second storage area 500. The second data DA2 may be provided by an external device (not shown) and may be input to the MAC operator 400 through the second storage area 500 without passing through the ECC logic circuit 300. The multiplication module 410 may perform a multiplication calculation of the first data DA1 and the second data DA2 to output a multiplication result data ( Fig.13 M_DA_1<0:255>).

[0068] The multiplication result compensation circuit 420 may receive the multiplication result data ( Fig.13The multiplication result compensation circuit 420 can output the multiplication result data (M_DA_1<0:255>) generated by the multiplication module 410 and the error code EC output from the ECC logic circuit 300. Fig.13 M_DA_1<0:255>) without any compensation, or the multiplication result data ( Fig.13 After compensating M_DA_1<0:255> of the multiplication result data, the compensated data ( Fig.13 Specifically, if there is no error in the error code EC output from the ECC logic circuit 300, the multiplication result compensation circuit 420 may output the multiplication result data ( Fig.13 On the contrary, if there is an error in the error code EC output from the ECC logic circuit 300, the multiplication result compensation circuit 420 may perform the multiplication result data ( Fig.13 The compensation calculation of M_DA_1<0:255>) is performed to output the compensated multiplication result data ( Fig.13 The addition module 430 may perform the multiplication result data (C_M_DA_1<0:255>) output from the multiplication result compensation circuit 420. Fig.13 M_DA_1<0:255>) or the compensated multiplication result data ( Fig.13 The addition calculation of C_M_DA_1<0:255>) can be performed, and the addition result data can be output as the MAC calculation result data corresponding to the final output data.

[0069] Figure 5 is a block diagram showing the configuration of the ECC logic circuit 300 included in the PIM device 100. Figure 5 , the ECC logic circuit 300 may include a parity / symbol generator 310, a syndrome decoder 320, and an error corrector 330. The parity / symbol generator 310 may generate and output a parity PA1<0:7> of the write data W_DA<0:127> to perform a write operation of the first storage area 200. The implementation will be described in conjunction with the case where the write data W_DA<0:127> includes 128 bits and the parity PA1<0:7> includes 8 bits. However, this implementation is only an example of each implementation. Therefore, the number of bits included in the write data W_DA may be set differently depending on the implementation. Similarly, the number of bits included in the parity PA1 may also be set differently depending on the implementation. As shown in FIG. Figure 3As described, the parity PA1<0:7> may be stored in the parity storage area 220 of the first storage area 200. The parity / syndrome generator 310 may generate and output the syndrome SYN<0:7> and the parity PA2<0:7> of the read data R_DA<0:127> in the memory mode to perform a read operation of the first storage area 200. Similarly, the parity / syndrome generator 310 may generate and output the syndrome SYN<0:7> and the parity PA3<0:7> of the first data DA1<0:127> in the MAC mode to perform a read operation of the first storage area 200. The syndrome SYN<0:7> may be input to the syndrome decoder 320.

[0070] The syndrome decoder 320 may generate and output an error code EC<0:127> indicating an error location based on the syndrome SYN<0:7>. The error code EC<0:127> may be a binary stream having the same number of bits as the read data R_DA<0:127> or the first data DA1<0:127>. In order to generate the error code EC<0:127>, the syndrome decoder 320 may perform a calculation for finding an error location polynomial and a solution of the error location polynomial. In the memory mode, the error code EC<0:127> output from the syndrome decoder 320 may be input to the error corrector 330. In contrast, in the MAC mode, the error code EC<0:127> output from the syndrome decoder 320 may be input to the multiplication result compensation circuit 420 of the MAC operator 400, as shown in FIG. Figure 3 If there is an error in the error code EC<0:127> output from the syndrome decoder 320, the error corrector 330 may correct the read data to output corrected read data R_DA<0:127>.

[0071] Figure 6 FIG. 4 shows a MAC operator 400 included in the PIM device 100. Figure 6 , the MAC operator 400 may include a plurality of multipliers 411 constituting a multiplication module 410, a plurality of multiplication result compensators (C1 to C16) 421 constituting a multiplication result compensation circuit 420, and a plurality of adders 431-1, 431-2, 431-3, and 431-4 constituting an addition module 430. The number of multipliers 411 may be equal to the number of multiplication result compensators 421. The adders 431-1, 431-2, 431-3, and 431-4 may be provided at each of the plurality of stages to form a tree structure.

[0072] When the first data DA1<0:127> has 128 bits and the second data DA2<0:127> also has 128 bits, the number of multipliers 411 can be 16 and the number of multiplication result compensators 421 can also be 16. Each multiplier 411 can receive 8-bit data of the first data DA1<0:127> and 8-bit data of the second data DA2<0:127>. That is, the first data DA1<0:127> can be divided into 16 groups of data in units of 8 bits, and the 16 groups of data of the first data DA1<0:127> can be respectively input to the 16 multipliers. Similarly, the second data DA2<0:127> can be divided into 16 groups of data in units of 8 bits, and the 16 groups of data of the second data DA2<0:127> can be respectively input to the 16 multipliers. Each multiplier 411 can perform a multiplication calculation of 8 bits of the first data DA1<0:127> and 8 bits of the second data DA2<0:127> to generate and output 16-bit multiplication result data. Since the number of multipliers 411 is 16, 256-bit multiplication result data can be generated and output by all multipliers 411.

[0073] Each multiplication result compensator 421 can receive 16-bit multiplication result data output from any one of the multipliers 411. That is, the first multiplication result compensator C1 can receive the first 16-bit multiplication result data output from the first multiplier 411. Similarly, the last multiplication result compensator (i.e., the sixteenth multiplication result compensator C16) can receive the sixteenth 16-bit multiplication result data output from the last (i.e., the sixteenth) multiplier 411. Like any one of the multipliers 411, each multiplication result compensator 421 can also receive 8-bit data of the second data DA2<0:127>. That is, the 8-bit data of the second data DA2<0:127> input to the first multiplier 411 can also be input to the first multiplication result compensator C1. Similarly, the 8-bit data of the second data DA2<0:127> input to the sixteenth multiplier 411 can also be input to the sixteenth multiplication result compensator C16. In addition, the 128-bit error code EC<0:127> output from the syndrome decoder 320 of the ECC logic circuit 300 may be divided into 16 groups of data in units of 8 bits, and the 16 groups of data of the 128-bit error code EC<0:127> may be respectively input to the multiplication result compensators 421 (i.e., the first to sixteenth multiplication result compensators C1-C16). Each multiplication result compensator 421 may output 16-bit multiplication result data without any compensation, or may perform compensation calculation of the 16-bit multiplication result data according to the 8-bit error code EC input thereto to output compensated 16-bit multiplication result data.

[0074] Each of the 8 adders 431-1 arranged at the first stage can receive two groups of 16-bit data output from two multiplication result compensators 421 to perform the addition calculation of the two groups of 16-bit data. Each of the 8 adders 431-1 arranged at the first stage can generate and output 17-bit addition data including 1-bit carry as the result of the addition calculation. Each of the 4 adders 431-2 arranged at the second stage can receive two groups of 17-bit addition data output from two of the 8 adders 431-1 to perform the addition calculation of the two groups of 17-bit addition data. Each of the 4 adders 431-2 arranged at the second stage can generate and output 18-bit addition data including 1-bit carry as the result of the addition calculation. Each of the 2 adders 431-3 arranged at the third stage can receive two groups of 18-bit addition data output from two of the 4 adders 431-2 to perform the addition calculation of the two groups of 18-bit addition data. Each of the two adders 431-3 disposed at the third stage can generate and output 19-bit addition data including 1-bit carry as a result of the addition calculation. Finally, the adder 431-4 disposed at the fourth stage can receive two groups of 19-bit addition data output from the two adders 431-3 to perform the addition calculation of the two groups of 19-bit addition data. The adder 431-4 disposed at the fourth stage can generate and output 20-bit addition data including 1-bit carry as a result of the addition calculation.

[0075] Figure 7 1 shows a multiplication calculation performed by the multiplier 411 included in the PIM device 100. This embodiment will be described in conjunction with a case where the multiplier 411 receives binary data "X7 X6 X5 X4 X3 X2 X1 X0" as first data DA1<0:7> having eight bits and binary data "Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0" as second data DA2<0:7> having eight bits. Figure 7As shown in , the multiplication calculation of the first data DA1<0:7> having eight bits and the second data DA2<0:7> having eight bits may include the shift calculations of the first to eighth steps STEP1~STEP8 and the final addition calculation. When the first bit "X0" corresponding to the least significant bit (LSB) of the first data DA1<0:7> has a value of "1", the data "P70 P60 P50 P40 P30 P20 P10 P00" corresponding to the result data of the first step STEP1 may be the same as the second data DA2<0:7>, and when the first bit "X0" corresponding to the LSB of the first data DA1<0:7> has a value of "0", all bits included in the data "P70 P60 P50 P40 P30 P20 P10P00" corresponding to the result data of the first step STEP1 may have a value of "0". The data “P71 P61 P51 P41 P31 P21 P11 P01” corresponding to the result data of the second step STEP2 may be positioned to be shifted by one bit from the position of the data “P70 P60 P50 P40 P30 P20 P10 P00” in the direction of the most significant bit (MSB) of the data “P70 P60 P50 P40 P30 P20 P10 P00”. In this case, when the second bit “X1” of the first data DA1<0:7> has a value of “1”, the data “P71 P61 P51 P41 P31 P21 P11 P01” may be the same as the second data DA2<0:7>, and when the second bit “X1” of the first data DA1<0:7> has a value of “0”, all bits included in the data “P71 P61 P51 P41 P31 P21 P11 P01” may have a value of “0”.

[0076] Similarly, the data “P72 P62 P52 P42 P32 P22 P12 P02” corresponding to the result data of the third step STEP3 may be positioned to be shifted by two bits from the position of the data “P70 P60 P50 P40 P30 P20 P10 P00” in the direction of the MSB of the data “P70 P60 P50 P40 P30 P20 P10 P00”. In this case, when the third bit “X2” of the first data DA1<0:7> has a value of “1”, the data “P72 P62 P52 P42 P32 P22 P12 P02” may be the same as the second data DA2<0:7>, and when the third bit “X2” of the first data DA1<0:7> has a value of “0”, all bits included in the data “P72 P62 P52 P42 P32 P22 P12 P02” may have a value of “0”. In the same manner, the data “P77 P67 P57 P47 P37 P27 P17 P07” corresponding to the result data of the eighth step STEP8 may be positioned to be shifted by seven bits from the position of the data “P70 P60 P50 P40 P30 P20 P10 P00” in the direction of the MSB of the data “P70 P60 P50 P40 P30 P20 P10 P00”. In this case, when the eighth bit “X7” of the first data DA1<0:7> has a value of “1”, the data “P77 P67 P57 P47 P37 P27 P17 P07” may be the same as the second data DA2<0:7>, and when the eighth bit “X7” of the first data DA1<0:7> has a value of “0”, all bits included in the data “P77 P67 P57 P47 P37 P27 P17 P07” may have a value of “0”. After performing all shift calculations of the first to eighth steps STEP1 ˜ STEP8 , the multiplier 411 may add all result data of the first to eighth steps STEP1 ˜ STEP8 and output 16-bit multiplication result data M_DA_1<0:15> “M15 M14 M13 M12 M11 M10 M9 M8 M7M6 M5 M4 M3 M2 M1 M0”.

[0077] Figure 8 FIG. 4 shows one of the multiplication result compensators 421 included in the PIM device 100. Referring to FIG. Figure 8, the multiplication result compensator 421 may be configured to include a register 421-1, a shift register 421-2, a selector 421-3, and an output logic circuit 421-4. The 16-bit multiplication result data M_DA_1<0:15> output from the multiplier 411 may be stored in the register 421-1. The second data DA2<0:7> may be stored in the shift register 421-2. The second data DA2<0:7> stored in the shift register 421-2 may be shifted a specific number of bits in a direction from the LSB of the second data DA2<0:7> toward the MSB in response to the shift signal S_SHIFT<0:2> output from the selector 421-3, and the shifted data of the second data DA2<0:7> may be output from the shift register 421-2. The selector 421 - 3 may output a shift signal S-SHIFT<0:2> and a selection signal S_SELECT<0:1> to corresponding ones of the shift register 421 - 2 and the output logic circuit 421 - 4 in response to the error code EC<0:7> output from the syndrome decoder 320 of the ECC logic circuit 300 .

[0078] The output logic circuit 421-4 may receive the multiplication result data M_DA_1<0:15> output from the register 421-1 and the shifted second data SHIFT_DA2<0:7> output from the shift register 421-2. The output logic circuit 421-4 may output the multiplication result data M_DA_1<0:15> or the compensated multiplication result data C_M_DA_1<0:15> in response to the selection signal S_SELECT<0:1> output from the selector 421-3. The multiplication result data M_DA_1<0:15> output from the output logic circuit 421-4 may be the same as the multiplication result data M_DA_1<0:15> output from the register 421-1. The compensated multiplication result data C_M_DA_1<0:15> output from the output logic circuit 421-4 may be data generated by compensation calculation of the multiplication result data M_DA_1<0:15> provided without error correction. The following will refer to Fig. 9 The configuration and operation of the output logic circuit 421 - 4 are described.

[0079] Fig. 9 is a block diagram showing the configuration of the output logic circuit 421-4 included in the PIM device 100. Fig. 9, the output logic circuit 421-4 may be configured to include an output logic controller 610, a subtraction logic circuit 620, and a subtraction logic circuit 630. The output logic controller 610 may receive a selection signal S_SELECT<0:1> from the selector 421-3. In addition, the output logic controller 610 may receive the multiplication result data M_DA_1<0:15> output from the register 421-1 and the shifted second data SHIFT_DA2<0:7> output from the shift register 421-2. The output logic controller 610 may operate in one of the first to third output operation modes in response to the selection signal S_SELECT<0:1>.

[0080] When the selection signal S_SELECT<0:1> corresponding to the case where there is no error according to the error code EC<0:7> is generated, the first output operation mode may be activated. In the first output operation mode, the output logic controller 610 may output the multiplication result data M_DA_1<0:15> directly to the addition module 430 without any compensation of the multiplication result data M_DA_1<0:15>. When the selection signal S_SELECT<0:1> corresponding to the case where there is an error according to the error code EC<0:7> is generated, the second output operation mode and the third output operation mode may be activated. Specifically, when the error bit of the first data DA1<0:7> has a value of "0", the output logic controller 610 may operate in the second output operation mode. In the second output operation mode, the output logic controller 610 may output the multiplication result data M_DA_1<0:15> and the shifted second data SHIFT_DA2<0:7> to the addition logic circuit 620. In contrast, when the error bit of the first data DA1<0:7> has a value of “1”, the output logic controller 610 may operate in the third output operation mode. In the third output operation mode, the output logic controller 610 may output the multiplication result data M_DA_1<0:15> and the shifted second data SHIFT_DA2<0:7> to the subtraction logic circuit 630 .

[0081] The addition logic circuit 420 may perform an addition calculation of the multiplication result data M_DA_1<0:15> and the shifted second data SHIFT_DA2<0:7> provided in the second output operation mode, and may output the result data of the addition calculation as the compensated multiplication result data C_M_DA_1<0:15>. The subtraction logic circuit 630 may perform a subtraction calculation of subtracting the shifted second data SHIFT_DA2<0:7> from the multiplication result data M_DA_1<0:15> in the third output operation mode, and may output the result data of the subtraction calculation as the compensated multiplication result data C_M_DA_1<0:15>.

[0082] As described above, according to the PIM device 100, the execution of the multiplication calculation of the MAC calculation in the MAC mode can be independent of the error correction operation of the ECC logic circuit. In addition, the PIM device 100 can perform the compensation calculation of the multiplication result data to output the compensated multiplication result data only when an error is detected during the error correction operation performed by the ECC logic circuit. Therefore, the time consumed by the multiplication calculation of the MAC calculation to be performed in most cases where no error is detected can be reduced. Moreover, even if an error is detected, the compensation calculation can be performed only in a state where the error position is found before the error correction operation is completely terminated. In this case, the multiplication calculation that takes a relatively long time has ended, and only the compensation calculation that takes a relatively short time can be additionally performed. Therefore, the time consumed by the multiplication calculation of the MAC calculation to be performed can be reduced.

[0083] Fig.10 is a block diagram showing a write operation performed in the memory mode of the PIM device 100. Fig.10 In, with Figure 4 The same reference numerals used in the drawings denote the same elements. Fig.10 , the PIM device 100 can receive 128-bit write data W_DA<0:127> from an external device (not shown) in the memory mode to perform a write operation. The write data W_DA<0:127> can be stored in the data storage area 210 of the first storage area 200 and can also be input to the ECC logic circuit 300. Figure 5 As described above, the parity / syndrome generator 310 of the ECC logic circuit 300 may generate 8-bit parity PA1<0:7>. The 8-bit parity PA1<0:7> may be stored in the parity storage area 220 of the first storage area 200.

[0084] Fig.11 is a block diagram illustrating a read operation performed in the memory mode of the PIM device 100. Fig.11 In, with Figure 4 The same reference numerals used in the drawings denote the same elements. Fig.11 , when a read operation is requested in the memory mode (i.e., a read command is generated by an external device such as a host or an external controller), the 128-bit read data R_DA<0:127> stored in the data storage area 210 of the first storage area 200 and the 8-bit parity PA2<0:7> stored in the parity storage area 220 of the first storage area 200 may be input to the ECC logic circuit 300. As shown in FIG. Figure 5As described, the parity / symbol generator 310 of the ECC logic circuit 300 can generate an 8-bit syndrome SYN<0:7>. The syndrome decoder 320 of the ECC logic circuit 300 can use the syndrome SYN<0:7> to find the error location polynomial and the solution of the error location polynomial to generate a 128-bit error code EC<0:127> indicating the error location. The error corrector 330 of the ECC logic circuit 300 can correct the error of the read data R_DA<0:127> to output the corrected read data R_DA<0:127>. The corrected read data R_DA<0:127> output from the ECC logic circuit 300 can be transmitted to an external device, such as a host or an external controller.

[0085] Fig.12 is a flowchart showing a MAC operation performed by the PIM device 100 in the MAC mode, and Fig.13 is a block diagram showing a MAC operation performed by the PIM device 100 in the MAC mode. Fig.13 In, with Figure 4 The same reference numerals used in the drawings denote the same elements. Fig.12 and Fig.13 , the first data DA1<0:127> and the parity PA3<0:7> having 128 bits may be output from the first storage area 200 at step 710. In addition, the first data DA1<0:127> may be input to the ECC logic circuit 300 and the MAC operator 400, and the parity PA3<0:7> may be input to the ECC logic circuit 300. Moreover, the second data DA2<0:127> may be input to the MAC operator 400. The first data DA1<0:127> and the second data DA2<0:127> may be input to the multiplication module 410 of the MAC operator 400. The second data DA2<0:127> may also be input to the multiplication result compensation circuit 420 of the MAC operator 400.

[0086] At step 720, the ECC calculation of the first data DA1<0:127> and the multiplication calculation of the first data DA1<0:127> and the second data DA2<0:127> may be performed simultaneously. The terms "simultaneously" and "simultaneously" used herein for the calculations mean that the calculations are performed in overlapping time intervals. For example, if the first calculation is performed in a first time interval and the second calculation is performed simultaneously in a second time interval, the first time interval and the second time interval overlap each other at least partially, so that there is a time when both the first calculation and the second calculation are being performed. Specifically, the ECC logic circuit 300 may generate a syndrome using the first data DA1<0:127> and the parity PA3<0:7>. The ECC logic circuit 300 may perform an ECC decoding operation using the syndrome to generate and output a 128-bit error code EC<0:127> indicating an error position. The error code EC<0:127> may be input to the multiplication result compensation circuit 420 of the MAC operator 400. The multiplication module 410 of the MAC operator 400 may perform a multiplication calculation of the first data DA1<0:127> and the second data DA2<0:127> to generate and output 256-bit multiplication result data M_DA_1<0:255>. The multiplication result data M_DA_1<0:255> may be input to the multiplication result compensation circuit 420 of the MAC operator 400.

[0087] At step 730, it may be discriminated whether there is an error as a result of the ECC calculation. Specifically, the multiplication result compensation circuit 420 of the MAC operator 400 may analyze the bit value of the error code EC<0:127> output from the ECC logic circuit 300 to discriminate whether there is an error in the first data DA1<0:127> and find the error position if there is an error in the first data DA1<0:127>. When there is no error in the first data DA1<0:127> at step 730, the multiplication result compensation circuit 420 of the MAC operator 400 may output the multiplication result data M_DA_1<0:255> corresponding to the result of the multiplication calculation of the first data DA1<0:127> and the second data DA2<0:127> at step 740. When there is an error in the first data DA1<0:127> at step 730, the multiplication result compensation circuit 420 of the MAC operator 400 may compensate the multiplication result data M_DA_1<0:255> of the first data DA1<0:127> and the second data DA2<0:127> to output the compensated multiplication result data C_M_DA_1<0:255> at step 750. The multiplication result data M_DA_1<0:255> or the compensated multiplication result data C_M_DA_1<0:255> output from the multiplication result compensation circuit 420 may be input to the addition module 430. The addition module 430 may perform an addition calculation of the multiplication result data M_DA_1<0:255> or the compensated multiplication result data C_M_DA_1<0:255> to output the 20-bit output data A_DA<0:19> as the MAC calculation result data.

[0088] Fig.14 FIG. 1 shows an example of a multiplication calculation performed in the MAC mode of the PIM device 100. Referring to FIG. Fig.14, it can be assumed that the first data DA1 "01100101" output from the first storage area 200 is input to one input terminal of the multiplier 411, and the second data DA2 "01010001" output from the second storage area 500 is input to the other terminal of the multiplier 411. The first data DA1 "01100101" may be data whose parity is generated by the ECC logic circuit 300 when the first data DA1 is written to the first storage area 200 by a previous write operation. On the contrary, the second data DA2 "01010001" may be data that is input to the multiplier 411 of the multiplication module 410 only through the second storage area 500 from an external device. Therefore, the ECC calculation in the MAC mode can be performed only on the first data DA1 "01100101". The multiplier 411 may perform a multiplication calculation of the first data DA1 “01100101” and the second data DA2 “01010001” to output data “0001111111110101” as the multiplication result data M_DA_1 .

[0089] Fig.15 Shows Fig.14 The multiplication calculation process shown in . Fig.15 The multiplication calculation of this embodiment can be performed according to the reference Figure 7The multiplication calculation described above is performed in the same manner. Specifically, since the first bit position corresponding to the LSB of the first data DA1 has a value of "1", the data "01010001" can be provided as the result data of the first step STEP1. Since the second bit position of the first data DA1 has a value of "0", the data "00000000" can be provided as the result data of the second step STEP2 and the data "00000000" can be shifted by 1 bit from the position of the result data "01010001" of the first step STEP1 in the direction of the MSB of the data "01010001". Since the third bit position of the first data DA1 has a value of "1", the data "01010001" can be provided as the result data of the third step STEP3 and the data "01010001" can be shifted by 2 bits from the position of the result data "01010001" of the first step STEP1 in the direction of the MSB of the data "01010001". Since both the fourth bit and the fifth bit of the first data DA1 have a value of “0”, the data “00000000” may be provided as the result data of the fourth step STEP4 and the fifth step STEP5 and the result data “00000000” of the fourth step STEP4 and the fifth step STEP5 may be shifted by 3 bits and 4 bits, respectively, from the position of the result data “01010001” of the first step STEP1 in the direction of the MSB of the data “01010001”. Since both the sixth bit and the seventh bit of the first data DA1 have a value of “1”, the data “01010001” may be provided as the result data of the sixth step STEP6 and the seventh step STEP7 and the result data “01010001” of the sixth step STEP6 and the seventh step STEP7 may be shifted by 5 bits and 6 bits, respectively, from the position of the result data “01010001” of the first step STEP1 in the direction of the MSB of the data “01010001”. Finally, since the eighth bit position of the first data DA1 has a value of "0", the data "00000000" may be provided as the result data of the eighth step STEP8 and the result data "00000000" of the eighth step STEP8 may be shifted by 7 bits from the position of the result data "01010001" of the first step STEP1 in the direction of the MSB of the data "01010001". Next, all the result data of the first to eighth steps STEP1 to STEP8 may be summed to generate the multiplication result data M_DA_1 "0001111111110101".

[0090] Fig.16 It is shown in Fig.14 When no error occurs in the multiplication calculation of Figure 8A block diagram of the multiplication output compensation operation performed in the multiplication result compensator 421 of FIG. Fig.16 In, with Figure 8 The same reference numerals used in the drawings denote the same elements. Fig.16 , the multiplication result data M_DA_1 "0001111111110101" output from the multiplier 411 may be stored in the register 421-1. The multiplication result data M_DA_1 "0001111111110101" stored in the register 421-1 may be input to the output logic circuit 421-4. The second data DA2 "01010001" may be stored in the shift register 421-2. Since the present embodiment corresponds to a situation where there is no error in the first data, the error code EC "00000000" may be input to the selector 421-3. The selector 421-3 may output the selection signal S_SELECT "00" to the output logic circuit 421-4 to drive the output logic circuit 421-4 in the first output operation mode. The output logic circuit 421 - 4 may transfer the multiplication result data M_DA_1 “0001111111110101” output from the register 421 - 1 to the adding module 430 .

[0091] Fig.17 It shows that when Fig.14 When an error occurs in the multiplication calculation of Figure 8 A block diagram of an example of a multiplication output compensation operation performed in the multiplication result compensator 421 of FIG. 1 , and Fig.18 Shows Fig.17 The multiplication output compensation operation shown in FIG. 1 is a process of adding the multiplication result data M_DA_1 and the shifted second data SHIFT_DA2. Fig.17 In, with Figure 8 The same reference numerals used in the drawings represent the same elements. Fig.17 , the multiplication result data M_DA_1 "0001111111110101" output from the multiplier 411 can be stored in the register 421-1. The multiplication result data M_DA_1 "0001111111110101" stored in the register 421-1 can be input to the output logic circuit 421-4. The second data DA2 "01010001" can be stored in the shift register 421-2. It can be assumed that this embodiment corresponds to the case where the first data is erroneous data and the error code EC is "00001000" (indicating that the fourth bit of the first data is an erroneous bit). Since the fourth bit of the first data (i.e., the erroneous bit) has a value of "0", as shown in reference Fig. 9 As described, the output logic circuit 421 - 4 may operate in the second output operation mode.

[0092] The error code EC "00001000" may be input to the selector 421-3. The selector 421-3 may output a shift signal S_SHIFT "011" to the shift register 421-2, so that the shift register 421-2 shifts the second data DA2 "01010001" stored in the shift register 421-2 by 3 bits in the direction from the LSB of the second data DA2 to the MSB of the second data DA2. In addition, the selector 421-3 may output a selection signal S_SELECT "01" to the output logic circuit 421-4 to drive the output logic circuit 421-4 in the second output operation mode. In the second output operation mode, the shift register 421-2 can shift the second data DA2 by 3 bits in the direction from the LSB of the second data DA2 to the MSB of the second data DA2 in response to the shift signal S_SHIFT "011", and can output the shifted second data SHIFT_DA2 "01010001000" to the output logic circuit 421-4. The output logic circuit 421-4 can operate in the second output operation mode in response to the selection signal S_SELECT "01". Therefore, as Fig.18 As shown in , the output logic circuit 421 - 4 may perform an addition calculation of the multiplication result data M_DA_1 “0001111111110101” and the shifted second data SHIFT_DA2 “01010001000” to generate and output compensated multiplication result data C_M_DA_1 “0010001001111101”.

[0093] Fig.19 Shown in Fig.17 The processing of multiplication result data calculation when no error occurs in the multiplication output compensation operation. Fig.19 , since the error code EC is "00001000", the fourth bit of the first data DA1 may correspond to an error bit. Therefore, the first data DA1 before the error occurs may be "01101101". If ECC calculation is performed, the fourth error bit of the first data DA1 may be corrected so that the first data DA1 changes from the error data "01100101" to the corrected data "01101101". Therefore, if MAC calculation is performed after the ECC calculation is performed, the corrected first data DA1 "01101101" and the second data DA2 "01010001" may be used in the MAC calculation. The multiplication calculation of the corrected first data DA1 "01101101" and the second data DA2 "01010001" may be performed by comparing with the reference Figure 7The multiplication result data M_DA_1 "00010001001111101" is generated in the same manner as described above. The multiplication result data M_DA_1 "00010001001111101" can be compared with the reference Fig.17 and 18 That is, even if there is an error in the first data DA1 as in the present embodiment, the same data as the multiplication result data after error correction can be obtained by performing compensation calculation after multiplication calculation regardless of ECC calculation.

[0094] Fig. 20 It shows that when Fig.14 When an error occurs in the multiplication calculation of Figure 8 A block diagram of another example of a multiplication output compensation operation performed in the multiplication result compensator 421 of FIG. 1 , and Fig.21 Shown in Fig. 20 The processing of the subtraction calculation for subtracting the shifted second data SHIFT_DA2 from the multiplication result data M_DA_1 in the multiplication output compensation operation shown in FIG. Fig. 20 In, with Figure 8 The same reference numerals used in the drawings represent the same elements. Fig. 20 , the multiplication result data M_DA_1 "0001111111110101" output from the multiplier 411 can be stored in the register 421-1. The multiplication result data M_DA_1 "0001111111110101" stored in the register 421-1 can be input to the output logic circuit 421-4. The second data DA2 "01010001" can be stored in the shift register 421-2. It can be assumed that this embodiment corresponds to the case where the first data is erroneous data and the error code EC is "00000100" (indicating that the third bit of the first data is an erroneous bit). Since the third bit of the first data (i.e., the erroneous bit) has a value of "1", as shown in reference Fig. 9 As described, the output logic circuit 421 - 4 can operate in the third output operation mode.

[0095] The error code EC "00000100" may be input to the selector 421-3. The selector 421-3 may output a shift signal S_SHIFT "010" to the shift register 421-2, so that the shift register 421-2 shifts the second data DA2 "01010001" stored in the shift register 421-2 by 2 bits in the direction from the LSB of the second data DA2 to the MSB of the second data DA2. In addition, the selector 421-3 may output a selection signal S_SELECT "10" to the output logic circuit 421-4 to drive the output logic circuit 421-4 in the third output operation mode. In the third output operation mode, the shift register 421-2 can shift the second data DA2 by 2 bits in the direction from the LSB of the second data DA2 to the MSB of the second data DA2 in response to the shift signal S_SHIFT "010", and can output the shifted second data SHIFT_DA2 "0101000100" to the output logic circuit 421-4. The output logic circuit 421-4 can operate in the third output operation mode in response to the selection signal S_SELECT "10". Therefore, as Fig.21 As shown in , the output logic circuit 421 - 4 may perform a subtraction calculation of subtracting the shifted second data SHIFT_DA2 “01010001000” from the multiplication result data M_DA_1 “0001111111110101” to generate and output compensated multiplication result data C_M_DA_1 “0001111010110001”.

[0096] Fig. 22 Shown in Fig. 20 The processing of multiplication result data calculation when no error occurs in the multiplication output compensation operation. Fig. 22 , since the error code EC is "00000100", the third bit of the first data DA1 may correspond to an error bit. Therefore, the first data DA1 before the error occurs may be "01100001". If ECC calculation is performed, the third error bit of the first data DA1 may be corrected so that the first data DA1 changes from the error data "01100101" to the corrected data "01100001". Therefore, if MAC calculation is performed after the ECC calculation is performed, the corrected first data DA1 "01100001" and the second data DA2 "01010001" may be used in the MAC calculation. The multiplication calculation of the corrected first data DA1 "01100001" and the second data DA2 "01010001" may be performed by comparing with the reference Figure 7The multiplication result data M_DA_1 "0001111010110001" is generated in the same manner as described above. The multiplication result data M_DA_1 "0001111010110001" can be compared with the reference Fig. 20 and 21 The compensated multiplication result data C_M_DA_1 “0001111010110001” described is the same.

[0097] Fig.23 1 is a timing diagram showing a MAC operation performed by the PIM device 100 in the MAC mode when an error occurs. Fig.23 , the top timing diagram shows a case where ECC calculation and MAC calculation are performed sequentially, and the middle timing diagram and the bottom timing diagram show a case where ECC calculation and MAC calculation are performed independently in parallel, respectively. Fig.23 , the ECC logic circuit ( Figure 4 300) performed. Specifically, syndrome calculation can be performed from the first time point "T1" to the third time point "T3", syndrome decoding can be performed from the third time point "T3" to the fourth time point "T4", and error correction can be performed from the fourth time point "T4" to the fifth time point "T5". Multiplication calculation of MAC calculation can be performed from the fifth time point "T5" at which the ECC calculation is terminated to the ninth time point "T9". In addition, addition calculation of MAC calculation can be performed from the ninth time point "T9" to the tenth time point "T10". That is, in the case where the ECC calculation and the MAC calculation are performed sequentially, the MAC calculation can be terminated at the tenth time point "T10".

[0098] On the contrary, in the case where the ECC calculation and the MAC calculation are independently performed in parallel, the ECC calculation can be performed during the same period as the ECC calculation shown in the top timing diagram (from the first time point "T1" to the fifth time point "T5"). However, the multiplication calculation of the MAC calculation can start from the first time point "T1". That is, the multiplication calculation can be performed during the period from the first time point "T1" to the second time point "T2". Generally, the time consumed by the syndrome calculation of the ECC calculation to be performed will be longer than the time consumed by the multiplication calculation of the MAC calculation to be performed. Therefore, the second time point "T2" at which the multiplication calculation of the MAC calculation is terminated can be ahead of the third time point "T3" at which the syndrome calculation of the ECC calculation is terminated. The multiplication result compensation calculation can be performed during the period from the fourth time point "T4" at which the syndrome decoding calculation is terminated to the sixth time point "T6". As referred to Figure 8 and Fig. 9As described, since the multiplication result compensation calculation is implemented by the shift operation of the shift register and the addition operation (or subtraction operation), the multiplication result compensation calculation can be performed during a relatively short period of time. The addition calculation of the MAC calculation can be performed during the period from the sixth time point "T1" to the eighth time point "T8" when the multiplication result compensation calculation is terminated. As a result, when the ECC calculation and the MAC calculation are independently performed in parallel as in the present embodiment, the calculation time can be reduced by the period between the eighth time point "T8" and the tenth time point "T10" compared to the case where the ECC calculation and the MAC calculation are performed sequentially.

[0099] Fig.24 1 is a timing diagram showing a MAC operation performed by the PIM device 100 in the MAC mode when no error occurs. Fig.24 , the top timing diagram shows a case where ECC calculation and MAC calculation are performed sequentially, and the middle timing diagram and the bottom timing diagram show a case where ECC calculation and MAC calculation are performed independently in parallel, respectively. Fig.24 , the case of performing ECC calculation and MAC calculation in sequence can be compared with reference Fig.23 Therefore, in this case, the MAC calculation can be terminated at the tenth time point "T10". The ECC calculation and MAC calculation of the case where the ECC calculation and the MAC calculation are independently performed in parallel can also be the same as the reference Fig.23 The same as described. However, when the result of the syndrome decoding calculation as the ECC calculation does not have an error, since the multiplication result compensation calculation is not required for the MAC calculation, the addition calculation of the MAC calculation can be performed during the period from the fourth time point "T4" to the seventh time point "T7". Therefore, if the ECC calculation and the MAC calculation are independently performed in parallel and the result of the syndrome decoding calculation as the ECC calculation does not have an error, the calculation time can be reduced by the period between the seventh time point "T7" and the tenth time point "T10" compared to the case where the ECC calculation and the MAC calculation are performed sequentially.

[0100] Fig.25 is a block diagram showing the configuration of a PIM device 100 ′ according to another embodiment of the present disclosure. Fig.25 In, with Figure 4 The same reference numerals used in the drawings denote the same elements. Figure 4 The description of the same elements as those described above will be omitted or mentioned briefly to avoid repeated description. Fig.25 , the PIM device 100' may include Figure 4The ECC logic circuit 800 corresponds to the ECC logic circuit 300 shown in . The ECC logic circuit 800 can sequentially output an error signal EE and an error code EC in the MAC mode. The error signal EE can be information including only whether there is an error as a result of the ECC calculation. For example, an error signal EE having a value of "0" can indicate that no error occurred as a result of the ECC calculation, and an error signal EE having a value of "1" can indicate that an error occurred as a result of the ECC calculation. The ECC logic circuit 800 can output the error signal EE and can output the error code EC only when there is an error in the first data DA1 after outputting the error signal EE. As shown in FIG. Figure 4 As described, the error code EC may include information about the error location.

[0101] The PIM device 100 ′ may include Figure 4 The MAC operator 900 corresponds to the MAC operator 400 shown in FIG. 1 , and the MAC operator 900 may include Figure 4 800. In addition to the error code EC, the multiplication result compensation circuit 920 may also receive an error signal EE from the ECC logic circuit 800. When the error signal EE having a value of "0" is input to the multiplication result compensation circuit 920, the multiplication result compensation circuit 920 may transmit the multiplication result data output from the multiplication module 410 to the addition module 430 without performing any compensation calculation. On the contrary, when the error signal EE having a value of "1" is input from the ECC logic circuit 800 to the multiplication result compensation circuit 920, the multiplication result compensation circuit 920 may perform compensation calculation of the multiplication result data according to the error code EC input to the multiplication result compensation circuit 920 and may output the compensated multiplication result data to the addition module 430.

[0102] Fig.26 1 is a block diagram of a configuration of an ECC logic circuit 800 included in a PIM device 100'. The ECC logic circuit 800 includes a parity / syndrome generator 810, a syndrome decoder 820, and an error corrector 830. The ECC logic circuit 800 including the parity / syndrome generator 810, the syndrome decoder 820, and the error corrector 830 can perform operations with reference to the read operation and the write operation performed in the memory mode and the write operation performed in the MAC mode. Figure 4 and 5The same operation of the ECC logic circuit 300 described in the description is described below. Therefore, only the read operation of the ECC logic circuit 800 performed in the MAC mode will be described below. During the read operation in the MAC mode, the parity / symptom generator 810 can receive the first data DA1<0:127> and the parity PA3<0:7> from the first storage area 200 to generate the syndrome SYN<0:7>. Generally, when the parity / symptom generator 810 generates the syndrome SYN<0:7>, it can be distinguished whether the first data DA1<0:127> is error data. That is, if the syndrome SYN<0:7> is generated, information about whether there is an error in the first data DA1<0:127> can be obtained, even if the error location is not found.

[0103] When there is no error in the first data DA1<0:127> as a result of the syndrome calculation, the parity / syndrome generator 810 may output an error signal EE having a value of “0”. In one embodiment, if the error signal EE has a value of “0”, the syndrome SYN<0:7> generated by the parity / syndrome generator 810 is not input to the syndrome decoder 820. In another embodiment, even if the syndrome SYN<0:7> is input to the syndrome decoder 820, the syndrome decoder 820 does not perform a decoding calculation and the syndrome decoder 820 does not generate an error code EC<0:127>. When there is an error in the first data DA1<0:127> as a result of the syndrome calculation, the parity / syndrome generator 810 may output an error signal EE having a value of “1” and may output the syndrome SYN<0:7> to the syndrome decoder 820. The syndrome decoder 820 may generate and output an error code EC<0:127> indicating an error position based on the syndrome SYN<0:7>. As shown in FIG. Fig.25 As described, the error code EC<0:127> output from the syndrome decoder 820 may be input to the multiplication result compensation circuit 920 of the MAC operator 900. The error corrector 830 may perform an error correction operation only in the memory mode and may not perform any error correction operation in the MAC mode.

[0104] Fig. 27 1 shows one of the multiplication result compensators 921 constituting the multiplication result compensation circuit 920 included in the PIM device 100'. In this embodiment, the multiplication result compensator 921 may correspond to the reference circuit constituting the reference circuit 920. Figure 6 One of the plurality of multiplication result compensators 421 of the multiplication result compensation circuit 420 described above. Fig. 27, the multiplication result compensator 921 may be configured to include a register 921-1, a shift register 921-2, a selector 921-3, and an output logic circuit 921-4. The multiplication result data M_DA_1<0:15> output from the multiplier 411 of the multiplication module 410 may be stored in the register 921-1. The second data DA2<0:7> may be stored in the shift register 921-2. The second data DA2<0:7> stored in the shift register 921-2 may be shifted by a specific number of bits in a direction from the LSB of the second data DA2<0:7> toward the MSB in response to the shift signal S_SHIFT<0:2> output from the selector 921-3, and the shifted data of the second data DA2<0:7> may be output from the shift register 921-2. The number of bits by which the second data DA2<0:7> is shifted may be determined according to the shift signal S_SHIFT<0:2>.

[0105] The selector 921-3 may output a selection signal S_SELECT<0:1> to the output logic circuit 921-4 in response to an error signal EE output from the parity / symbol generator 810 of the ECC logic circuit 800. In addition, the selector 921-3 may output a shift signal S_SHIFT<0:2> and a selection signal S_SELECT<0:1> to the corresponding ones of the shift register 921-2 and the output logic circuit 921-4 in response to the error code EC<0:7> output from the syndrome decoder 820 of the ECC logic circuit 800. In one embodiment, the selection signal S_SELECT<0:1> may be a 2-bit binary stream. For example, when there is no error in the first data DA1 (i.e., the error signal EE having a value of "0" is input to the selector 921-3), the selector 921-3 may output a selection signal S_SELECT<0:1> "00". When there is an error in the first data DA1 and an addition calculation is required as compensation calculation, the selector 921-3 may output a selection signal S_SELECT<0:1> “01”. When there is an error in the first data DA1 and a subtraction calculation is required as compensation calculation, the selector 921-3 may output a selection signal S_SELECT<0:1> “10”.

[0106] The output logic circuit 921-4 may receive the multiplication result data M_DA_1<0:15> from the register 921-1. In addition, the output logic circuit 921-4 may receive the shifted second data SHIFT_DA2<0:7> from the shift register 921-2. When the error signal EE having a value of "0" is input to the selector 921-3 (i.e., no compensation calculation is required because no error occurs), the output logic circuit 921-4 does not receive the shifted second data SHIFT_DA2<0:7>. In this case, the output logic circuit 921-4 may output the multiplication result data M_DA_1<0:15> in response to the selection signal S_SELECT<0:1> "00" without performing any compensation calculation of the multiplication result data M_DA_1<0:15>. On the contrary, when the error signal EE has a value of “1” and the error code EC<0:7> is input to the selector 921-3, the selector 921-3 can output the selection signal S_SELECT<0:1> “01” or “10”, and the output logic circuit 921-4 can perform an addition calculation of the multiplication result data M_DA_1<0:15> and the shifted second data SHIFT_DA2<0:7> or a subtraction calculation for subtracting the shifted second data SHIFT_DA2<0:7> from the multiplication result data M_DA_1<0:15> in response to the selection signal S_SELECT<0:1> “01” or “10” to generate and output the compensated multiplication result data C_M_DA_1<0:15>.

[0107] Fig.28 The following diagram shows the state of the PIM device 100 when no error occurs. Fig. 27 The operation of the multiplication result compensator 921 is shown in FIG. Fig.28 In, with Fig. 27 In the present embodiment, it can be assumed that the first data DA1 is "01100101", the second data DA2 is "01010001", and the multiplication result data M_DA_1 output from the multiplier 411 of the multiplication module 410 is "0001111111110101" (see Fig.14 ). Reference Fig.28, the multiplication result data M_DA_1 "0001111111110101" output from the multiplier 411 can be stored in the register 921-1. The multiplication result data M_DA_1 "0001111111110101" stored in the register 921-1 can be input to the output logic circuit 921-4. The second data DA2 "01010001" can be stored in the shift register 921-2. Since the present embodiment corresponds to a situation where there is no error in the first data DA1, the error signal EE "0" can be input to the selector 921-3. The selector 921-3 can output the selection signal S_SELECT "00" to the output logic circuit 921-4 to drive the output logic circuit 921-4 in the first output operation mode. The output logic circuit 921 - 4 may transfer the multiplication result data M_DA_1 “0001111111110101” output from the register 921 - 1 to the adding module 430 .

[0108] Fig.29 is a timing diagram showing a MAC operation performed when no error occurs in the MAC mode of the PIM device 100 ′. Fig.29 , the top timing diagram shows a case where ECC calculation and MAC calculation are performed sequentially, and the middle timing diagram and the bottom timing diagram show a case where ECC calculation and MAC calculation are performed independently in parallel, respectively. Fig.29 , the case of performing ECC calculation and MAC calculation in sequence can be compared with reference Fig.23 Therefore, in this case, the MAC calculation can be terminated at the tenth time point "T10". The ECC calculation and MAC calculation of the case where the ECC calculation and the MAC calculation are independently performed in parallel can also be the same as the reference Fig.23 Same as described. However, when no error occurs as a result of the syndrome decoding calculation of the ECC calculation (i.e., an error signal EE "0" is generated), it is not necessary to perform the multiplication result compensation calculation. Therefore, in this case, if the time consumed by the addition calculation of the MAC calculation to be performed is equal to the time consumed by the syndrome decoding calculation of the ECC calculation to be performed, the addition calculation of the MAC calculation can be performed during the period from the third time point "T3" to the fourth time point "T4". Therefore, if the ECC calculation and the MAC calculation are independently performed in parallel and no error occurs as a result of the syndrome decoding calculation of the ECC calculation, the calculation time can be reduced by the period between the fourth time point "T4" and the tenth time point "T10" compared to the case where the ECC calculation and the MAC calculation are performed sequentially.

[0109] According to the above-described embodiments, the ECC calculation and the MAC calculation of the data output from the first storage area of ​​the PIM device can be independently performed in parallel, and then the multiplication result data can be compensated only when there is an error in the data output from the first storage area. Therefore, the calculation speed of the MAC operation performed in the PIM device can be improved.

[0110] Embodiments of the disclosed technology have been disclosed above for illustrative purposes. Those of ordinary skill in the art will recognize that various modifications, additions and substitutions may be made. Although this patent document contains many details, these details should not be interpreted as limitations on the scope of the claims, but should be interpreted as descriptions of specific features for specific embodiments. Specific features described in this patent document in the context of discrete embodiments may also be implemented in combination in a single embodiment. On the contrary, the individual features described in the context of a single embodiment may also be implemented in multiple embodiments separately or in any appropriate sub-combination. Moreover, although the features are described above as acting in a specific combination and even initially described in the claims, one or more features from the claimed combination may be separated from the combined practice in some cases, and the claimed combination may involve a sub-combination or a variation of the sub-combination.

Claims

1. A PIM device, where PIM refers to in-memory processing, and the PIM device comprises: A first storage area configured to store first data; as well as A MAC operator is configured to perform a MAC calculation on the first data and the second data in a MAC mode to generate multiplication result data, where MAC refers to multiplication and accumulation. wherein, when an error exists in the first data, the MAC operator compensates for multiplication result data generated by multiplying the first data and the second data and performs addition calculation of the compensated multiplication result data, Wherein, the MAC operator comprises: a multiplication module configured to perform a multiplication calculation of the first data and the second data to generate the multiplication result data; a multiplication result compensation circuit configured to receive the multiplication result data to output the multiplication result data when there is no error in the first data, and configured to perform compensation calculation of the multiplication result data to output compensated multiplication result data when there is an error in the first data; and An adding module is configured to perform an addition calculation of the multiplication result data output from the multiplication result compensation circuit or the compensated multiplication result data.

2. The PIM device according to claim 1, wherein: When there is no error in the first data, the MAC operator outputs multiplication result data corresponding to a multiplication calculation of the first data and the second data without compensating the multiplication result data.

3. The PIM device according to claim 1, wherein: The MAC operator receives the first data from the first storage area.

4. The PIM device of claim 1 , further comprising a second storage area configured to receive the second data from an external device and store the second data, in, The MAC operator receives the second data from the second storage area.

5. The PIM device according to claim 1, in, The first data is data generated by ECC calculation for error correction when the first data is written into the first storage area, where ECC refers to an error correction code; as well as The second data is data provided without applying the ECC calculation.

6. The PIM device of claim 1, further comprising an ECC logic circuit configured to perform ECC calculations for error correction during write operations and read operations with respect to the first storage area.

7. The PIM device of claim 6, wherein: The ECC logic circuit comprises: a parity / syndrome generator configured to generate parity for the first data to write the parity into the first storage area during the write operation, and to generate and output a syndrome and parity for the first data during the read operation; a syndrome decoder configured to determine an error location using the syndrome; and An error corrector is configured to correct errors located at error locations determined by the syndrome decoder.

8. The PIM device according to claim 7, in, The parity / symbol generator outputs an error signal to the MAC operator in the MAC mode, wherein the error signal indicates whether there is an error in the first data; as well as When there is no error in the first data, the MAC operator receives the error signal to output the multiplication result data.

9. The PIM device of claim 8, wherein: The parity / syndrome generator does not output a syndrome when there is no error in the first data based on the error signal, and outputs a syndrome to the syndrome decoder when there is an error in the first data based on the error signal.

10. The PIM device according to claim 9, in, When an error exists in the first data based on the error signal, the syndrome decoder transmits an error code indicating an error position of the first data to the MAC operator; as well as The MAC operator performs compensation calculation of the multiplication result data based on the error position and the bit value of the error position.

11. The PIM device according to claim 7, in, The syndrome decoder transmits an error code indicating an error position of the first data to the MAC operator; as well as The MAC operator outputs the multiplication result data when there is no error in the first data based on the error code, and performs compensation calculation of the multiplication result data when there is an error in the first data based on the error code.

12. The PIM device of claim 1 , further comprising an ECC logic circuit configured to generate a syndrome of the first data and decode the syndrome, and configured to output an error signal and an error code to the multiplication result compensation circuit, in, The error signal is a signal indicating whether there is an error in the first data, and The error code is a code indicating an error position when an error exists in the first data.

13. The PIM device according to claim 12, in, When there is no error in the first data based on the error signal, the multiplication result compensation circuit outputs the multiplication result data; as well as Wherein, when an error exists in the first data based on the error signal, the multiplication result compensation circuit performs compensation calculation of the multiplication result data using the error code to output compensated multiplication result data.

14. The PIM device of claim 1 , further comprising an ECC logic circuit configured to generate a syndrome of the first data and decode the syndrome, and configured to output an error code to the multiplication result compensation circuit, in, The error code is a code indicating an error position of the first data.

15. The PIM device according to claim 14, in, When there is no error in the first data based on the error code, the multiplication result compensation circuit outputs the multiplication result data; as well as Wherein, when an error exists in the first data based on the error code, the multiplication result compensation circuit performs compensation calculation of the multiplication result data using the error code to output compensated multiplication result data.

16. The PIM device according to claim 1, in, The multiplication result compensation circuit includes a plurality of multiplication result compensators; as well as Wherein, each of the plurality of multiplication result compensators comprises: a register configured to store the multiplication result data; a shift register configured to store the second data, and configured to shift a specific number of bits in response to a shift signal to output the shifted second data; an output logic circuit configured to receive the multiplication result data and the shifted second data from the register and the shift register, and configured to output the multiplication result data or perform compensation calculation of the multiplication result data to output compensated multiplication result data in response to a selection signal; and The selector is configured to generate the shift signal and the selection signal according to whether there is an error in the first data.

17. The PIM device of claim 16, wherein: When the LSB of the first data is the first bit, if the Kth bit of the first data is an error bit, the second data in the shift register is shifted by "K-1" bits in the direction from the LSB of the second data toward the MSB of the second data according to the shift signal, where LSB refers to the least significant bit, and MSB refers to the most significant bit.

18. The PIM device of claim 16, wherein: The selector is configured to generate a selection signal in a first output operation mode, the first output operation mode outputting the multiplication result data; configured to generate a selection signal in a second output operation mode, the second output operation mode outputting the compensated multiplication result data generated by adding the shifted second data to the multiplication result data; Or configured to generate a selection signal in a third output operation mode, the third output operation mode outputting the compensated multiplication result data generated by subtracting the shifted second data from the multiplication result data.

19. The PIM device according to claim 18, in, When there is no error in the first data, the selector generates a selection signal in the first output operation mode; Wherein, when there is an error bit in the first data and the error bit of the first data has a value of 0, the selector generates a selection signal in the second output operation mode; and When there is an error bit in the first data and the error bit of the first data has a value of 1, the selector generates a selection signal in the third output operation mode.

20. The PIM device of claim 19, wherein: The output logic circuit comprises: an output logic controller configured to: receive the multiplication result data and the shifted second data in response to a selection signal in the first output operation mode to output the multiplication result data, or output both the multiplication result data and the shifted second data in response to a selection signal in the second output operation mode and a selection signal in the third output operation mode; An addition logic circuit configured to perform an addition calculation for adding the shifted second data and the multiplication result data to output a result of the addition calculation based on a selection signal in the second output operation mode; and A subtraction logic circuit is configured to perform a subtraction calculation for subtracting the shifted second data from the multiplication result data based on a selection signal in the third output operation mode to output a result of the subtraction calculation.