Data memory system and operating method

Abstract: An arrangement for operating a data processing system memory effects the overwriting of a first data word in the memory (12) by a second data word, wherein each addressable location in the memory (12) holds an addressable data element (14) having N data words. The data element (14) which includes the first data word is read from the memory (12) into a first cache register (18), and a second data word is simultaneously written into a second cache register (22). The second data word is then written into the main memory (12) along with all of the words of the data element in the first cache register (18) except for the first word.

Description: This invention relates to a data processing system incorporating a memory, and to a method for operating a memory included in a data processing system. Memories used in data processing systems are accessed for both read and write operations. Every data element stored in memory has a unique address associated therewith. The size or length of the addressable data element may vary from a single bit (bit addressable) to multiple bytes. In bit addressable memories, any single bit may be read from and/or written into the memory. However, for most memory systems one or more bytes are stored at each address and are accessed for each read/write operation. Data elements accessed are not always of a length which is consistent with the performance of various other devices and operations within the data processing system. For example, data variables and data instructions may encompass several adjacent memory locations or, alternatively, may require fewer bits than in a full data element. Another example involves the accessing of a memory where the number of bits on a bus is less than the data element length. A data bus might be one byte (eight bits) wide, whereas the data element in the memory might be four bytes (thirty-two bits) wide. US 3 781 812 A discloses a memory system wherein one or more 1-bit words stored in a common memory location may be modified by a read, a modify and a restore operation being performed in a sequence, thus enabling part of a multi-word data element in memory to be overwritten. It is the object of the present invention to provide a data processing system and method wherein a data word in a memory having addressable data elements of more than a word may be overwritten at a high speed. Therefore, according to one aspect of the present invention, there is provided a data processing system including a memory adapted to store data elements, each data element having a unique address and including N data words, a first cache register connected to said memory and adapted to receive from said memory a single data element to be modified, a second cache register adapted to receive one or more data words to replace corresponding data words in said single data element, and transfer control means adapted to control the transfer to said memory of said data words from said second cache register together with non-corresponding data words from said first cache register, characterized in that said second cache register receives the first of said replacement data words simultaneously with said first cache register receiving said single data element from memory and in that each cell in said second cache register includes a flag bit adapted to identify the presence of a replacement data word in the associated cell. According to another aspect of the present invention, there is provided a method for operating a memory included in a data processing system wherein said memory is adapted to store in each addressable location thereof a data element having N data words, said method comprising the steps of: (a) reading a data element including a first data word from said memory into a first cache register; (b) writing a second data word into a second cache register which is adapted to store one or more data words to replace corresponding data words in said data element; and (c) writing into said memory said second data word along with all of the words of said data element in said first cache register except for said first word, characterized by step (b) being performed simultaneously with step (a) and by the step of, simultaneously with steps (a) and (b), setting a flag bit in said second cache register associated with said second data word. Embodiments of the present invention will now be described by way of example with reference to the accompanying drawing, in which the sole Figure illustrates a high speed memory system included in a data processing system. Referring to the Figure, there is shown a memory system 10 for a data processing system. A memory 12 stores data elements 14. For purposes of the invention, memory 12 could be a cache memory or slower main memory. Each data element 14 has a unique address and consists of N data words. The term "data word" as used herein is intended to encompass one or more data bits, the number of bits in the word being less than the number of bits in a data element. Addressing of a specific data element 14 in memory 12 is provided by means of address bus 16. A cache register 18 for holding a single data element 14 is connected to memory 12 by N conduction lines 20. Cache register 18 has N storage cells, labeled 1, 2, ... , N. Each cell stores respective words of a data element 14. Each cell in register 18 has a location therein which corresponds to the relative position of data words of element 14 as stored in memory 12. Restated, there is a one-to-one correspondence between data words 1, 2, ... , N of each data element 14 stored in memory 12 and data cells 1, 2, ... , N in cache register 18. The number of physical conductors in each line 20 depends on the number of bits in each data word of data element 14. For example, if each word consists of just one bit, each conduction line 20 will include one conductor. If each word consists of one byte (eight bits), each conduction line 20 will have at least eight conductors. A cache register 22 is connected in parallel with register 18. Cache register 22 has N storage cells, labeled 1, 2, ... , N, for storing data words. Each cell corresponds to a respective cell in register 18. N conduction lines 24 connect register 22 with respective ones of conduction lines 20. Each conduction line 24 will have the same number of physical conductors as respective conduction lines 20. In a preferred embodiment, each storage cell in registers 18 and 22 includes the same number of data bits. A multiplexer 26 conveys data words to and from memory 12. Multiplexer 26 is located between a data bus 28 and cache registers 18 and 22. N conduction lines 30 connect multiplexer 26 with register 22. Another N conduction lines 32 connect register 18 with respective ones of conduction lines 30. Each conduction line 30 and 32 will have enough conductors to handle the number of data bits in a data word. Although the invention will work with a data bus 28 of any number of conductors, it is particularly adapted in a preferred embodiment to work with a data bus 28 of a single data word wide. Control lines 34 and 36 are connected to each register 18 and 22, respectively. These will carry control signals to enable the output of specific cells in each register by selecting and activating conduction lines. Each cell in cache register 22 includes a flag bit which indicates the presence of a data word in that particular cell. As will be discussed more fully hereinafter, control line 36 responds to the presence of a flag bit to enable the output of that cell. Control line 34 responds to the presence of flag bits in register 22 by enabling the output of the noncorresponding cells in register 18. In order to keep track of the address of the data element in register 18, a latch 38 and comparator 40 are provided. Latch 38 is connected between address bus 16 and memory 12. In a preferred embodiment latch 38 includes a plurality of clocked flip-flops, one for each line in address bus 16. A control signal, for clocking in an address on bus 16, is received at the CK inputs to the flip-flops from a control line 42. Comparator 40 receives the address stored in latch 38 and the address on bus 16 and provides an output control signal indicating whether or not there is a correspondence between the addresses. In operation, the subject invention allows individual data words in memory 12 to be overwritten with data words received from data bus 28 with minimum delays. In brief, when a data word (hereinafter referred to as the second data word) is to be written into memory 12, the data element 14 which includes the data word to be overwritten (hereinafter referred to as the first data word) is read from memory 12 into cache register 18. At the same time, the second data word is written from data bus 28 into cache register 22. The second data word will be directed to the cell in register 22 that corresponds to the cell in register 18 receiving the first data word. By simultaneously reading data element 14 into register 18 with the writing of the second data word into register 22, the "read latency" inherent in prior art read/modify/write memory systems is eliminated. A single write operation to memory 12 may then be performed by writing the second data word from register 22 along with all of the words of the data element in register 18 save the first data word. In other words, the data element is modified by the substitution of one data word for another. Consecutive data words written into memory 12 are frequently located at adjacent memory locations. For example, if a second data word is to overwrite data word 1 in data element 14, it is likely that the next data word will overwrite data word 2 in element 14. Thus, according to one form of the present invention, the data element in register 18 with replacement data word in register 22 is not immediately written back to memory 12 after the second data word is written into register 22. Rather, the system must wait until a next data word is to be written into memory 12. At such time, cache register 18 is first checked for the presence of the data element to be modified. More specifically, register 18 is checked for the data element having a first data word corresponding to (having the same address as) the next data word. Data register 18 is checked by means of comparator 40. When the address of the next data word to be written into memory 12 is placed on address bus 16, it is compared with the address stored in latch 38 (the address of the data element currently in register 18). If it is determined that the desired data element is already in register 18 by the indication of a "hit", a control signal on line 36 will be sent to register 22 to enable the next data word to be written into register 22. For each succeeding word to be written to memory, register 18 is first checked by means of comparator 40 to determine the presence of the data element to be modified. Since it frequently happens that sequentially presented data words will be stored in adjacent locations in memory, many write and read operations with respect to memory 12 are thereby eliminated. Comparator 40 will indicate when the address on bus 16 and in latch 38 are not the same. At such time, since the correct data element is not in register 18, any second data words in register 22 must now be written into memory 12. As noted previously, each cell in register 22 has a flag bit associated therewith which is set when a word is written to it. These flag bits are checked, and the corresponding conduction line 24 is enabled for any cell having such a flag. At the same time the conduction lines 20 for the noncorresponding words in register 18 are enabled. In this manner the data element in register 18 is written back into memory 12 save for the overwriting of second data words. Cache register 22 is reset after the write operation to prepare it for receiving the next data word. As soon as any second data words in register 22 have been written to memory 12, latch 38 is enabled to-store therein the address which is on bus 16. Memory 12 is then addressed and the data element having the correct data word corresponding to the next data word to be written into memory 12 is transferred to register 18. Simultaneously therewith the next second data word is written into register 22. The process can be repeated for subsequently presented second data words. As long as register 18 contains the correct data element, the second data word is written directly into register 22. When the correct data element is not in register 18, the contents of register 22 together with noncorresponding words in register 18 are written to memory 12 and the correct data element is fetched. An embodiment of the subject invention may also be adapted to allow read operations from memory 12 to occur. As with the previously described read/modify/write operation, cache register 18 is first checked by means of comparator 40 for the presence of the data element to be read. If the data element is there, registers 18 and 22 are simultaneously read, with flag bits in register 22 indicating those conduction lines 30 and 32 to be enabled. If the data element is not in register 18, a register flush must occur with data words in register 22 and noncorresponding words in register 18 being written to memory 12. This write will be followed by a memory read with the data element being latched by register 18 on its way to data bus 28.

Claims: A data processing system including a memory (12) adapted to store data elements (14), each data element (14) having a unique address and including N data words, a first cache register (18) connected to said memory (12) and adapted to receive from said memory (12) a single data element (14) to be modified, a second cache register (22) adapted to receive one or more data words to replace corresponding data words in said single data element (14), and transfer control means (34,36) adapted to control the transfer to said memory (12) of said data words from said second cache register (22) together with non-corresponding data words from said first cache register (18), characterized in that said second cache register receives the first of said replacement data words simultaneously with said first cache register receiving said single data element from memory and in that each cell in said second cache register (22) includes a flag bit adapted to identify the presence of a replacement data word in the associated cell. A data processing system according to claim 1, characterized in that said first cache register (18) has N storage cells adapted to store respective words of a data element (14), and said second cache register (22) has N storage cells, corresponding to respective cells of said first cache register (18) and each capable of storing a replacement word. A data processing system according to either claim 1 or claim 2, characterized by a plurality of first conduction lines (20) connecting said memory (12) with said first cache register (18) and a plurality of second conduction lines (24) connecting said second cache register (22) with respective ones of said first conduction lines (20), and in that said transfer control means (34,36) is effective to cause the selection and activation of second conduction lines (24) corresponding to set flag bits and the activation of non-corresponding first conduction lines (20). A data processing system according to claim 3, characterized by a plurality of third conduction lines (30) connecting said second cache register (22) with a data bus (28) of said data processing system, and a plurality of fourth conduction lines (32) connecting said first cache register (18) with respective ones of said third conduction lines (30). A data processing system according to claim 4, characterized by a multiplexer (26) disposed between said data bus (28) and said third conduction lines (30). A method for operating a memory (12) included in a data processing system wherein said memory (12) is adapted to store in each addressable location thereof a data element (14) having N data words, said method comprising the steps of: (a) reading a data element (14) including first data word from said memory (12) into a first cache register (18); (b) writing a second data word into a second cache register (22) which is adapted to store one or more data words to replace corresponding data words in said data element; and (c) writing into said memory (12) said second data word along with all of the words of said data element (14) in said first cache register (18) except for said first word, characterized by step (b) being performed simultaneously with step (a) and by the step of, simultaneously with steps (a) and (b), setting a flag bit in said second cache register (22) associated with said second data word.

Inventors: CURRY JAMES C JR, CURRY, JAMES C., JR.
Applicants: NCR INT INC, NCR INTERNATIONAL, INC.
Application year: 1990
Main classification: G06F12
IPC codes: G06F12