DL Unit 4(2 nd
half)
Memory Units
• Memory units are used to measure and represent data. Some of the
commonly used memory units are:
• 1) Bit: The computer memory units start from bit. A bit is the smallest memory
unit to measure data stored in main memory and storage devices. A bit can
have only one binary value out of 0 and 1.
• 2) Byte: It is the fundamental unit to measure data. It contains 8 bits or is
equal to 8 bits. Thus a byte can represent 2*8 or 256 values.
• 3) Kilobyte: A kilobyte contains 1024 bytes.
• 4) Megabyte: A megabyte contains 1024 kilobytes.
• 5) Gigabyte: A gigabyte contains 1024 megabyte.
• 6) Terabyte: A terabyte contains 1024 gigabytes.
Computer memory
• The computer memory holds the data and instructions needed to process
raw data and produce output.
• The computer memory is divided into large number of small parts known
as cells. Each cell has a unique address which varies from 0 to memory size
minus one.
• Categorizing memory on behalf of space or location, it is of four types:
1) Register memory
2) Cache memory
3) Primary memory
4) Secondary memory
Register Memory
• Register memory is the smallest and fastest memory in a computer. It is not a part
of the main memory and is located in the CPU in the form of registers, which are
the smallest data holding elements. A register temporarily holds frequently used
data, instructions, and memory address that are to be used by CPU.
• They hold instructions that are currently processed by the CPU. All data is required
to pass through registers before it can be processed. So, they are used by CPU to
process the data entered by the users.
• Registers hold a small amount of data around 32 bits to 64 bits. The speed of a
CPU depends on the number and size (no. of bits) of registers that are built into the
CPU. Registers can be of different types based on their uses. Some of the widely
used Registers include Accumulator or AC, Data Register or DR, the Address
Register or AR, Program Counter (PC), I/O Address Register, and more.
Cache Memory
• Cache memory is a high-speed memory, which is small in size but
faster than the main memory (RAM). The CPU can access it more
quickly than the primary memory. So, it is used to synchronize
with high-speed CPU and to improve its performance.
• Cache memory can only be accessed by CPU. It can be a reserved
part of the main memory or a storage device outside the CPU.
• It holds the data and programs which are frequently used by the
CPU. In other words, if the CPU finds the required data or
instructions in the cache memory, it doesn't need to access the
primary memory (RAM). Thus, by acting as a buffer between
RAM and CPU, it speeds up the system performance.
Types of Cache Memory:
1) L1: It is the first level of cache memory, which is called Level 1 cache or
L1 cache. In this type of cache memory, a small amount of memory is
present inside the CPU itself.
• The size of this memory ranges from 2KB to 64 KB.
• The L1 cache further has two types of caches: Instruction cache, which
stores instructions required by the CPU, and the data cache that stores
the data required by the CPU.
2) L2: This cache is known as Level 2 cache or L2 cache. This level 2 cache
may be inside the CPU or outside the CPU. The memory size of this cache
is in the range of 256 KB to the 512 KB. In terms of speed, they are slower
than the L1 cache.
3) L3: It is known as Level 3 cache or L3 cache.
• This cache is not present in all the processors; some high-end
processors may have this type of cache.
• This cache is used to enhance the performance of Level 1 and Level
2 cache. It is located outside the CPU and is shared by all the cores of
a CPU.
• Its memory size ranges from 1 MB to 8 MB. Although it is slower
than L1 and L2 cache, it is faster than Random Access Memory
(RAM).
Memory Systems
Primary Memory in Computer
• A computer uses primary storage or main memory to store programs
and data during its execution.
• Read-only memory (ROM) and
• Random access memory (RAM) are the two main memories in a
computer.
Random Access Memory (RAM)
(Semiconductor RAM memories)
• Random access memory (RAM) is read-write memory.
• It can store instruction and data temporarily and one can read and
write the data in any location of memory.
• RAM is a volatile type of memory. So, it losses the contents after
switching off the power supply.
• There are two types of RAM – Static RAM(SRAM) and dynamic
RAM(DRAM).
• Static RAM stores data as long as the power supply is on,but the
stored data in dynamic RAM gets refreshed periodically.
BASIS FOR COMPARISON SRAM DRAM
Speed Faster Slower
Size Small Large
Cost Expensive Cheap
Used in Cache memory Main memory
Density Less dense Highly dense
Construction Complex and uses transistors Simple and uses capacitors
and latches. and very few transistors.
Single block of memory 6 transistors Only one transistor.
requires
Charge leakage property Not present Present hence require power
refresh circuitry
Power consumption Low High
SDRAM
• The Synchronous Dynamic Random Access Memory, commonly
abbreviated as SDRAM, is a type of dynamic random access memory
(DRAM). SDRAM is the form of RAM frequently seen in most computers
that provides faster speed when compared to regular DRAM.
• SDRAM integrated circuits use an external clock signal to synchronize the
operation of its external pin interface.
• SDRAMs offer greater data transfer rates and concurrency. Besides this,
SDRAM provides a simple design at a low cost, which can greatly benefit
manufacturers. These advantages have made SDRAM a popular and
preferred choice in the computer memory market, particularly for RAM.
ROM(Read Only Memory)
• ROM, which stands for read only memory, is a memory device or
storage medium that stores information permanently.
• It is called read only memory as we can only read the programs and
data stored on it but cannot write on it. It is restricted to reading
words that are permanently stored within the unit.
• The manufacturer of ROM fills the programs into the ROM at the
time of manufacturing the ROM. After this, the content of the ROM
can't be altered, which means you can't reprogram, rewrite, or erase
its content later. However, there are some types of ROM where you
can modify the data.
Types of ROM:
1) Masked Read Only Memory (MROM):
• It is the oldest type of read only memory (ROM). It has become
obsolete so it is not used anywhere in today's world.
• It is a hardware memory device in which programs and instructions
are stored at the time of manufacturing by the manufacturer.
• So it is programmed during the manufacturing process and can't be
modified, reprogrammed, or erased later.
2) Programmable Read Only Memory (PROM):
• PROM is a blank version of ROM. It is manufactured as blank memory
and programmed after manufacturing. We can say that it is kept
blank at the time of manufacturing. You can purchase and then
program it once using a special tool called a programmer.
• To write data onto a PROM chip; a device called PROM programmer
or PROM burner is used.
• The process or programming a PROM is known as burning the
PROM. Once it is programmed, the data cannot be modified later, so
it is also called as one-time programmable device.
• Uses: It is used in cell phones, video game consoles, medical devices,
RFID tags, and more
3) Erasable and Programmable Read Only Memory (EPROM):
• EPROM is a type of ROM that can be reprogramed and erased many
times.
• The method to erase the data is very different; it comes with a quartz
window through which a specific frequency of ultraviolet light is
passed for around 40 minutes to erase the data. So, it retains its
content until it is exposed to the ultraviolet light.
• Need a special device called a PROM programmer or PROM burner to
reprogram the EPROM.
• Uses: It is used in some micro-controllers to store program, e.g., some
versions of Intel 8048 and the Freescale 68HC11.
4) Electrically Erasable and Programmable Read Only Memory
(EEPROM):
• ROM is a type of read only memory that can be erased and
reprogrammed repeatedly, up to 10000 times. It is also known as
Flash EEPROM as it is similar to flash memory. It is erased and
reprogrammed electrically without using ultraviolet light. Access
time is between 45 and 200 nanoseconds.
• Uses: The BIOS of a computer is stored in this memory.
5) FLASH ROM:
• It is an advanced version of EEPROM. It stores information in an
arrangement or array of memory cells made from floating-gate transistors.
• The advantage of using this memory is that you can delete or write blocks
of data around 512 bytes at a particular time.
• Whereas, in EEPROM, you can delete or write only 1 byte of data at a time.
So, this memory is faster than EEPROM.
• It can be reprogrammed without removing it from the computer. Its access
time is very high, around 45 to 90 nanoseconds. It is also highly durable as it
can bear high temperature and intense pressure.
• Uses: It is used for storage and transferring data between a personal
computer and digital devices. It is used in USB flash drives, MP3 players,
digital cameras, modems and solid-state drives (SSDs). The BIOS of many
modern computers are stored on a flash memory chip, called flash BIOS.