Memory Organization and Structure in Assembly Language
Memory Organization and Structure in Assembly Language
Memory Request:
Memory request contains the address along with the control signals. For
Example, When inserting data into the stack, each block consumes memory
(RAM) and the number of memory cells can be determined by the capacity of
a memory chip.
Word Size:
It is the maximum number of bits that a CPU can process at a time and it
depends upon the processor. Word size is a fixed size piece of data handled
as a unit by the instruction set or the hardware of a processor.
Word size varies as per the processor architectures because of generation
and the present technology, it could be low as 4-bits or high as 64-bits
depending on what a particular processor can handle. Word size is used for
a number of concepts like Addresses, Registers, Fixed-point numbers,
Floating-point numbers.
As a general rule, the cost and capacity of each memory level varies inversely
with speed. Thus, CPU registers are the fastest while tertiary memory devices
are the slowest.
Registers are present inside the CPU and therefore have the quickest access
time. Since they are the fastest memory type, they are the most expensive.
They are also the smallest in size, typically measured in kilobytes.
Any program or data that is not currently required in the main memory is
transferred into the auxiliary memory to create space for programs and data
that are currently active. Main memory is less expensive than CPU registers
and cache memory, and is also larger in size (typically measured
in gigabytes).
Secondary storage devices act as backup storage and are much cheaper than
the main memory and cache. These memory types are also large in size and
generally have capacities of up to 20 terabytes (TB).
Tertiary devices are suitable for data archiving and backup. They are the
cheapest and slowest memory type; they typically have capacities of 1
TB to 20 TB
Access time. Access time is the time interval from when a read/write request
is made and when the data actually becomes available. It increases as we
move from the top to the bottom of the memory hierarchy. Registers, which
are present inside the CPU, have the shortest access time, meaning they are
the fastest. At the bottom of the pyramid, magnetic tapes and similar storage
devices have the greatest access time.
Cost per bit. The cost per bit is calculated by dividing the total cost of the
memory by the total number of accessed bits. As we move from the top of the
memory hierarchy to the bottom, the cost per bit decreases. This is because
internal memory is costlier than external memory.