0% found this document useful (0 votes)
47 views

Memory Organization and Structure in Assembly Language

Uploaded by

Leviathan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

Memory Organization and Structure in Assembly Language

Uploaded by

Leviathan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Memory organization and structure in assembly language

The memory is organized in the form of a cell, each cell is able to be


identified with a unique number called address. Each cell is able to recognize
control signals such as “read” and “write”, generated by CPU when it wants
to read or write address. Whenever CPU executes the program there is a
need to transfer the instruction from the memory to CPU because the
program is available in memory. To access the instruction CPU generates
the memory request.

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.

Memory hierarchical pyramid


The five levels in a memory hierarchy are categorized based on speed and
usage and form a pyramid. The levels in a memory hierarchical pyramid are
the following:

 Level 0: CPU registers

 Level 1: Cache memory

 Level 2: Primary memory or main memory

 Level 3: Secondary memory or magnetic disks or solid-state storage


 Level 4: Tertiary memory or optical disks or magnetic tapes

The primary memory is known as the internal memory. It is directly accessible


by the computer's processor. The secondary memory, also known as external
memory, can be accessed by the processor through the I/O module. It
consists of peripheral storage devices.

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.

Level 0: CPU registers. A CPU register is a small section of memory in a


CPU that can store small amounts of the data required to perform various
operations. It loads the resulting data to the main memory and contains the
address of the memory location.

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.

A CPU register is implemented using digital logic circuits called flip-flops. It is


an implementation of static RAM (SRAM) within the processor. Most
processors include aprogram counter register, a status word register for
decision-making and an accumulator to store data and mathematical
operations.

Level 1: cache memory. Cache memory is required to store segments of


programs or chunks of data that are frequently accessed by the processor.
When the CPU needs to access program code or data, it first checks the
cache memory. If it finds the data, it reads it quickly. If it doesn't, it looks into
the main memory to find the required data.
Cache memory is usually smaller in size than a CPU register, typically
measured inmegabytes (MB). It is implemented using SRAM. Usually, the
cache is inside the processor. However, it may also be implemented as a
separate integrated circuit (IC).

Level 2: primary/main memory. The primary memory communicates with


the CPU and with the peripheral or auxiliary memory devices through the I/O
processor. It is the primary storage unit of a computer system; it's often
referred to as random access memory (RAM) and is implemented using
dynamic RAM (DRAM) components. However, main memory may also
include read-only memory (ROM).

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).

Level 3: secondary storage. Secondary storage devices such as magnetic


disks occupy level 3 of the memory hierarchy. Usually, both faces of a
magnetic disk are utilized to store programs and data. Further, multiple disks
may be stacked on a spindle to provide a larger memory ecosystem. In many
systems, magnetic disks are being replaced by non-mechanical solid-state
storage devices.

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).

Level 4: tertiary storage. Tertiary storage devices are usually magnetic


tapes or optical disks. These devices are typically used to store duplicate or
archive copies of data. Also known as auxiliary storage, tertiary memory
devices are usually used to store programs and data for the long term or when
not required for immediate use.

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

Characteristics of memory hierarchy


The key characteristics of a memory hierarchy include the following:

Capacity. Capacity is the volume of information that a memory device can


store. As we move down the memory pyramid, the capacity or memory size
increases.

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.

Performance. Without a memory hierarchy, there is a speed gap between


CPU registers and the main memory. This increases access time and directly
impacts the system's performance. Performance can be improved by reducing
the number of levels required to access and manipulate data.

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.

You might also like