An addressing technique for providing simultaneous read modify and write operations with serpentine configured rams

Abstract: A technique is taught for accomplishing a read, modify and write operation of a memory (11, 12) in a processor (10) in a single cycle of the processor (10), where a cycle is understood as the time between successive loads of operands to the processor (10). A memory having two distinct portions (11, 12) of operands is provided wherein the single cycle operations are accomplished by virtually addressing the operands in a serpentine or smnae-like configuration. A decoder (20) is provided for efficiently controlling the concurrent reading and writing of operands and controlling the addressing of the memory (11,12).

Description: This invention relates generally to memory addressing, and more particularly, to processors using memory to read, modify and write operands. Background Art As digital processors advance in complexity, the use of limited internal memory is becoming increasingly popular as opposed to always having to communicate with memory external to the processor. In digital filtering, a need often exists to read an operand from memory, perform an operation on the operand and then write the modified operand back to the memory. Such an operation is very common in adaptive filters. With pipelined processor architectures, it is possible to execute many operations during a single processor machine cycle, where a cycle is typically defined as the time between successive inputting of data to an arithmetic unit (AU). Therefore, in order to read a first operand from memory, modify a second operand in an AU, and write a third operand back to the memory in a pipelined architecture has previously required at least two processor cycles. Two cycles are required in order to avoid a data collision in reading and writing data to the memory at the same time. Such systems which accomplish read, modify and write operations in a memory typically utilize virtual dual-port RAMs requiring processor wait states and port arbitration. A paper entitled "Performance Evaluation of Vector Accesses in Parallel Memories using a Skewed Storage Scheme" by D. T. Harper et al and published in the 13th Annual International Symposium on Computer Architecture, Tokyo, 2nd - 5th June 1986, pages 324-328, IEEE, Washington, US, describes a scheme for reducing the average memory access time in a vector processing architecture. The scheme uses data skewing to distribute vectors among the modules of a parallel memory system in such a way that for typical vector access patterns, the average number of memory conflicts is reduced. Brief Description of the Invention Accordingly, an object of the present invention is to provide an improved addressing technique for providing simultaneous read, modify and write operations in a memory. Another object of the present invention is to provide an improved RAM structure having serpentine addressing for accomplishing simultaneous read and write cycles of the RAM. Yet another object of the present invention is to provide an improved processor with memory having a pipelined architecture for executing read, modify and write operations in a single cycle. In carrying out the above and other objects of the present invention, there is provided, in one form, a method of addressing a memory to provide simultaneous read and write operations with the memory, said memory being partitioned into first and second portions which can be communicated with via first and second bidirectional data buses coupled thereto, each of said memory portions having an integer number of integer rank ordered physical and virtual address locations, the physical address locations of each memory portion being in a sequential order, said method being characterized by the steps of: assigning the rank ordered virtual address locations of the memory in a serpentine configuration between the two portions wherein after assigning a lowest ranked virtual address location in the lowest ranked physical address location of the first memory portion, pairs of successive virtual address locations are successively assigned to successive rank ordered pairs of physical address locations of alternating memory portions; and sequentially, alternatingly addressing two odd integer ranked or two even integer ranked virtual addresses for the purpose of substantially simultaneously writing to one of the two even or odd integer ranked virtual addresses and reading the other virtual address. In accordance with another form of the invention there is provided in a processor for reading, modifying and writing operands to a memory, a circuit for substantially simultaneously performing read and write operations with the memory, said circuit comprising said memory which is partitioned into first and second portions which are coupled to first and second bidirectional data buses, control means having first and second inputs coupled to the memory via the first and second bidirectional data buses and having an output, for selectively communicating operands of both memory portions, and an arithmetic unit coupled to the control means for selectively receiving operands from the memory, performing an arithmetic operation with the received operands, and coupling a modified operand back to the memory, said circuit being further characterized by: said memory having rank ordered virtual address locations correlated with rank ordered physical address locations assigned in a serpentine configuration between the two portions wherein a lowest ranked ordered virtual address location is assigned to a lowest ranked physical address location of the first memory portion and pairs of successive remaining virtual address locations are successively assigned to successively ranked pairs of ranked physical address locations of alternating memory portions; decoding means coupled to the memory and control means, for receiving a virtual address and providing control signals to the control means and memory for sequentially, alternatingly addressing two odd integer ranked or two even integer ranked virtual addresses for the purpose of substantially simultaneously writing to one of the two even or odd integer ranked virtual addresses and reading the other virtual address. These and other objects, features and advantages will be more clearly understood from the following detailed description taken in conjunction with the accompanying drawings. Brief Description of the Drawings FIG. 1 illustrates in block diagram form a processor utilizing the addressing technique of the present invention; FIG. 2 illustrates in schematic form an address decoder used to implement the present invention in the processor of FIG. 1; FIG. 3 illustrates in block diagram form the physical layout of the coefficient RAM portions of the processor of FIG. 1; and FIG. 4 illustrates in block diagram form an example of read, modify and write operations during consecutive cycles of the processor of FIG. 1. Detailed Description of the Invention Shown in FIG. 1 is a processor 10 for implementing an adaptive filter operation. Processor 10 generally comprises a random access memory (RAM) 11 labeled "Coefficient RAM A", a random access memory 12 labeled "Coefficient RAM B", a data RAM 13, a bus controller 16, an arithmetic unit 18 and an address decoder 20. Address decoder 20 has an input for receiving a virtual address and first and second outputs respectively connected to a pointer input of RAM 11 and RAM 12. Third and fourth outputs of address decoder 20 are connected to first and second control inputs of bus controller 16. An input/output of Ram 11 is connected to a first input/output of bus controller 16, and an input/output of RAM 12 is connected to a second input/output of bus controller 16. An output of bus controller 16 is connected to a first input of arithmetic unit 18. Data RAM 13 has a data pointer labeled "D pointer" connected to a control input and has an output connected to a second input of arithmetic unit 18. An output of arithmetic unit 18 is connected to a third control input of bus controller 16. In operation, processor 10 functions to selectively provide predetermined coefficient operands and stored data operands to arithmetic unit 18 for processing. A typical processing operation utilizing this structure is an adaptive filter operation. Adaptive filters are a unique class of filters which basically provide an output which represents a difference or error between a desired signal and an estimate of the desired signal. A common adaptive filter structure is based on a finite impulse response (FIR) filter structure. FIR filtering is based upon a conventional filtering equation which is an accumulation of products of predetermined coefficients representing the impulse response of the filter and a digitized input data waveform. The adaptive filter adapts the coefficients of the FIR filter using the conventional Least-Mean-Square (LMS) algorithm. An updated coefficient value is proportional to the sum of previous coefficient value and a scaled product of the calculated error multiplied by its associated data sample. After several iterations of data sample periods, the FIR filter coefficients converge to values which consistently minimize the mean square error which is the filter's output. Therefore, the coefficient values which are stored in memory are constantly being read, modified and written back to the memory. Processor 10 implements such an adaptive filtering operation by selectively coupling a predetermined coefficient operand from one of RAMs 11 and 12 and coupling a data operand from data RAM 13 to arithmetic unit 18 which implements the LMS algorithm. The "D" pointer controlling data RAM 13 is provided by a conventional microcontroller which is not shown. Bus controller 16 controls whether a coefficient from RAM 11 or RAM 12 is coupled to arithmetic unit 18. Arithmetic unit 18 provides an updated coefficient value which may be written back to either RAM 11 or RAM 12 via bus controller 16 which must avoid operand collisions on the bidirectional buses between controller 16 and RAMs 11 and 12. RAMs 11 and 12 should actually be considered as first and second portions of a single memory. It should be apparent that the present invention may be implemented either with a single memory having two segregated portions of memory or as two distinct memory devices. For purposes of illustration only, the memory is illustrated as two distinct circuits in the form of RAMs 11 and 12. During a single data processing cycle, a coefficient may be read from one of the memory portions comprising RAMs 11 and 12 while an updated coefficient is also being written to the other of RAMs 11 and 12. Simultaneously, arithmetic unit 18 may be modifying a previously fetched coefficient from memory. In this context, a single data processing cycle is defined as the time between successive loadings of operands to arithmetic unit 18. By virtue of the pipelined architecture of processor 10, the three operations just described (i.e. read, modify, write) may be processed simultaneously and the operation is a three level or three stack pipelined operation. Inherent in the present invention's ability to simultaneously read and write a memory while modifying a previously read operand is the ability to address the memory in a manner which permits simultaneous reading and writing without operand collisions. Shown in FIG. 2 is address decoder 20 of FIG. 1. An exclusive OR gate 26 has first and second inputs each coupled to an eight bit virtual address word illustrated by bits A₀ thru A₇ from least significant to most significant. Bits A₁ thru A₇ are each coupled to the inputs of RAMs 11 and 12 and represent a physical address location in RAMs 11 and 12. Only the least significant bit A₀ and next to least significant bit A₁ are coupled to the inputs of exclusive OR gate 26. An output of exclusive OR gate 26 provides a complement of a selected control signal for RAM 11 labeled "RAM A Select" which is coupled to bus controller 16. An input of an inverter 28 is connected to the output of exclusive OR gate 26. An output of inverter 28 provides a select control signal for RAM 12 labeled "RAM B Select". The operation of decoder 20 may be more readily understood when discussed in connection with the physical layout of RAMs A and B illustrated in FIG. 3. RAM A or RAM 11 is illustrated with horizontal rank ordered address locations and above RAM B or RAM 12. Each RAM is illustrated as having a rank ordered physical address beginning with physical address zero and continuing sequentially to the right. Further, inside RAMs A and B are located rank ordered virtual address locations which are oriented in a predetermined manner beginning with zero. As shown, RAM A (RAM 11) begins with virtual address zero and is adjacent to virtual address three. Continuing to the right are virtual addresses four, seven, eight and so forth. RAM B (RAM 12) begins with virtual address one which is adjacent virtual address two. Continuing to the right in RAM B are virtual addresses five, six, nine and so forth. Upon closer review it can be seen that a sequential order of the virtual addresses is positioned in the memory in a snake-like or serpentine fashion as shown by the curved line. The order of location of the virtual addresses is to initially alternate to the opposite memory (or memory portion) after the first virtual address and to locate two consecutive virtual memory addresses adjacent each other. The next virtual memory address is positioned by jumping to the opposite memory where two more consecutive virtual memory addresses are located. This order of virtual memory addresses is maintained until all virtual memory addresses are assigned. As a result of sequentially following the virtual addresses through the two segregated portions of memory, a serpentine pattern results. An example of the operation of processor 10 with the inventive memory addressing technique will be shown to illustrate how a read, modify, write operation of operands in the memory may be effected in a single cycle of the processor. Shown in FIG. 4 is a chart showing the operation of processor 10 on a cycle by cycle basis. Initially a read of logical address "0" occurs in the first cycle of operation. In the second cycle, the contents of logical address "0" are modified and the contents of logical address "1" are read. In the third cycle, logical address "0" is written with an operand resulting from the modify operation of cycle two, the contents of logical address "1" are modified and the contents of logical address "2" are read. A discussion of the fifth cycle of operation will illustrate how the memory may be both read and written to in the same cycle without incurring a collision of data. In the fifth cycle, virtual address four is being read and virtual address two is being written. The eight LSBs of the binary number representing virtual address "four" which is coupled to the input of address decoder 20 is 00000100. The output of exclusive OR gate 26 is a logic zero since both inputs are logic zero. Therefore, RAM A or RAM 11 is selected to read virtual address "four" from. Now that bus controller 16 knows which portion of memory to couple to arithmetic unit 18, the correct physical address of RAM 11 must be addressed by decoder 20. The physical address is chosen by decoder 20 as the seven most significant bits of the virtual address Therefore, the physical address is 0000010 which is equivalent to two. By referring to FIG. 3, it can be readily verified that in RAM A at physical address two, virtual address "four" is stored. In this way decoder 20 functions to read virtual address "four" from memory. Simultaneously in cycle five, virtual address "two" is being written. As can be quickly seen from the physical location of virtual address "two" in RAM B, a bus conflict will not exist since the same memory portion is not being accessed for a simultaneous read and write operation. Shortly after receiving the virtual address "four" and providing the proper decoded output, decoder 20 also receives virtual address "two" as an eight bit word 00000010. When the two least significant bits are exclusive ORed by gate 26, a logic one output results which causes RAM 12 (i.e. RAM B) to be selected by controller 16 to be written to. The actual physical address which is written in RAM 12 is also decoded by decoder 20 as being all bits of the eight bit virtual address except the least significant bit. Therefore, the physical address is "one". Referring to FIG. 3 it can be seen that virtual address "two" is located at physical address "one" as it is supposed to be. Therefore, the correct operand will be read to the correct memory location in RAM 12. By using the serpentine virtual addressing in two separate memory portions, each of which may be communicated with via a separate bidirectional data bus, the reading and writing of data into memory in a processor during a single cycle may be accomplished. The present invention successfully uses serpentine configured addressing in connection with the specific decoding scheme taught in FIG 2. By discarding the least significant of the bits of the virtual address bits, a correct physical address always exists. It should again be pointed out that two distinct RAM circuits are not required to implement the invention but rather only two distinct portions of a memory arranged in a manner as shown in FIG. 3. By now it should be apparent that an addressing technique in a memory is provided which allows read, modify and write operations during a single cycle of operation in a processor. The present invention makes use of a pipelined processor architecture which permits multiple machine functions to occur simultaneously. Although the present invention has been presented in the context of a processor being used in a filtering application, it should be apparent that the technique taught herein is applicable to any processing which utilizes a read, modify and write operation of a memory or storage device. Further, the present invention is not restricted to only RAM type memory devices but may be implemented with other types of memory. While an embodiment has been disclosed using certain assumed parameters, it should be understood that certain obvious modifications to the circuit or the given parameters will become apparent to those skilled in the art, and the scope of the invention should be limited only by the scope of the claims appended hereto.

Claims: A method of addressing a memory to provide simultaneous read and write operations with the memory, said memory being partitioned into first and second portions (RAM A, RAM B) which can be communicated with via first and second bidirectional data buses coupled thereto, each of said memory portions (RAM A, RAM B) having an integer number of integer rank ordered physical and virtual address locations, the physical address locations of each memory portion being in a sequential order, said method being characterized by the steps of: assigning the rank ordered virtual address locations of the memory in a serpentine configuration between the two portions (RAM A, RAM B) wherein after assigning a lowest ranked virtual address location (0) in the lowest ranked physical address location (0) of the first memory portion (RAM A), pairs (1,2; 3,4; 5,6; ...) of successive virtual address locations are successively assigned to successive rank ordered pairs of physical address locations of alternating memory portions; and sequentially, alternatingly addressing two odd integer ranked or two even integer ranked virtual addresses for the purpose of substantially simultaneously writing to one of the two even or odd integer ranked virtual addresses and reading the other virtual address. In a processor for reading, modifying and writing operands to a memory, a circuit (10) for substantially simultaneously performing read and write operations with the memory, said circuit comprising said memory which is partitioned into first and second portions (RAM A, RAM B) which are coupled to first and second bidirectional data buses, control means (16) having first and second inputs coupled to the memory via the first and second bidirectional data buses and having an output, for selectively communicating operands of both memory portions (RAM A, RAM B), and an arithmetic unit (18) coupled to the control means (16) for selectively receiving operands from the memory, performing an arithmetic operation with the received operands, and coupling a modified operand back to the memory, said circuit being further characterized by: said memory having rank ordered virtual address locations correlated with rank ordered physical address locations assigned in a serpentine configuration between the two portions (RAM A, RAM B) wherein a lowest ranked ordered virtual address location (0) is assigned to a lowest ranked physical address location (0) of the first memory portion (RAM A) and pairs (1,2; 3,4; 5,6; ...) of successive remaining virtual address locations are successively assigned to successively ranked pairs of ranked physical address locations of alternating memory portions; decoding means (20) coupled to the memory and control means (16), for receiving a virtual address and providing control signals to the control means and memory for sequentially, alternatingly addressing two odd integer ranked or two even integer ranked virtual addresses for the purpose of substantially simultaneously writing to one of the two even or odd integer ranked virtual addresses and reading the other virtual address.

Inventors: GERGEN JOSEPH P, THOMPSON CHARLES D, GERGEN, JOSEPH P., THOMPSON, CHARLES D.
Applicants: MOTOROLA INC, MOTOROLA INC.
Application year: 1987
Main classification: G06F12
IPC codes: G06F12, G06F9