This Application claims priority to Chinese Patent Application Number 201110325418.6; filed on Oct. 24, 2011 with State Intellectual Property Office of P.R. China (SIPO), which is hereby incorporated by reference.
The present teaching relates to memories, and more particularly to a dual-port memory and a method thereof.
Memories may be classified into single-port memories and dual-port memories according to the way in which data is accessed, Compared with single-port memories, dual-port memories can read and write data at a high speed as they have separate read and write control circuits, and thus, are widely used in computer related fields. For example, dual-port memories, such as a dual-port random access memory (RAM) and a first input first output (FIFO), can be used for communication between a host and an external device and for communication among the hosts. However, as dual-port memories have separate read and write control circuits, they occupy relatively large die sizes, thereby increasing the manufacturing costs of circuit components having those dual-port memories.
As shown in
The present teaching relates to memories, and more particularly to a dual-port memory and a method thereof.
In one example, a dual-port memory including a first single-port memory and a second single-port memory is provided. The first single-port memory is configured to store data in an even address of the dual-port memory. The second single-port memory is configured to store data in an odd address of the dual-port memory. The dual-port memory simultaneously performs a read operation to read data from the odd address and a write operation to write data into the even address. The dual-port memory simultaneously performs a read operation to read data from the even address and a write operation to write data into the odd address simultaneously.
In another example, a method of utilizing a dual-port memory is provided. Data at an even address of a dual-port memory is stored into a first single-port memory. Data at an odd address of the dual-port memory is stored into a second single-port memory. The first single-port memory and the second single-port memory are enabled by a first pair of multiplexers. A write enable signal is provided to a selected single-port memory of the first single-port memory and the second single-port memory by a second pair of multiplexers to enable the selected single-port memory to perform a write operation. A write address is provided to the selected single-port memory by a third pair of multiplexers to enable the selected single-port memory to write data into the write address.
Features and advantages of embodiments of the claimed subject matter will become apparent as the following detailed description proceeds, and upon reference to the drawings, wherein like numerals depict like parts. These exemplary embodiments are described in detail with reference to the drawings. These embodiments are non-limiting exemplary embodiments, in which like reference numerals represent similar structures throughout the several views of the drawings,
Reference will now be made in detail to the embodiments of the present teaching. While the present teaching will be described in conjunction with these embodiments, it will be understood that they are not intended to limit the present teaching to these embodiments. On the contrary, the present teaching is intended to cover alternatives, modifications and equivalents, which may be included within the spirit and scope of the present teaching as defined by the appended claims.
Furthermore, in the following detailed description of the present teaching, numerous specific details are set forth in order to provide a thorough understanding of the present teaching. However, it will be recognized by one of ordinary skill in the art that the present teaching may be practiced without these specific details. In other instances, well known methods, procedures, components, and circuits have not been described in detail as not to unnecessarily obscure aspects of the present teaching.
In this example, the addresses of the dual-port memory 200 are classified into even addresses and odd addresses. The even address single-port memory 202 stores data at the even addresses, and the odd address single-port memory 201 stores data at the odd addresses, In operation, when the data at an even address of the dual-port memory 200 is to be read, the even address single-port memory 202 receives the even address via the multiplexer 212 and performs the read operation to read data at the even address and simultaneously, the odd address single-port memory 201 receives an odd address of the dual-port memory 200 via the multiplexer 213 and performs the write operation to write data at the odd address. On the other hand, when the data at an odd address of the dual-port memory 200 is to be read, the odd address single-port memory 201 receives the odd address via the multiplexer 213 and performs the read operation to read data at the odd address, and simultaneously, the even address single-port memory 202 receives an even address of the dual-port memory 200 via the multiplexer 212 and performs the write operation to write data at the even address.
The total size of the even address single-port memory 202 and the odd address single-port memory 201 is smaller than the size of the prior art dual-port memory, and thus, the cost of manufacturing the dual-port memory is decreased.
The dual-port memory 200 in this example includes multiple terminals, for example, a clock signal terminal CLK, a read operation enable signal terminal CENA, a read operation address input terminal AA, a write operation enable signal terminal CENB, a write operation address input terminal AB, a write operation data input terminal DB, and a data output terminal QA. Each of the single-port memories 301 and 302 includes multiple terminals which will be illustrated in detail in combination with
Referring to
The dual-port memory 200 in this example includes a first pair of multiplexers 310 configured to provide an enable signal to the chip enable signal terminal CEN_EVEN of the even address single-port memory 302 and the chip enable signal terminal CEN_ODD of the odd address single-port memory 301 by selecting an external read operation enable signal R_EN or an external write operation enable signal W_EN of the dual-port memory 200.
In this example, the first pair of multiplexers 310 include a first multiplexer 304 and a second multiplexer 303. An input terminal A of the first multiplexer 304 is coupled to the read operation enable signal terminal CENA to receive the external read operation enable signal R_EN, and another input terminal B of the first multiplexer 304 is coupled to the write operation enable signal terminal CENB to receive the external write operation enable signal W_EN, The selection signal of the first multiplexer 304 will be described below in combination with
In this example, the dual-port memory 200 further includes a second pair of multiplexers 320 configured to provide a write enable signal to the write enable signal terminal WEN_EVEN of the even address single-port memory 302 and the write enable signal terminal WEN_ODD of the odd address single-port memory 301 by selecting the external write operation enable signal W_EN and a signal mask, for example, digital one.
In this example, the second pair of multiplexers 320 include a third multiplexer 306 and a fourth multiplexer 305. An input terminal A of the third multiplexer 306 receives the signal mask (digital one), and another input terminal B of the third multiplexer 305 is coupled to the write operation enable signal terminal CENB to receive the external write operation enable signal W_EN. The selection signal of the third multiplexer 306 will be described below in combination with
Therefore, for each single-port memory, when performing write operation, the corresponding write enable signal terminal is enabled by receiving the external write operation enable signal W_EN via the corresponding multiplexer. Otherwise, the corresponding write enable signal terminal is disabled by the signal mask (digital one).
In this example, the dual-port memory 200 further includes a third pair of multiplexers 330 configured to provide a read/write address to the even address single-port memory 302 and the odd address single-port memory 301 based on an external read address ADDAA or an external write address ADDAB.
In this example, the third pair of multiplexers 310 include a fifth multiplexer 308 and a sixth multiplexer 307. An input terminal A of the fifth multiplexer 308 is coupled to the read operation address input terminal AA to receive a first address (ADDAA/2) which is the quotient of the external read address ADDAA divided by two, and another input terminal B of the fifth multiplexer 308 is coupled to the write operation address input terminal AB to receive a second address (ADDAB/2) which is the quotient of the external write address ADDAB divided by two. The selection signal of the fifth multiplexer 308 will be described below in combination with
Therefore, for each single-port memory, when performing read operation, the corresponding read/write address input terminal receives the first address (ADDAA/2) which is the quotient of the external read address divided by two via the third pair of the multiplexers 330. When performing write operation, the corresponding read/write address input terminal A receives the second address (ADDAB/2) which is the quotient of the external write address divided by two via the third pair of the multiplexers 330.
In this example, the dual-port memory 200 further includes an output multiplexer 309 coupled to the data output terminals Q_EVEN and Q_ODD of the even address single-port memory 302 and the odd address single-port memory 301, The output multiplexer 309 is configured to output data read from the even address single-port memory 302 and the odd address single-port memory 301. The selection signal of the output multiplexer 309 will be described below in combination with
In this example, an input terminal A of the output multiplexer 309 is coupled to the even address single-port memory 302 and another input terminal B is coupled to the odd address single-port memory 301, and the data output terminal QA outputs the data read from the even address single-port memory 302 and the odd address single-port memory 301 When the even address single-port memory 302 performs a read operation, the output multiplexer 309 selects data at the data output terminal Q_EVEN and outputs the data via the data output terminal OA. When the odd address single-port memory 301 performs a read operation, the output multiplexer 309 selects data at the data output terminal Q_ODD of the odd address single-port memory 301 and outputs the data via the data output terminal QA.
In this example, the selection signals of the foregoing multiplexers 303-308 are determined by the parity of the external read address ADDAA and the external write address ADDAB. For example, the selection signals may be determined by a logical operation on the least significant bit (LSB) of the external read address ADDAA and the least significant bit (LSB) of the external write address ADDAB. In one embodiment, if the selection signal is in a first state, for example, logic high, the signal at the terminal B of a multiplexer is selected; if the selection signal is in a second state, for example, logic low, the signal at the terminal A of a multiplexer is selected.
In one embodiment, when the read operation and the write operation are performed simultaneously, the selection signals in each pair of the multiplexers are opposite to each other. For example, when writing data into the even address and reading data from the odd address, the selection signal of the first multiplexer 304 is in a first state, for example, logic high, and thus, the external write operation enable signal W_EN at the input terminal B of the multiplexer 304 is selected and output to the terminal CEN_EVEN to enable the even address single-port memory 302. Simultaneously, the selection signal of the second multiplexer 303 is in a second state, for example, logic low, and thus, the external read operation enable signal R_EN at the input terminal A of the second multiplexer 303 is selected and output to the terminal CEN_ODD to enable the odd address single-port memory 301.
Similarly, the second selection signal generating circuit 410 includes an OR gate 413 configured to receive the external read operation enable signal R_EN and the least significant bit (ADDAA[0]) of the external read address ADDAA, an OR gate 415 configured to receive the external write operation enable signal W_EN and the least significant bit (ADDAB[0]) of the external write address ADDAB, and an AND gate 411 configured to receive outputs of the OR gates 413 and 415 and provide an output signal as the selection signal to the second multiplexer 303.
The selection signal of the output multiplexer 309 may be determined by the parity of the external read address ADDAA.
For example, if the external read address ADDAA is odd, for example, [00000011], the least significant bit ADDAA[0] is 1, and the selection signal of the multiplexer 309 is digital one, then the data at the terminal B of the multiplexer 309 is selected, and, the data read from the odd address single-port memory 301 is output via the terminal QA. If the external read address is even, for example, [00000010], the least significant bit ADDAA[0] is 0, and the selection signal of the multiplexer 309 is zero, then the data at the terminal A of the multiplexer 309 is selected, and, the data read from the even address single-port memory 302 is output via the terminal QA.
As shown in
In one embodiment, when the external read operation enable signal R_EN becomes low, the external write operation signal W_EN becomes high, and the address input via the terminal AA is even, the even address single-port memory 302 in the dual-port memory 200 is enabled and performs the read operation on the even address of the dual-port memory 200.
As shown in the example of
Referring to the selection signal generating circuit 410 in
At time T0, the external write address ADDAB at the write operation address input terminal AB is invalid, and the external write operation enable signal W_EN at the write operation enable signal terminal CENB is high. According to the example shown in
Referring to
The output multiplexer 309 outputs the data read from the even address of the dual-port memory 200 in accordance with the selection signal provided by the DFF 472. Referring to
Similarly, a read operation may also be performed on the odd address of the dual-port memory 200. The read operation performed on the odd address of the dual-port memory 200 is similar to the read operation performed on the even address and will not be repetitively described for purposes of brevity and clarity.
In one embodiment, when the write operation enable signal W_EN becomes low, the read operation signal R_EN becomes high, and the address input via the terminal AB is odd, the odd address single-port memory 301 in the dual-port memory 200 is enabled and performs the write operation on the odd address of the dual-port memory 200.
As shown in the example of
Referring to the selection signal generating circuit 420 in
At time T2, the external write address ADDAB at the write operation address input terminal AB is input. As the address ADDAB is odd, the least significant bit ADDAB[0] is digital one. Therefore, the selection signal of the multiplexer 305 becomes high, and the external write operation enable signal W_EN (which is low) at the terminal B of the multiplexer 305 is selected and sent to the write enable signal terminal WEN_ODD of the odd memory single-port memory 301 to enable write operation of the odd memory single-port memory 301.
In the example of
Similarly, a write operation may also be performed on the even address of the dual-port memory 200. The write operation performed on the even address of the dual-port memory 200 is similar to the write operation performed on the odd address and will not be repetitively described for purposes of brevity and clarity.
In one embodiment, the dual-port memory 200 may perform a read operation on an address and a write operation on another address with opposite parity simultaneously. That is, the read operation address and the write operation address have different parities. In one embodiment, when both of the external read operation enable signal R_EN and the write operation enable signal W_EN are low, the external write address ADDAB at the write operation address input terminal AB is even, and the external read address ADDAA at the read operation address input terminal AA is odd, then the write operation is performed on the even address of the dual-port memory 200, and the read operation is performed on the odd address of the dual-port memory 200.
As shown in
Referring to the selection signal generating circuit 410 in
Referring to
As shown in
The output of the AND gate 451 in
The output multiplexer 309 outputs the data read from the odd address of the dual-port memory 200 in accordance with the selection signal provided by the OFF 472. Referring to
Similarly, the write operation can also be performed on the odd address of the dual-port memory 200 and read operation can be performed on the even address of the dual-port memory 200 simultaneously, The operations are similar to that described above, and will not be repetitively described for purposes of brevity and clarity
In step 601, data at the even addresses of the dual-port memory 200 is stored in an even address single-port memory 302, In step 602, data at the odd addresses of the dual-port memory 200 is stored in an odd address single-port memory 301. In one embodiment, the clock signal terminal CLK of the dual-port memory 200 is coupled to the clock signal terminal CLK_EVEN of the even address single-port memory 302 and the clock signal terminal CLK_ODD of the odd address single-port memory 301 The write operation data input terminal DB of the dual-port memory 200 is coupled to the write data input terminal D_EVEN of the even address single-port memory 302 and the write data input terminal D_ODD of the odd address single-port memory 301.
In this example, the external terminals of the dual-port memory 200 are coupled to the terminals of the even address single-port memory 302 and the odd address single-port memory 301 via multiple pairs of multiplexers. In step 603, a first pair of multiplexer 310 provides an enable signal to the even address single-port memory 302 and the odd address single-port memory 301. For example, the first pair of multiplexer 310 include a first multiplexer 304 and a second multiplexer 303 coupled to the chip enable signal terminals (CEN_EVEN and CEN_ODD) of the even address single-port memory 302 and the odd address single-port memory 301, respectively, and provide a chip enable signal to the even address single-port memory 302 and the odd address single-port memory 301 by selecting an external read operation enable signal R_EN or an external write operation enable signal W_EN of the dual-port memory 200.
In step 604, a second pair of multiplexer 320 provides a write operation enable signal to a selected single-port memory of the even address single-port memory 302 and the odd address single-port memory 301. For example, the second pair of multiplexer 320 include a third multiplexer 306 and a fourth multiplexer 305 coupled to the write operation enable signal terminals (WEN_EVEN and WEN_ODD) of the even address single-port memory 302 and the odd address single-port memory 301 and provide a write enable signal by selecting an external write operation enable signal W_EN and a signal mask, for example, digital one.
In step 605, a third pair of multiplexer 330 provides a write address to the selected single-port memory performing the write operation to enable the selected single-port memory to write data into the write address. For example, the third pair of multiplexer 320 includes a fifth multiplexer 308 and a sixth multiplexer 307 coupled to the read/write address input terminals (A_EVEN and A_ODD) of the even address single-port memory 302 and the odd address single-port memory 301 and provide the write address based on an external read address ADDAA or an external write address ADDAB.
In one embodiment, the third pair of the multiplexers 330 receives a first address (ADDAA/2) which is the quotient of the external read address ADDAA divided by two (that is, the external read address ADDAA shifted right by one bit) and a second address (ADDAB/2) which is the quotient of the external write address ADDAB divided by two (that is, the external write address ADDAB shifted right by one bit) and provides the second address as the write address to the selected single-port memory.
Moreover, the third pair of the multiplexers 330 provides the first address with a parity opposite to the second address as the read address to the other single-port memory to enable the other single-port memory to perform read operation. Therefore, the dual-port memory 200 may simultaneously perform the read operation on an address and the write operation on another address with parities opposite to each other. That is, the odd address single-port memory 301 performs the write operation on an odd address of the dual-port memory 200, and the even address single-port memory 302 performs the read operation on the even address of the dual-port memory simultaneously, or the odd address single-port memory 301 performs the read operation on an odd address of the dual-port memory 200, and the even address single-port memory 302 performs the write operation on the even address of the dual-port memory simultaneously.
In one embodiment, the data read from the even address single-port memory 302 or the odd address single-port memory 301 is output by an output multiplexer 309 during a next clock cycle. The selection signal of the output multiplexer 309 is determined by the parity of the external read address ADDAA.
The selection signals of the multiplexers 303-308 may be determined by the parities of the external read address ADDAA and the external write address ADDAB. For example, the selection signals can be determined by a logical operation on the least significant bit (LSB) of the external read address ADDAA and the least significant bit (LSB) of the external write address ADDAB. In one embodiment, when the read operation and the write operation are performed simultaneously, the selection signals in each pair of the multiplexers are opposite to each other.
It should be understood that the foregoing multiplexers 303-308 may be implemented by multiple specific electronic devices such as AND gates, OR gates, independent multiplexers, or other suitable electronic devices.
By using two single-port memories, the dual-port memory of the present teaching can write data into an even address while reading data from an odd address and write data into an odd address while reading data from an even address. Moreover, by using the dual-port memory of the present teaching which has the same capacity and access speed with the conventional dual-port memory, the functions of the conventional dual-port memory are achieved, while the die size is reduced,
It will be understood that the foregoing disclosure is illustrative. The present teaching is not limited to the foregoing illustration. One of ordinary skill in the art should understand that various variations and modifications may be made therein without departing from the spirit and scope of the claims of the present teaching.
Number | Date | Country | Kind |
---|---|---|---|
201110325418.6 | Oct 2011 | CN | national |