In accordance with an aspect of the invention, a multi-bit-per-cell storage device categorizes different classes of data according to the data integrity required and then stores the data requiring higher data integrity using fewer bits per cell. Data that is more error tolerant is stored at higher density. Accordingly, storage density and the quality of output based on the stored data are optimized. The memory is particularly useful for recording and playing back a data stream formatted according to an industry standard. Examples of current industry standards include MP3 (i.e., MPEG-1 Audio Layer III and MPEG-2 Audio Layer III), MPEG-AAC, and Dolby AC-3 for audio or music and bitmap, JPEG, GIF, and any of the several MPEG standards for still images or video. Such applications often only require random access to the start of a data stream or to a frame in the data stream and do not require random access to particular data elements within a frame.
U.S. Pat. App. Ser. No. 09/505,519, entitled “Multi-Bit-Per-Cell Non-Volatile Memory With Maximized Data Capacity”, and U.S. Pat. App. Ser. No. 09/492,949, entitled “Data Management for Multi-Bit-Per-Cell Memories,” describe memories capable of storing different numbers of bits per cell and are hereby incorporated by reference in their entirety.
FIG. 1 is a block diagram of a multi-bit-per-cell memory 100 in accordance with an embodiment of the invention. Memory 100 records or plays back data streams and includes an input data buffer 110, a decoder 120, a multi-level write circuit 130, a multi-bit-per-cell memory array 150, a multi-level read circuit 160, a second decoder 170, and an output data buffer 180. In an exemplary embodiment of the invention, memory array 150 is a multi-bit-per-cell Flash memory array in which each memory cell is a floating gate transistor. Multi-level write circuit 130 and multi-level read circuit 160 can implement read and write methods as described in U.S. pat. App. Ser. No. 09/493,026, entitled “Read And Write Operations Using Constant Row Line Voltage and a Variable Column Line Load” or U.S. Pat. Nos. 5,638,320; 5,680,341; 5,682,352; 5,687,115; 5,694,356; 5,745,409; 5,748,534; 5,748,533; 5,815,425; 5,818,757; 5,969,986; 6,038,166; 6,058,060; and 6,094,368, which are hereby incorporated by reference in there entirety. Alternatively, memory array 150, multi-level write circuit 130, and multi-level read circuit 160 can use any technique for storing, writing, and reading multiple bits of data per memory cell.
In accordance with an aspect of the invention, each of multi-level write circuit 130 and multi-level read circuit 160 operates in several different modes. When writing to a memory cell, a writing mode determines the number N of bits of data that write circuit 130 writes to the memory cell. Similarly, read circuit 160 has different reading modes, where the reading mode for a read operation determines the number N of bits of data that multi-level read circuit 160 extracts from the memory cell.
A record operation in memory 100 writes a sequence of data values from an input data stream to a set of memory cells in memory array 150. A playback operation reconstructs the data stream by reading a set of memory cells. A starting address, which identifies a set of memory cells, can be recorded in a directory or can be fixed according to the architecture of the memory array or the sectors in the memory array. In particular, recording of a data stream can start writing data at the start of a memory block or sector, and playing back the data stream starts at the same address. Addressing and accessing a data stream from its beginning is thus completely conventional even though the use of different storage densities increases the addressing complexity of randomly accessing particular bytes in the data stream. However, for data streams such as data streams representing music, images, or video, full random access is typically not required.
For a recording operation, decoder 120 receives the input data stream via an input data buffer 110. Decoder 120 decodes the data stream to determine how to parse the data stream into data values for writing. The parsing divides the data stream into a sequence of data values. Each data value contains a number N of bits where N for the data value depends on the data integrity required for data of the type the data value represents. The number N can be any integer value in a range between one and a maximum number of bits that can be stored in a single memory cell, or the number N can be restricted to particular values (e.g., 2, 4, or 8) in the range.
Decoder 120 selects writing modes for multi-level write circuit 130 when writing the sequence of data values from input data buffer 110 into Flash memory array 150. The write mode determines the number N of bits that multi-level write circuit 130 writes to a memory cell during a write operation. When a playback operation would be unable to identify the data type before the data is read, for example, for an initial portion of a data stream, decoder 120 writes that data at the default data density, e.g., the data density providing the highest data integrity.
In FIG. 1, multi-level write circuit 130 receives the N-bit value from input data buffer 110 and writes the N-bit value in the next memory cell in the set storing the data stream. Alternatively, since the number N can change from one data value to the next, decoder 120 retrieves fixed-size data values from input data buffer 110 and provides variable-size data values to multi-level write circuit 130.
A playback operation in memory 100 reads the sequence of memory cells corresponding to a data stream and determines a sequence of data values that constitute the data stream. For identification of data values in the data stream, decoder 170 decodes data values as read from memory array 150 to determine the number of bits read from subsequent memory cells in the sequence. However, the default number of bits are read from each of one or more initial memory cells that store an initial portion of the data from a data stream. Accordingly, no decoding is required to determine the number of bits read from the initial memory cells that hold the initial portion of the data from a data stream. In most practical applications, the initial data is stored with one or two bits per memory cell (i.e., N=1 or 2). The high data integrity achieved with the small number of bits per cell is typically appropriate for the header information that may be found at the start of the data stream.
Decoder 170 controls the reading mode of multi-level read circuit 160 to select the number of bits read from each memory cell. Output data buffer 180 receives the sequence of data values from multi-level read circuit 160 directly as shown in FIG. 1 or alternatively via decoder 170. Similarly, decoder 170 can receive the sequence of data values from multi-level read circuit 160 directly as shown in FIG. 1 or via output data buffer 180. Decoder 170 uses the sequence of data values associated with the header or other format bits of the data stream to determine how many bits to read from subsequently read memory cells in Flash memory array 150. Output data buffer 180 converts the sequence of data values into a serial bit stream or any other output format.
In the exemplary embodiment illustrated in FIG. 1, decoder 120 includes a shift register 122, programmable array logic (PAL) 124, data type identification logic 126, and control logic 128. For a record operation, shift register 122 receives a serial data stream and provides a parallel multi-bit data signal to the input terminals of PAL 124.
PAL 124 is programmed according to the format of the data stream and includes a user accessible interface that permits re-programming of PAL 124 for use with different industry standards for data stream. Architectures for such PALs are well known in the art and can employ non-volatile storage cells having a construction similar to the construction of memory cells in multi-bit-per-cell Flash memory array 150.
PAL 124 cooperates with data type identification logic 126 to identify a data type for each portion of the data stream. The data type for a portion of the data stream determines the writing mode (i.e., the number of bits stored per cell) for that portion of the data stream. For example, a typical format for a data stream divides the stream into frames with each frame having a header, side information, and main data. When started on a recording operation, PAL 124 generates a sync signal when the content of shift register 122 corresponds to a synchronization value found in the header of a data frame. PAL 124 can be further programmed to extract or determine from the data stream a frame length for a current frame, i.e., the number of data bits in the frame.
PAL 124 being programmable and re-programmable allows memory 100 to adapt to different standards for data streams being recorded. Generally, memory 100 would be used to store one or more data streams of a specific format. However, data streams having different formats could be simultaneously stored in memory array 150, and the programming of PAL 124 can be re-programmed “on-the-fly” when required to store or playback a data stream conforming to a specific standard.
Based on the output signals from PAL 124, data type identification logic 126 determines writing modes for the following operations writing data from data buffer 110 to memory array 150. The number N of bits changes for different portions of the data frame. For example, the header information, which requires a highest level of data integrity, can be stored using a few bits (e.g., 1 or 2 bits) per cell. For sound or image data, a lower level of data integrity provides good performance, and memory 100 uses a larger number of bits per cell for storage of such data (e.g., 4 or more bits per cell).
Decoder 170 operates in a manner similar to that of decoder 120. In particular, both decoders 120 and 170 receive a data stream and identify a number of bits corresponding to a memory cell. Accordingly, an embodiment of the invention can reduce the amount of circuitry by eliminating some or all of the elements of decoder 170, and using circuitry from decoder 120 in the control of multi-level write circuit 120 and multi-level read circuit 160.
FIG. 2 is a block diagram of a memory 200 in accordance with another embodiment of the invention. Memory 200 is substantially the same as memory 100 except that a decoder 220, an M-bit write circuit 230, an M-bit read circuit 260, and a decoder 270 in memory 200 differ from decoder 120, multi-level write circuit 130, multi-level read circuit 160, and decoder 170 in memory 100. More particularly, for a write operation, M-bit write circuit 230 always receives an M-bit value (where M is greater than or equal to the maximum number of data bits stored in any single memory cell) and programs a corresponding memory cell to a threshold voltage corresponding to the M-bit value.
Decoder 220 includes control logic 228 that generates the M-bit values for M-bit write circuit 230, from N-bit values where N depends on the data type and is less than or equal to M. More specifically, control logic 228 receives from identification logic 126 a signal indicating the number N of bits for the next memory cell. Control logic 228 then extracts N bits from shift register 122 (or alternatively from data buffer 110), converts the N-bit value into an M-bit value, and provides the M-bit value to M-bit write circuit 230.
The M-bit value resulting from conversion of an N-bit value is such that threshold voltage drift and inaccuracies that may erroneously change, set, or interpret the threshold voltage representing the M-bit value are likely to leave an M-bit value that still corresponds to the correct N-bit value when read. Thus, when N is less than M, memory 100 stores N-bit values with data integrity greater than the data integrity of M-bit values.
For a read operation, M-bit read circuit 260 sends to decoder 270 an M-bit value that corresponds to the current threshold voltage of a memory cell being read. Control logic 278 in decoder 270 converts that M-bit value to an N-bit value where N is less than or equal to M and depends on the data type indicator from logic 176. Control logic 278 passes the resulting N-bit value to shift register 172 and/or data buffer 180. The remainder of memory 200 operates in the same fashion as memory 100 of FIG. 1.
FIG. 3 illustrates the format of a frame in an MP3 data stream, which memory 100 or 200 (specifically PALs 124 and 174) can be programmed to record and playback. Memory 100 with appropriate modifications or re-programming could alternatively store any other data format. In the MP3 format, a data frame 300 includes a 4-byte frame header 310, two CRC (cyclic redundancy code) bytes 330 assuming the protection bit is set, 17 or 32 bytes of side information 340, between 8 and 1417 bytes of main data 350, and a variable amount of ancillary data 360. The 4-byte header includes a 12-bit synchronization pattern 311, an ID bit 312, a 2-bit layer field 313, a CRC bit 314, a bit rate field 315, a sampling frequency field 316, a padding bit 317, a private bit 318, a mode field 319, a mode Ext field 320, a © bit 321, an O/C bit 322, and an Emphasis field 323. Pre-header information 370, which precedes frame header 310 in the data stream, can be valid main data for the frame.
FIG. 4 illustrates the programming of input and output signals of programmable array logic 124 in accordance with an exemplary embodiment of the invention. Programmable array logic (PAL) designs are well known in the art and could be constructed using an array of flash memory cells adjacent to regular data storage array 150.
The input signals to PAL 124 are from shift register 122. In FIG. 4, the input signals are named in accordance with the fields in a frame header in accordance with the MP3 protocol. In particular, the signals from oldest in the shift register are SYNC WORD (12 bits), ID, LAYER (2 bits), CRC, BIT RATE (4 bits), SF INDEX (2 bits), PADDING, PRIVATE, MODE (2 bits), MODE EXT. (2 bits), COPYRIGHT, ORIG./COPY, and EMPHASIS (2-bits). The output signals are VALID FRAME, CRC PRESENT, PADDED, MONO, MDP 112, MDP 140, MDP 168, . . . , MDP 1296, and MDP 1440.
Each output signal is asserted only if input signals from the shift register 122 have the bit values equal to those in the row of array 124 that is associated with the output signal. In array 124 of FIG. 4, “X” indicates that the value of the input bit does not affect the output signal. For example, output signal VALID FRAME is only asserted if the (oldest) twelve bits corresponding to input signal SYNC WORD are all ones and the two bits corresponding to signal LAYER are “10 b”. These values are according to the MP3 protocol for the frame header. Data values in the other fields are irrelevant to generation of output signal VALID FRAME.
Signals CRC PRESENT and PADDED are asserted if the MP3 header indicates a CRC code or PADDING are in the data frame. Signal MONO is asserted if the data frame contains audio data in mono format. The asserted one of signals MDP 112, MDP 140, MDP 168, . . . , MDP 1296, and MDP 1440 indicates the main data pointer for the data frame.
Data type identification logic 126 uses the output signals from PAL 124 to determine the mode or the number of data bits to be grouped and written to each memory cell. In particular, once signal VALID FRAME is asserted, data type identification logic 126 can determine the size and data type of a series of portions of the data stream. For MP3, for example, the header can be written one bit per memory cell (N=1), while side information, main data, and ancillary data are respectively written at two (N=2), four (N=4), and four (N=4) bits per memory cell. Data type identification logic 126 counts the number of write operations and changes the write mode after the last value of a specific data type is written. For a last data value of a portion of the data stream, data type identification logic 126 can change the number of bits written so that no memory cell stores data from adjacent portions when the adjacent portions have different data integrity requirements.
Shift register 172, PAL 174, and logic 176 and 178 manipulate data multi-level read circuit 160 reads from the array 150. Otherwise, shift register 172, PAL 174, and logic 176 and 178 work for the read operation in a similar manner to that of shift register 122, PAL 124, and logic 126 and 128 for a write operation.
A record operation can ignore (i.e., not write) data from the data stream when the data appears to be invalid. In particular, data from the data stream can be temporarily kept in input buffer 110 until decoder 120 or 220 identifies a synchronization pattern, decodes a header, and identifies the start of the valid data. For an MP3 frame, synchronization pattern 311 is twelve consecutive bits with value one. As described above, PAL 124 activates signal VALID FRAME when twelve consecutive “1”s are in the appropriate positions in shift register 122. (The sequence of twelve “1”s is not permitted in other parts of an MP3 data frame.) In response to the signal VALID FRAME, logic 126 identifies the start of valid data in the data stream, determines the type of data, and selects for a writing mode (e.g., a number of bits N) for that data. The six bytes beginning with and including the synchronization pattern correspond to the data in frame header 310 and CRC bytes 330 for MP3. However, writing is delayed until decoder 120 decodes at least part of side information 340.
The side information for MP3 consists of 17 bytes for a single channel bit stream and 32 bytes otherwise. These bytes represent a main data begin (MDB) pointer, side information for both granules, side information for granule 0, and side information for granule 1. The main data is not necessarily next to the side information. The first nine bits of side information 340 provide the MDB pointer, which is a 9-bit pointer that indicates the location of the beginning byte of main data 350 belonging to the current frame. The location is specified as a negative offset from the first byte of the synchronization word. If the MDB pointer points before the start of the file, the data frame is invalid and does not need to be stored in flash memory array 150. However, data following a header of an invalid frame may be valid data for the next frame and is held in input buffer 110 pending identification of the next frame's header.
Decoder 120 can determine the frame length and other format information for a frame from the frame header 310 and side information 340. More specifically, the frame length depends on the values in bit rate field 315 and sampling frequency field 316 in frame header 310. Based on the frame length and the MDB pointer, data type identification logic 126 selects a writing mode or a number of bits per cell for each portion of the data frame 300. Multi-level write circuit 130 receives data values of the specified widths from the associated locations in data buffer 110 or shift register 122 and writes each data value in a memory cell in memory array 150.
A record operation for an MP3 file may need to handle data that precedes a valid header in a data stream. FIG. 5 illustrates a record operation for an MP3 file. Data input in step 510 is stored (step 520) while the data is searched for a synchronization pattern (step 530). In the initial storing step 520, data can be kept in input data buffer 110 and shifted through shift register 122 until PAL 124 finds a valid frame header. When the sync pattern is found, decoder 120 in step 540 checks to determine whether the following data represent a valid frame header. If a valid data frame header is found, decoder 120 can identify types for the data, and a data storage operation 550 stores the identified data using writing modes for the different data types. If a sync pattern does not correspond to a valid frame header, data inputting, buffering, and searching for the sync pattern continue in steps 510 and 530. Invalid data coming before the first valid header can be discarded. Additionally any valid pre-header information having a data type that cannot be determined until a following header is decoded can be written using the default resolution (i.e., the default number of bits per memory cell) to simplify the record and playback operations.
FIG. 6 illustrates an embodiment of store operation 550 that takes place when a valid header is found in an MP3 data stream. A decode operation 620 and a write operation 650 operate on a portion of the input data 610 corresponding to the header of a data frame. Decoding operation 620 separates fields 630 of the header for use in a calculation 640 of the sizes of the side information, the main data, and the ancillary data in the data frame. The header of an MP3 data frame has a fixed length so that decode operation 620 and store operation 650 process a fixed number of bits.
Store operation 650 begins with the first portion of input data 610 from data buffer 110 and stores the data in sequential memory cells in memory array 150. Store operation 650 uses a header rate HR, e.g., one bit per cell, for header information, which typically requires a low storage density for high reliability. A count of data written during store operation 650 determines when writing of the header is complete. An address counter (not shown) that controls where data is written can indicate the count.
When writing of the header is finished, a storage operation 660 for side information starts. The storage of side information uses a side information resolution rate SR required for side information, which typically requires a moderate storage density (e.g., two or three bits per cell) for reasonable reliability. The side information can tolerate a reasonable error rate without serious degradation of sound quality resulting when the MP3 data stream is read out and played. Storage operation 660 ends when a count of bits written during storage operation 660 matches the size calculated (step 640) for the side information.
When writing of the side information is finished, a storage operation 670 for main data and ancillary data starts. In this embodiment of the invention, the main and ancillary data are stored at the same storage density. In particular, the main and ancillary data can tolerate a small amount of error, and therefore storage operation 670 use a main rate MR for efficient, high-density storage (e.g., four bits per cell). Storage operation 670 ends when a count of data bits written during storage operation 670 matches the combination of the sizes calculated for the main and ancillary data.
The synchronization pattern of the next data frame should immediately follow the last main or ancillary data written. Accordingly, the recording operation can return to operation 530 of FIG. 5 to search for the synchronization pattern after store operation 550 stores a data fame.
FIG. 7 illustrates a read operation 700 in accordance with an embodiment of the invention. Read operation 700 reads a data frame that starts at an address (e.g., with a memory cell) identified either from directory indicating the starts of recorded data streams or as the address following a data frame just read.
An initial read operation 720 uses the default resolution that is appropriate for a header and reads consecutive memory cells beginning at the start of the recorded data stream. While reading at the default resolution, read operation 720 can read the header or other information, which can be output to data output buffer 180. Simultaneously, decoding identifies the synchronization field of the header and separates the header into fields 730 for use in a calculation 740 of the sizes of the side information, the main data, and the ancillary data. Additionally, for error detection and correction, a CRC calculation 750 can be performed. Following the synchronization field, read operation 720 reads a fixed number of memory cells depending on the number of bits stored per cell for header information and the fixed size of the header.
A read operation 760 reads consecutive memory cells to extract side information and accordingly reads from each memory cell the number of bits used per cell for side information. The number of memory cells read depends on the calculation 740 of the size of the side information. Side information resulting from read operation 760 is output to data output buffer 180.
When a count of the memory cells or data bits read reaches the size of the side information, the memory switches to a read mode for main and ancillary data. Accordingly, following read operation 760, a read operation 770 reads the main and ancillary data using a number of bits per cell used in storage of the main and ancillary data and output the data to output data buffer 180. Reading the main and ancillary data continues until a data count equals the calculated size of the main and ancillary data.
After reading the last portion of one data frame, a playback operation either ends or starts again with the read operation 720 at the default resolution for the next data frame in a data stream.
Although the invention has been described with reference to particular embodiments, the description is only an example of the invention's application and should not be taken as a limitation. For example, although the described embodiments of the invention include the capability to both record and playback data streams, alternative embodiments may be capable of only recording or playing back data streams. Various other adaptations and combinations of features of the embodiments disclosed are within the scope of the invention as defined by the following claims.