Computer Organization | Read and Write operations in memory



A memory unit stores binary information in groups of bits called words. Data input lines provide the information to be stored into the memory, Data output lines carry the information out from the memory. The control lines Read and write specifies the direction of transfer of data. Basically, in the memory organization, there are  2^{l} memory locations indexing from 0 to  2^{l}-1 where l is the address buses. We can describe the memory in terms of the bytes using the following formula:

N = 2^{l} Bytes
Where,
l is the total address buses
N is the memory in bytes

For example, some storage can be described below in terms of bytes using the above formula:

 1kB= 2^10 Bytes
 64 kB = 2^6 x 2^10 Bytes
       = 2^16 Bytes
 4 GB = 2^2 x 2^10(kB) x 2^10(MB) x 2^10(GB)
      = 2^32 Bytes

Memory Address Register (MAR) is the address register which is used to store the address of the memory location where the operation is being performed Memory Data Register (MDR) is the data register which is used to store the data on which the operation is being performed.

  1. Memory Read Operation:
    Memory read operation transfers the desired word to address lines and activates the read control line.Description of memory read read operation is given below:



    In the above diagram initially, MDR can contain any garbage value and MAR is containing 2003 memory address. After the execution of read instruction, the data of memory location 2003 will be read and the MDR will get updated by the value of the 2003 memory location (3D).

  2. Memory Write Operation:
    Memory write operation transfers the address of the desired word to the address lines, transfers the data bits to be stored in memory to the data input lines. Then it activates the write control line. Description of the write operation is given below:

    In the above diagram, the MAR contains 2003 and MDR contains 3D. After the execution of write instruction 3D will be written at 2003 memory location.



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.