This application is based upon and claims the benefit of priority from Japanese Patent Application No. 2012-058724, filed Mar. 15, 2012; the entire contents of which are incorporated herein by reference.
Embodiments described herein relate to an ECC (error correction code) circuit, and a compression technology.
When data are read from a memory card (NAND type flash memory), if the data is not correctly read, a bit error occurs. In order to correct the bit error, an ECC circuit for carrying out error correction is arranged in the memory card. The ECC circuit generates a parity bit on the basis of the user data when it was written (write data).
Also, in the memory cell array, in addition to the user area where the user data are stored, a management data region is arranged that stores the parity bit generated on the basis of the user data.
In general, embodiments will be explained with reference to figures. The same reference numbers are used throughout all of the figures. However, the figures are merely schematic diagrams, and it should be understood that the relationship between thickness and the planar dimensions and the ratio of the thicknesses of the various layers are not shown to scale. Consequently, any specific thickness and dimensions should be ascertained with reference to the following explanation. Also, the figures contain portions with different dimensional relationships and ratios.
According to one embodiment, there is provided a technology that improves error correction and provides a compression technology in a memory device.
According to the memory controller of the present embodiment, it has a processor that has the following parts or modules: a monitoring part that receives the write data and checks whether the data sequence of a designated pattern over a designated data length is contained in the write data, and a control part, which works as follows: when it is determined that the data sequence with the designated pattern is contained, the size of the page (the unit for the en bloc write of the data in the memory cell array) having memory cells that can hold the data and arranged in a matrix configuration is determined. Corresponding to the total data quantity and the size of the data, an idle area for each page is arranged, and is configured so that the data quantity of the write data stored in each page is even; the memory controller also has a parity generating part that generates the extended parity in the idle area and on the basis of a portion of the write data stored in each page and the management information of the page; and the control part stores the extended parity in the idle area while a portion of the write data are stored in each page.
According to the host equipment related to the embodiment, there is a control part that works as follows: the size of the page that is the unit for the en bloc write of data is determined. When it is determined that there is a designated or larger idle area on the last page of the en bloc write corresponding to the total write data quantity and the size of the write data, a data group including the logic address, the data, and the data sequence of the designated pattern succeeding the data and corresponding to the idle area is generated. When there is no designated or larger idle area on the last page, the data group including the logic address and the data is generated. Also, there is a data output part that outputs the write data and the data sequence generated by the control part.
Also, according to the memory device related to the embodiment, there are the following parts: a storage part that can hold the data on each page acting as the unit for the en bloc write of data, a control part that inserts the invalid data sequence at multiple sites of the first data sequence corresponding the capacity information of the written first data sequence and the size of the page of the storage part, and a parity generating part, which generates the third data sequence composed of the second data sequence as the unit for partitioning the invalid data sequence and the management information in the data; and the control part inserts the extended parity into the invalid data sequence.
According to the present embodiment, when the user data (write data) stored in each page are read, it is possible to improve error correction in read operations by using the user data and extended parity for each page. In the following, the configuration related to Embodiment 1 will be explained. In this embodiment, the extended parity in write and the normal parity (that is normally generated) are generated.
In the following, host equipment 1 and the memory card 2 controlling it related to Embodiment 1 will be explained.
The host equipment 1 has a host bus interface 5 (hereinafter to be referred to as host bus 5). This host bus 5 is used to transfer the control data, logic address, and SD command to the memory card 2. That is, the host equipment 1 can control the memory card 2.
Also, the host equipment 1 carries out transmission/reception of the user data (write data, read data) with the memory card 2. This host equipment 1 has hardware and software for carrying out access to the memory card 2.
The memory card 2 includes a NAND type flash memory 10 (also known as flash memory 10), a controller 20 that controls the NAND type flash memory 10, and a NAND interface (IF) (corresponding to the SD interface 21 to be explained later, as well as metal pins 1 to 9 shown in
The memory card 2 has power supplied to it when it is connected with the host equipment 1, and it is thus turned on to perform operations requested by the host equipment 1. More specifically, upon the request of the host equipment 1, data are stored in the NAND type flash memory 10, and the stored data are then read and output to the host equipment 1.
In this way, the host equipment 1 and the memory card 2 can be connected with each other so that it is possible to perform the two operations: the operation of data write/read and erasure with respect to the NAND type flash memory and the operation of reading data from the NAND type flash memory to the host equipment 1.
In the following, an example of the constitution of the host equipment 1 and the memory card 2 will be explained with reference to
As explained above, the host equipment 1 outputs the control data, the SD command, the address, the user data, etc., to the memory card 2. In the following, the user data will be explained. For the host equipment 1 in the present embodiment, when the presence of an idle capacity at the tail of the last page of an en bloc write of user data is recognized based on the data size of the user data transferred to the memory card 2 and the page size of the memory cell array (to be explained later), in addition to the user data, other data, such as the data sequence including that of continuous “1” data (hereinafter to be referred to as Null data) are also output via the host bus 5 to the memory card 2. On the other hand, when it is found that there is no idle capacity at the tail of the last page, the Null data are not generated, and the user data free of the Null data are output to the memory card 2.
Also, the MPU 22 (to be described later) notifies the host equipment 1 of the page size of the memory card 2. The “1” data sequence has a designated data length.
As explained above, the memory card 2 has an interface IF for performing the exchange of information (user data, address, SD command, control data, etc.) with the host bus 5 of the host equipment 1.
The memory card 2 is formed so that it can be inserted into or pulled out of a slot formed on the host equipment 1. As the memory card 2 is inserted in the host equipment 1, the multiple signal pins are electrically connected with the controller 20. For example,
Data 0 through 3 are allotted to the seventh, eighth, ninth and first pins, respectively. In addition, the card detection signal is also allotted to the first pin. Furthermore, the SD command is allotted to the second pin, the ground potential Vss is allotted to the third pin and the sixth pin, the power supply potential Vdd is allotted to the fourth pin, and the clock signal is allotted to the fifth pin.
The host controller (not shown in the figure) disposed in the host equipment 1 carries out communication of various types of signals and data with the controller in the memory card 2 via the first pin through the ninth pin. For example, when data are written in the memory card 2, the controller arranged in the host equipment 1 sends a write command as a serial signal via the second pin to the controller 20. In this case, the controller 20 answers the clock signal fed to the fifth pin, and fetches the write command sent to the second pin.
Here, as explained above, the write command uses only the second pin to be input as a serial signal to the controller 20. As shown in
On the other hand, communication between the flash memory 10 and the controller 20 is carried out using the NAND bus interface (hereinafter to be referred to as NAND bus) 25 for the NAND type flash memory to be explained later. Consequently, although not shown in the figure here, the flash memory 10 and the controller 20 are connected with each other by, for example, 8-bit input/output (I/O) lines.
For example, when data are written to the flash memory 10 by the controller 20, the controller 20 sequentially inputs the following signals via the I/O lines to the flash memory 10: data input command 80H, column address, page address, data, and program command 10H (or cache program command 15H). Here, “H” in the data input command 80H refers to hexadecimal. It actually sends the 8-bit signal “10000000” in parallel to the 8-bit I/O lines. That is, with the NAND bus interface 21, multiple-bit NAND command is sent in parallel.
Also, with the NAND bus interface 25, the NAND command and the data can share the same I/O lines in carrying out communication with the flash memory 10.
In the following, the configuration of the NAND flash memory 10 and controller 20 included in the memory card 2 will be explained in more detail with reference to
First of all, the controller 20 will be explained with reference to
The SD interface 21 carries out interface processes between the controller 20 and the host equipment 1. As explained above, the SD interface 21 receives, for example, the SD command, the (logic) address, the write data, etc., from the host equipment 1 via the host bus 5. Next, the SD interface 21 sends the received SD command to the MPU 22, and has the (logic) address and the write data stored in the RAM 24. In addition, the SD interface 21 outputs the read data to the host equipment 1 under the command of the MPU 22.
The MPU 22 controls the overall operation of the memory card 2. More specifically, when power supply is received by the memory card 2, the MPU 22 reads the firmware (a control program) stored in the ROM 23 and sends it to the RAM 24, then forms various types of tables in the RAM 24 by carrying out the designated operation. Also, the MPU 22 receives the write command, read command and erase command from the host equipment 1, then executes the designated operation for the NAND flash memory 10.
In addition, MPU 22 controls the operation of the NAND flash memory 10 under the command of the host equipment 1. More specifically, it controls the operation of data write, read, and erasure for the NAND flash memory 10, and it also carries out error correction for the read data and parity generation for the write data, etc. Consequently, the MPU 22 controls the physical state of the NAND flash memory 10 (such as the fact that a certain number of the logic sector address data should be contained in the physical block address at a certain site, or that the block at a certain site should be set in the erasure state, etc.).
As shown in
On the other hand, when monitor part 22-1 determines that the continuous “1” data sequence over a designated value is not contained in the write data (data C to be explained later), the MPU 22 writes the user data sent from the host equipment 1 to the memory cell array 11 according to the address obtained by LP conversion (logic-physical conversion). In addition, while executing the write of data A, B and C, the MPU 22 uses the encoder 28 to perform scrambling of the user data. The scrambling of the user data will be explained later.
In addition, when a data read instruction is received from the host equipment 1, the MPU 22 determines which parity should be used to perform the error correction. That is, when the normal parity and extended parity are generated, it determines whether the extended parity should be used to perform the error correction or the normal parity should be used to perform the error correction by selecting the type of the parity with a longer bit length of the parity bit. In addition, the MPU converts the extended parity among the written data sequence (user data+extended parity) to the original “1” data sequence, then sends the (user data+“1” data sequence) to the host equipment 1.
The ROM 23 stores the control program, etc., controlled by the MPU 22.
The RAM 24 is used as the operation area of the MPU 22 for storing the control program and various types of tables (Tables). More specifically, the logic-physical conversion table is held in the RAM 24. The logic-physical conversion table has the logic address sent from the host equipment 1 converted to the physical address indicating where the address should be written in the memory cell array 11. The logic-physical conversion table lists the value each time that a change takes place corresponding to the state of use of the block BLK of the memory cell array 11.
The NAND interface 25 carries out interface treatment between the controller 20 and the NAND flash memory 10. That is, under the command from the MPU 22, the NAND interface 25 outputs the commands issued from the MPU 22 (write command, read command, erasure command, etc.), the physical address, and the write data, etc., to the I/O buffer 15. In addition, it receives the read data sent from the I/O buffer 15, and transfers them to the RAM 24.
The ECC circuit 26 carries out error correction for the data. More specifically, for the page data read from the NAND flash memory 10, the ECC circuit 26 carries out error detection. When an error is detected, it carries out error correction. In addition, in the case of data write, on the basis of the write data, it generates the parity (normal parity) needed for error correction and, on the basis of the data group including the write data and the management data, it generates the extended parity needed for error correction.
The register 27 has various types of registers, such as CSR, CID, RCA, DSR, CSD, SCR, OCR, etc.
The encoder 28 carries out a scramble treatment for the write data. As to be explained later, it uses a pseudo random number generator and a scramble circuit to generate the random number.
In the following, the NAND flash memory 10 will be explained with reference to
The memory cell array 11 has multiple memory cell transistors MT. The memory cell transistors MT store the user data, the extended parity, and the management data (such as the normal parity and the defective information of the page unit, etc.) sent from the host equipment 1. In the following, the configuration of the memory cell array 11 will be explained with reference to
As shown in the figure, the memory cell array 11 has multiple blocks BLK (BLK0 to BLKm (m is a natural number of 1 or larger)), and each of these blocks BLK0 to BLKm have multiple NAND strings 11-1. Each of the NAND strings 11-1 has, for example, 64 memory cell transistors MT and selecting transistors ST1, ST2. The NAND strings 11-1 are connected to the corresponding bit lines BL.
There are, for example, 2×103×8 bit lines BL0 to BL(n+1) in all. There are, for example, 128 lines in all for the bit lines BL(n+2) to BL(s). Consequently, the number of NAND strings 11-1 corresponds to the number of bit lines BL arranged in the memory cell array 11. As explained above, the NAND strings 11-1 shown in
Each of the memory cell transistors MT that form the NAND strings 11-1 is an FG type N-channel MOS transistor having a charge storage layer (such as a floating gate) formed via a gate insulating film on the semiconductor substrate, as well as a control gate formed via an inter-gate insulating film on the charge storage layer. Also, the memory cell transistors MT may have a MONOS structure where the charge storage layer is made of an insulating substance. Also, the number of the memory cell transistors MT in the NAND strings 11-1 is not limited to 64. The number may also be 8, 16, 32, 128, or 256, etc. There is no specific restriction on the number. In the NAND strings 11-1, the memory cell transistors MT adjacent to each other share the source and drain. Then, between the selecting transistors ST1, ST2, the current route is arranged to make serial connection. For the serial connected memory cell transistors MT, the drain region on one end side is connected with the source region of the selecting transistor ST1, and the source region on the other end side is connected with the drain region of the selecting transistor ST2.
The control gates of the memory cell transistors MT on the same row are commonly connected with certain of the word lines WL (WL0 to WL63), and the gate electrodes of the selecting transistors ST1, ST2 of the memory cell transistors MT on the same row are commonly connected with the select gate lines SGD, SGS, respectively. In addition, the drains of the selecting transistors ST1 on the same row in the memory cell array 11 are commonly connected with certain of the bit lines BL (BL0 to BLn (n is a natural number of 2 or larger)). The sources of the selecting transistors ST2 are commonly connected with the source line SL. The data are written en bloc to the multiple memory cell transistors MT connected with the same word line WL. This unit is called a page. In addition, erasure of data is carried out in units of block BLK. In the embodiment, each page is a unit that can hold 2×103×8 bit data.
In the following, the threshold distribution of the memory cell transistors MT will be explained with reference to
For the threshold voltage Vth0 of data 1 in the memory cell transistors MT, there is the following relationship: Vth0<V01. For the threshold voltage Vth1 of data 0, there is the following relationship: V01<Vth1. In this way, the memory cell transistors MT can hold the 1-bit data of data 0 and data 1 corresponding to the threshold. The threshold voltage varies as the electric charge is injected into the charge storage layer. Also, the memory cell transistors MT may hold the data of 4 or more levels of values.
Now, return to
In the data write operation, read operation and erasure operation, the row decoder 12 selects the row direction of the memory cell array 11 on the basis of the row address sent from the controller 20 via the I/O buffer 15. That is, the row decoder 12 selects the word line WL and select gate lines SGD, SGS. Memory cell array 11 then transfers appropriate voltage to the word line WL and select gate lines SGD, SGS.
In the data write operation, the page buffer 13 sends the write data (user data, normal parity, and extended parity bit) sent from the I/O buffer 15 to the sense amplifier 17. Also, in the data read operation, the data read from the sense amplifier 17 (user data and extended parity data) are temporarily stored and then output to the I/O buffer 15.
The sense amplifier 17 selects the bit line BL, reads the data of the memory cell transistors MT, and sends the read data to the page buffer 13. More specifically, the data of the memory cell transistors MT connected with the word line WL are selected by the row decoder 12. In addition, in the data write mode, the data sent from the page buffer 13 are written in the memory cell transistors MT selected by the row decoder 12.
The voltage generator 14 generates the voltage needed for the data write operation, erasure operation and read operation under control of the control part 16. The generated voltage needed for the operations is fed to the row decoder 12 and sense amplifier 17.
In the data write operation, the I/O buffer 15 temporarily stores the write data, address, and write command sent from the controller 20. The address is then sent to the row decoder 12 and the address and the write command are sent to the control part 16, while the write data are sent to the page buffer 13. Also, in the data read operation, the address and the read command are received. The address and the read command are then sent to the control part 16, and the address is sent to the row decoder 12. Also, the read data received from the page buffer 13 are output to the controller 20.
In the following, the control part 16 will be explained. Here, the control part 16 controls the overall operation of the NAND flash memory 10. That is, on the basis of the address and the command sent from the controller 20, the sequence needed for the data write operation, read operation and erasure operation is executed.
In the following, the format of the write data sent from the host equipment 1 to the memory card 2 will be explained with reference to
The frame format of the data A shown in
The data A have a frame format including the following data sequentially from the head: logic address, user data, and Null data. That is, the logic address is set at the head, followed by the user data (such as 1 piece of video data), then the Null data sequence for transmission. The user data have a data size of, for example, 3584 bytes. When the data A are written in the memory cell array 11, first of all, in the RAM 24, the Null region is replaced with the extended parity, then the data sequence including the user data and the extended parity is written in the NAND flash memory 10. In other words, from the memory cell transistors MT corresponding to the logic address, for example, the user data are written into the 3584×8 continuous memory cell transistors MT, then the extended parity is written in the memory cell transistors MT.
The data B have a format which has the logic address at the head, followed by multiple consecutive groups each having the user data and the Null data after the user data (user data+Null data). That is, the data B includes the following data sequentially: user data, Null data, user data, Null data. (In
Data C have a frame format without setting the Null data annexed to the “data” in the frame format of the data A. For this frame format, from the memory cell transistors MT corresponding to the logic address, for example, the user data are written in, for example, 3584×8 continuous memory cell transistors MT, and the extended parity is not generated. In this case, the normal parity generated on the basis of the “data” is stored in the storing region of the management data.
According to the present embodiment, an example can be presented to explain that the video data with an original data size of 3584 bytes are sent in the frame format of data A.
In the following, the dividing method of the write data by MPU 22 will be explained with reference to
m=RoundUp(D/P,0) (1)
The function RoundUp is a function used in rounding up the data. Here, suppose the portion after the decimal point is rounded up. That is, for example, for D/P=1.5, as 1.5 is a value larger than 1 and smaller than 2, one has RoundUp (1.5,0)=“2”.
Then, using the “m” obtained in formula (1), the capacity p of the write data stored in each page can be obtained using formula (2).
p=RoundUp(D/m,0) (2)
The user area capacity of 1 page is P as mentioned previously. Among the P, the user data quantity is p, so that the data capacity r of the extended parity written in each page becomes formula (3).
r=P−p (3)
According to the formulas (1)-(3), suppose the data capacity for data 1 to data 4 is p, and the data capacity for the Null region is r, the frame format sent by host equipment 1 to the memory card 2 is composed of the combination of (p+r).
In the following, specific numeric values will be substituted in the formulas (1)-(3) for explanation.
Suppose the data capacity of a photographic picture D=3584 bytes, the user area capacity of 1 page P=1024 bytes, according to the formulas (1)-(3), one has m=RoundUp (3584/1024, 0)=4, p−RoundUp (3584/4, 0)=896 bytes, r=1024−896=128 bytes. In this case, when the frame format of data A is sent from the host equipment 1, by dividing the data sequence as mentioned previously, the data sequence (the data group including the user data and the Null data) stored in 1 page by the frame format shown in data B is generated.
The operation may also be carried out by the host equipment 1. That is, as the frame format of data A is sent from the host equipment 1, the data are divided by the MPU 22 using the method. However, one may also adopt a scheme in which the host equipment 1 carries out the computing operation to generate the frame format of data B, then sends it to the memory card 2.
In the following, generation of the parity bit by the ECC circuit 26 will be explained with reference to
First of all, the data sequence stored in the RAM 24 is checked by the monitor part 22-1. That is, it checks whether they are data A, data B, or data C (in
On the other hand, if the result of step S0 indicates that the frame format of the stored data sequence is data B (
On the other hand, if the result of step S0 indicates that the frame format of the data sequence stored in the RAM 24 is data C (
(3. Schematic Diagram Illustrating the Case in which the User Data and the Extended Parity are Stored in the Memory Cell Array 11)
By means of the host equipment 1 and the memory card 2 controlled by it related to the present embodiment, it is possible to improve the error correction for the read data. As explained above, according to the present embodiment, the data (such as a piece of photographic data) sent from the host equipment 1 and stored in each page of the memory cell array 11 does not have the maximum capacity of 1 page (such as 1024 bytes). Instead, an area that can store the extended parity is left on each page, while the user data are stored. That is, an area for storing “r” is arranged for each page as mentioned previously, and the extended parity is stored in the storing area. Here, in addition to the normal parity stored in the management data, generation of the extended parity can also improve error correction of the ECC circuit 26 in the read operation. As a result, when correction treatment is carried out for the read data, it is possible to selectively use a certain parity.
When data are read, as far as the question as to which of the normal parity and the extended parity should be used is concerned, the parity with a higher correction ability, that is, with a longer parity bit, is used. In order to improve error correction of the ECC circuit 26, the bit number of the extended parity is larger than the normal parity. However, in some cases, although an area for storing the extended parity is set for the page, the normal parity nevertheless has a larger bit number. In such a case, the normal parity should be used.
According to the host equipment 1 and the memory card 2 under its control related to the present embodiment, it is possible to average the error correction for correcting the read data. According to the present embodiment, as shown in
In the following, the constitution of the host equipment 1 and the memory card 2 under its control related to a modified example (hereinafter to be referred to as Modified Example 1) of the Embodiment 1 will be explained with reference to
The MPU 22 in Modified Example 1 works as follows: when there are Null data continuous for a designated bit number (that is, continuous “1” data sequence) in the write data, if it is found that as a result of the write operation, the Null data stored in each page is held in the user data, after the write operation in the NAND flash memory 10, the physical address of the Null data before the write operation and the physical address of the user data are changed so that the parity is stored at the tail of each page. As a result, the frame format of data A explained above in Embodiment 1 is formed. This operation is carried out in the RAM 24.
With the host equipment 1 and the memory card 2 under its control related to Modified Example 1, the same effects as those in the Embodiment 1 also can be realized. That is, even when the position of the Null data in the frame format sent from the host equipment 1 shifts, by changing the physical address as mentioned previously, it is possible to realize the same effect as that shown in
In the following, the host equipment 1 and the memory card 2 under its control related to Modified Example 2 with respect to the Embodiment 1 (hereinafter to be referred to as Modified Example 2) will be explained with reference to
In this case, the ECC circuit 26 generates the extended parity on the basis of the user data temporarily stored in the memory card 2 (RAM 24). The MPU 22 has the generated extended parity buried in the Null region, and it then has such data sequence written in the NAND flash memory 10.
In the following, this case will be explained with reference to
As explained above, this extended parity is an extended parity generated on the basis of the user data stored in the memory cell array 11 shown in
In this case, too, the normal parity is arranged in the management data storage region.
With the host equipment 1 and the memory card 2 related to Modified Example 2, it is also possible to realize the same effects as those of the Embodiment 1. That is, it is possible to improve error correction when the data stored in each page are read.
In the following, the host equipment 1 and the memory card 2 under its control related to Embodiment 2 will be explained. As explained above with reference to Embodiment 1, when the normal user data are stored in the memory cell array 11, the user data are randomized, then the randomized user data are stored in the memory cell array 11. According to Embodiment 2, after the user data are compressed using a designated method, the compressed data are randomized and then stored in the memory cell array 11. As to be explained later, the randomized user data are compressed (also explained below) and then are written in the memory cell array 11. In Embodiment 2 to be explained below, while it can be executed alone, it may also be combined with Embodiment 1 explained above for execution. Consequently, after compression of the user data, the extended parity is generated as needed. The same features as those in the Embodiment 1 will not be explained again.
In the present embodiment as explained above, in addition to the monitor part 22-1, the MPU 22 also has a compressing part 22-2, a control part 22-3, and a management part 22-4. The monitor part 22-1 monitors the user data stored in the RAM 24 and determines whether a designated data sequence is contained in the user data. More specifically, the user data are divided into, for example, 4 bits, 8 bits, 4 bytes, etc. When dividing is carried out to the 4 bits, 8 bits, 4 bytes, etc., the data sequence is monitored for being the designated data sequence. If there is the designated data sequence in the write data, the control part 22-3 is notified.
Upon receiving the notification from monitor part 22-1, the control part 22-3 controls so that the compressing part 22-2 compresses the data sequence in the designated direction.
Upon receiving the instruction of compression from control part 22-3, the compressing part 22-2 compresses the user data stored in the RAM 24 using the designated method. In the following, the compression method by the compressing part 22-2 will be explained. In addition, the encoder 28 carries out randomizing of the compressed data.
The management part 22-4 finds out the original bit length of the user data stored in the memory cell array 11, and the physical address for storing the compressed data in the memory cell array 11.
In the following, the compression method by the compressing part 22-2 will be explained with reference to
For example, when a data sequence of “01010101” is to be sent from the host equipment 1, the compressing part 22-2 converts it to 2-bit “01”, that is, it makes compression. Similarly, when a data sequence of “10101010” is sent from the host equipment 1, the compressing part 22-2 compresses it to 2-bit “10”, and it compresses the sequence of “11111111” to the 2-bit “11”.
However, even for the 8-bit data sequence, for the pattern with a low generation frequency, the compression may not be possible to perform. Consequently, when compression is carried out in 8-bit units, if the monitor part 22-1 determines that the 8-bit data sequence is a random pattern with a low generation frequency, or the data sequence is “00000000”, these data sequences are not compressed. In addition, “00” is attached to the head, and the 8-bit sequence following the “00” is a random pattern or a sequence of “00000000”.
In the following, the method of compression of the user data when the user data of 16 bytes are divided into 4 byte parts will be explained with reference to
Here, under control of control part 22-3, the compressing part 22-2 compresses the pattern of “010101 . . . 01” to the “01” pattern, compresses the pattern of “101010 . . . 10” to the “10” pattern. Also, as the pattern of “111010 . . . 00” is a random pattern, the compressing part 22-2 does not compress the data sequence, and “00” is attached to the head to a data sequence of “00”+“111010 . . . 00”. Then, for the pattern of “001110 . . . 00”, as it is also a random pattern, the data sequence is not compressed by compressing part 22-2, and, just as above, “00” is attached to form a data sequence of “00”+“001110 . . . 00”. As a result, the 16-byte data sequence is compressed to the 9-byte data sequence. The compressed data sequence may also be held in a region different from the region where the data sequence exists before compression, and it may also be stored in the region where the data sequence before compression are kept.
In the following, a compression system different from this system will be explained with reference to
As shown in
In the following, the encoder 28 will be explained with reference to
The pseudo random number generator 28-1 generates a pseudo random number on the basis of the seed value. The seed value is an intrinsic value of the memory card 2. For example, it may be the lot No. of the silicon wafer or the like when the MPU 22 is manufactured.
There is no specific restriction on the constitution of the pseudo random number generator 28-1. For example, a linear feedback shift register may be used. For example, the pseudo random number generator 28-1 generates the pseudo random number according to the command of the MPU 22.
In the data write mode, the scramble circuit 28-2 reads the compressed user data from the RAM 24, and it then scrambles on the basis of the pseudo random number generated by the pseudo random number generator 31. Then, the result of the arithmetic is stored as the scramble data in the RAM 24.
In the following, the procedure for the generation of the extended parity in Embodiment 2 will be explained with reference to
Also, the procedure shown in
Due to the host equipment 1 and the memory card 2 under its control related to Embodiment 2, it is possible to obtain even better effects than the Embodiment 1. That is, it is possible to further improve error correction in read mode. As explained above, after the compression operation, the capacity of the region where the user data are stored is decreased, so that it is possible to increase the capacity of the extended parity that can be stored.
In the following, the state in which the area that can store the extended parity is increased due to the compression will be explained using specific values. For example, suppose the page size is 1024 bytes, the user size is 984 bytes, and the parity storage region is 40 bytes. Suppose the lowest data compression rate is 98%, it is possible to guarantee an idle region of about 20 bytes in the area where the user data are stored, and the parity, which has been 20 bytes, extends to 60 bytes. A simple computing indicates that error correction is improved up to about 1.5 times.
In the example of the compression system, the data sequence stored in the RAM 24 is divided into 8-bit or 4-byte parts. However, one may also adopt a scheme in which each data sequence is divided into various bit sequences, including the 8-bit data sequence and 4-byte data sequence. That is, the following scheme may also be used: the monitor part 22-1 checks the data sequence of the user data from the head and, when a designated data sequence can be formed, the portion is taken as a bit sequence, and it is then compressed. The information about how many bits should be taken for compression is stored together with the physical address of the memory cell array 11 stored in the management part 22-4 equipped in the control part 22-3 of the MPU 22.
In the following, the host equipment 1 and the memory card 2 under its control of the first modified example of Embodiment 2 (hereinafter to be referred to as Modified Example 3) will be explained with reference to
In the following, the constitution of the MPU 22 will be explained with reference to
In Modified Example 3, the monitor part 22-1 checks whether there is the designated data sequence in 2-byte units in the user data sent from the host equipment 1. When the monitor part 22-1 finds the designated data sequence, it checks the word address and section address (to be explained later) of the data sequence, then notifies the control part 22-3. The information notified by the monitor part 22-1 to the control part 22-3 may also be the logic address (physical address) of the data sequence. Here, as an example, an explanation will be made on the case in which the designated data sequence is “ffff” (or “1111111111111111” in binary system).
The control part 22-3 divides the data sequence of the user data in the RAM 24 into multiple groups (hereinafter to be referred to as sections). The section number may be 2 or some other number. There is no specific restriction on the dividing number. However, the dividing number is preferably that which can divide the data capacity of 1 page. In the following, the case in which the dividing number is 2 or 16 will be explained.
When the control part 22-3 is notified by the monitor part 22-1 that “ffff” is present in the data sequence, it checks what section the data corresponds to and what region in the corresponding section the data exists from the word address and section address notified by the monitor part 22-1.
Suppose dividing is carried out with a dividing number of 3 or larger, and, there is a data sequence “ffff” in 2 sections. In this case, the generating part 22-5 generates the point storage region from the control part 22-3 and from the hit flag region corresponding to the divided section number and the number of sections in which the corresponding data sequence exists among the multiple divided sections. Under these conditions, the point storage region 0 and the point storage region 1, as well as the hit flag region 0 and hit flag region 1, are generated. Here, the point storage region refers to the region arranged in the management data and having the capacity of the point storage region, and the number of point storage regions generated changes each time that write takes place. The value of the hit flag region indicates whether the address indicating the point storage region is valid. That is, when search of the data sequence “ffff” in the section is successful and the address stored in the resulting point storage region shows a valid value, “1” is stored in the hit flag region. On the other hand, when the search of the data sequence “ffff” failed, even when an address is stored in the point storage region, it still shows that this address is invalid.
In addition, the control part 22-3 writes the section address where the designated data sequence “ffff” exists in the generated point storage region. The bit number of the section address has a value corresponding to the divided section number.
In addition, the control part 22-3 stores the extended parity in the region where the data sequence “ffff” is arranged. When the write data are stored in the memory cell array 11, the data sequence is configured so that the extended parity can be stored at the tail of the page (in
When there is a command for generating the point storage region from the control part 22-3, the divided section number and the point storage region corresponding to the section number containing the designated data sequence are generated by the generating part 22-5. The same operation is carried out for the hit flag region.
In the following, the compression system related to Modified Example 3 using
In the following, the case in which 1 page is divided into two sections, that is, section 0 and section 1 will be explained. Here, control part 22-3 sets the dividing number as explained above. As shown in
As the address when dividing into 2-byte units is made is taken as “word address”, as shown in
Here, consider the case in which “ffff” is contained in “2” (word address) of section 0 and “258” (word address) of section 1. In this case, generating part 22-5 generates the point storage region 0 and point storage region 1, as well as hit flag region 0 and hit flag region 1. The generated point storage region 0 and point storage region 1 correspond to the position of the divided section, and they can hold the bit number that can represent the address of each section. That is, as explained above, for example, section 0 and section 1 are divided into 2-byte regions, and each region is made to correspond to 0 to 255, that is, one of a total of 256 addresses. Consequently, the bit number that can be held in the point storage region 0 is 8 bits. Similarly, the point storage region 1 also can hold bits with the bit number of 8 bits.
When the “ffff” sequence is contained in section 0 and section 1, the generating part 22-5 stores 1 in each of the hit flag 0 and hit flag 1 corresponding to these sections. When the designated data sequence is not contained in the corresponding section, 0 is stored in the hit flag.
In this way, by using the point storage region and hit flag region in the management data, it is possible to take the “ffff” data sequence contained in section 0 and section 1 as the idle region, and to carry out compression for the user data stored in each page.
In the following, with reference to
Just as mentioned previously, when the address allotted in 2-bytes units is taken as the word address, as shown in
Now, suppose “ffff” is contained in “2” (word address) of section 0, “34” (word address) of section 1, . . . “450” (word address) of section 14, and “482” (word address) of section 15. In this case, generating part 22-5 generates point storage regions 0 to 15 and hit flags 0 to 15. The generated point storage region 0 to point storage region 15 correspond to the positions of the divided section 0 to section 15, and the bit number that can represent the section address of each section can be held. That is, as explained above, for example, when section 0 is divided by 2 bytes, each region corresponds to 0 to 31, that is, a total of 32 addresses. Consequently, the bit number that can be held in the point storage region 0 is 5 bits. Similarly, each of the point storage regions 1 to 15 can hold a bit number of 5 bits.
When the “ffff” sequence is contained in section 0 to section 15, the generating part 22-5 stores 1 in the hit flags corresponding to these sections.
In this way, using the point storage region in the management data, by taking the “ffff” data sequence contained in section 0 and section 1 as the idle region, compression is carried out for the user data stored in each page. Here, “ffff” is merely an example presented for explanation. The data sequence is not limited to it, as long as it can be recognized by the monitor part 22-1. For example, the data sequence of continuous “0” data and the data sequence of mixed “0” and “1” may also be used.
In the following, the operation ((i)-(vi)) in the memory controller 20 in the write mode will be explained with reference to
(i) The control part 22-3 bisects the data sequence of 1024 bytes and the divided regions are taken as section 0 and section 1, respectively.
(ii) The control part 22-3 attaches, in 2-byte units, the word address and section address to each of the regions of the data sequence. Then, the monitor part 22-1 checks whether the designated data sequence is contained in each of the data sequences attached with the addresses. As a result, suppose that the “ffff” sequence is contained in word address 2 and word address 258:
(iii) Consequently, under control of the control part 22-3, the generating part 22-5 generates the point storage region 0 and point storage region 1 corresponding to the sections containing the designated data sequence. That is, the generating part 22-5 generates the following regions in the management data storage region: point storage region 0 and point storage region 1, and the hit flag 0 and hit flag 1 corresponding to the point storage regions 0, 1, respectively. The generating part 22-5 sets the regions of these point storage regions as 8 bits.
(iv) Corresponding to the value of the section address obtained by monitor part 22-1, the control part 22-3 has the bit corresponding to the section address to the point storage region. For example, if section address=2, the data sequence stored in the point storage region 0 is “00000010”. If section address=255, the data sequence is “11111111”. Consequently, although the “ffff” data sequence is not stored in the section address=2, the control part 22-3 can still recognize that the “ffff” data sequence is contained in the address of “00000010” of section 0 and the address of “00000010” of section 1. Also, the control part 22-3 stores flag 1 in the hit flags 0, 1 corresponding to the point storage regions 0, 1, respectively.
(v) As a result of the operation (iv), suppose the address of “00000010” of section 0 and section 1 is the idle region. Then, the control part 22-3 stores the extended parity in the address of “00000010” of section 0 and the address of “00000010” of section 1 that have stored the “ffff” data sequence up to that time point.
(vi) Then, when the word addresses of the extended parity shown in
Then, the extended parity is moved to the section address=0, 1 of the special section (section 3). With this operation, the data sequence before the data write operation as shown in
Even for the host equipment 1 and the memory card 2 under its control related to Modified Example 3, it is still possible to compress the user data, so that it is possible to extend the region for storing the extended parity. In Modified Example 3, the point storage region indicating the position information of the data sequence of the designated pattern is arranged in the management data storage region. That is, because it is possible to specify which section the point storage region belongs to at the position stored in the point storage region, the bit number held in the point storage region becomes smaller. Consequently, when dividing is carried out to section 0 and section 1 presented above as an example, the bit number for holding in the point storage region can be decreased from 9 bits to 8 bits. As a result, as the divided section number increases, the effect of the decrease in bit number becomes significant. As explained above, for example, in the case of dividing into 16 sections, the bit number for holding in the point storage region can be 5 bits, and it is possible to decrease the bit number for each point storage region from 9 bits to 5 bits. That is, when the data sequence of the designated pattern is present in each of the section 0 to section 15, the extendable capacity of each point storage region is 5 bits. Consequently, 16 point storage regions are generated. As a result, the increase quantity becomes 16×5 bits=90 bits and, as a result of generation of the 16 point storage regions, the increase quantity becomes 16×1 bit. That is, the increase is 90+16=116 bits.
However, the region of the data sequence (2 bytes) of the designated pattern contained in section 0 to section 15 is taken as the idle region. That is, it is possible to decrease by 16×2 byte (16 bit)=32 byte (256 bit). Consequently, it is possible to make compression for only (256−116)=140 bits. As a result, it is possible to generate the extended parity with a bit number length corresponding to the capacity of the idle region, so that it is possible to improve error correction in read mode.
In the following, the host equipment 1 and the memory card 2 under its control related to Embodiment 3 will be explained with reference to
As shown in
Here, the image pickup element part 40 has multiple pixel parts arranged in a matrix configuration with rows and columns. After a noise-canceling treatment for the charge (analog signal) obtained from the pixel parts with the photoelectric effect, the charge is converted to digital signal by the ADC part. The digital video data will be referred to as RAW data (uncompressed data).
The image processing part 41 carries out the following treatments for the RAW data: white balance treatment, wide dynamic range treatment, noise decreasing treatment, defective pixel correction treatment, and other video signal treatments. Then, the image processing part 41 outputs the video signal processed RAW data to the SD interface 42.
The host bus interface 42 transfers the image processed RAW data processed by the image processing part 42 to the memory card 2.
Just as mentioned previously, the memory card 2 includes a NAND controller 20, an SD interface 21, and a NAND flash memory 10. In the following, the NAND controller 20 related to the present embodiment will be explained in detail with reference to
In the following, the NAND controller 20 will be explained in detail with reference to
The JPEG encoder/decoder part 20-2 compresses the video data according to the JPEG2000 code. The compression system of the JPEG2000 code is a reverse convertible compression system. With the data compression according to the JPEG2000 code, it is possible to compress the data size by about 50-60%.
According to the write operation in the present embodiment, after the RAW data sent from the host equipment 1 are temporarily stored in the RAM 24, the video data are compressed according to the JPEG2000 code. Then, on the basis of the compressed data, the extended parity is generated by the ECC circuit 26. The compressed data and the extended parity are then written in the NAND flash memory 10. In the following, the operation in the NAND controller 20 in the write operation will be explained.
In the NAND controller 20, for the write data, the compression and generation of extended parity are carried out. In the following, explanation will be made with reference to
As shown in
For the host equipment 1 and the memory card 2 under its control related to Embodiment 3, it is also possible to improve error correction in read operations. In addition, according to the present embodiment, the extended parity is generated without having the Null data continuously succeed the video data sent from the host equipment 1. However, one may also adopt a scheme in which, just as in the Embodiment 1, the extended parity is generated even when the Null data are sent from the host equipment 1.
Also, when the circuit scale of the JPEG2000 code is large and the cost is high, so that assembling of it on the memory card 2 is difficult, the function of the JPEG2000 code may also be incorporated into the host equipment 1. In this case, the host equipment 1 notifies the controller 20 that the encoded data of JPEG2000 code are written in the memory cell array 11. Upon receiving this notification, the controller 20 generates the extended parity on the basis of the encoded video data.
In the following, the host equipment 1 and the memory card 2 under its control related to a modified example of Embodiment 3 (hereinafter to be referred to as Modified Example 4) will be explained with reference to
Mode 1: Write of compressed data
Mode 2: Write of uncompressed data
Mode 3: Write of uncompressed data and compressed data
Mode 4: Write of uncompressed data (in the read operation, after treatment by the JPEG encoder/decoder, the data are sent to the host equipment)
According to the present embodiment, the JPEG encoder/decoder part 20-2 in the various modes will be explained. As explained above, JPEG encoder/decoder part 20-2 works in any of the four modes according to the instruction from the host equipment 1.
When there is an instruction from the host equipment 1 to work in mode 1, the JPEG encoder/decoder part 20-2 carries out encoding (compression/conversion) according to the JPEG system for the RAW data sent from the host equipment 1 via the SD interface 21 in the write operation. The compressed data encoded by the JPEG encoder/decoder part 20-2 are sent to the RAM 24, and they are then written in the NAND flash memory 10 by MPU 22.
When the encoded video data are output to the host equipment 1 in the read operation, for the video data that have been sent from the NAND flash memory 10 via NAND interface 25 and that are temporarily stored in the RAM 24, the JPEG encoder/decoder part 20-2 carries out decoding. The decoded video data are then sent via the SD interface 21 to the host equipment 1.
When there is an instruction to work in mode 2 from the host equipment 1, the memory controller 20 writes the RAW data in the NAND flash memory 10. That is, in mode 2, the memory controller 20 carries out the write of data in the NAND flash memory 10 without performing a compression of data for the RAW data.
When the data written in the NAND flash memory 10 are read, because the stored data are uncompressed data, the memory controller 20 sends them without decoding to the host equipment 1.
When there is an instruction to work in mode 3 from the host equipment 1, the mode 1 and mode 2 are combined. That is, the two types of data, namely, the video data encoded by the JPEG encoder/decoder part 20-2 and the uncompressed video data, are written in the NAND flash memory 10.
In the read operation, the compressed data are decoded by the JPEG encoder/decoder part 20-2 and are sent to the NAND flash memory 10, while the uncompressed data are not extended, and the data read from the NAND flash memory 10 are sent to the host equipment 1.
In mode 4, just as in mode 2, the uncompressed data are written in the NAND flash memory 10. On the other hand, in the read operation, the uncompressed data are sent by the MPU 22 to the host equipment 1 after encoding and decoding treatment by the JPEG encoder/decoder part 20-2.
For the host equipment 1 and the memory card 2 under its control related to Modified Example 4, the write speed to the memory card 2 can be a high speed, and it is possible to cut the memory busy-state quantity of the flash memory 10 of the memory card 2. For example, when an operation in mode 4 is carried out, in the host equipment 1, it appears to be read from the JPEG data stored in the memory card 2. Because write may be carried out only for the uncompressed data, compared with the prior art that writes both the uncompressed data and the compressed data, it is possible to shorten the write time and it is also possible to reduce the memory busy-state capacity.
Also, the circuit constitution of the JPEG encoder/decoder part 20-2 is relatively simple. Consequently, it is possible to store in the memory controller 20 at a lower cost, and the unit price of the memory card 2 will not rise significantly. For example, when the storage device is SSD (solid state drive), even when the JPEG encoder/decoder part 20-2 is assembled in the storage device, there is still no significant rise in the cost, and it is possible to assemble in a simpler way.
In the Embodiment 1, when data C are transferred from the host equipment 1, that is, even in the case in which the Null data succeeding the data are not transferred, when there is the designated idle region at the tail of the last page where the user data are written, the extended parity may be generated using the scheme used on data A and data B as explained above.
While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the inventions. Indeed, the novel embodiments described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the embodiments described herein may be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the inventions.
Number | Date | Country | Kind |
---|---|---|---|
2012-058724 | Mar 2012 | JP | national |