COMPUTER MEMORY, Study notes of Computer Science

The computer's memory stores data, instructions required during the processing of. data, and output results. Storage may be required for a limited period of ...

Typology: Study notes

2021/2022

Uploaded on 08/01/2022

hal_s95
hal_s95 🇵🇭

4.4

(655)

10K documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Lecturer: Ali Kadhim AL-Bermani
COMPUTER MEMORY
I. INTRODUCTION
The computer’s memory stores data, instructions required during the processing of
data, and output results. Storage may be required for a limited period of time,
instantly, or, for an extended period of time. Different types of memories, each having
its own unique features, are available for use in a computer. The cache memory,
registers, and RAM are fast memories and store the data and instructions temporarily
during the processing of data and instructions. The secondary memory like magnetic
disks and optical disks has large storage capacities and store the data and instructions
permanently, but are slow memory devices.
The memories are organized in the computer in a manner to achieve high levels of
performance at the minimum cost. In this lecture, we discuss different types of
memories, their characteristics and their use in the computer.
II. MEMORY REPRESENTATION
The computer memory stores different kinds of data like input data, output data,
intermediate results, etc., and the instructions. Binary digit or bit is the basic unit of
memory. A bit is a single binary digit, i.e., 0 or 1. A bit is the smallest unit of
representation of data in a computer. However, the data is handled by the computer as
a combination of bits. A group of 8 bits form a byte.
One byte is the smallest unit of data that is handled by the computer.
One byte (8 bit) can store 28 = 256 different combinations of bits, and thus can be used
to represent 256 different symbols. In a byte, the different combinations of bits fall in
the range 00000000 to 11111111. A group of bytes can be further combined to form a
word. A word can be a group of 2, 4 or 8 bytes.
1 bit = 0 or 1
1 Byte (B) = 8 bits
1 Kilobyte (KB) = 210 = 1024 bytes
1 Megabyte (MB) = 220 = 1024KB
1 Gigabyte (GB) = 230 = 1024 MB = 1024 *1024 KB
1 Terabyte (TB) = 240= 1024 GB = 1024 * 1024 *1024 KB
College of Information Technology / Department of Information Networks
………………………….………………………………..
Computer Science Fundamentals
/ First Class / First Semester
LEC. 4
pf3
pf4
pf5

Partial preview of the text

Download COMPUTER MEMORY and more Study notes Computer Science in PDF only on Docsity!

COMPUTER MEMORY

I. INTRODUCTION

The computer’s memory stores data, instructions required during the processing of data, and output results. Storage may be required for a limited period of time, instantly, or, for an extended period of time. Different types of memories, each having its own unique features, are available for use in a computer. The cache memory, registers, and RAM are fast memories and store the data and instructions temporarily during the processing of data and instructions. The secondary memory like magnetic disks and optical disks has large storage capacities and store the data and instructions permanently, but are slow memory devices. The memories are organized in the computer in a manner to achieve high levels of performance at the minimum cost. In this lecture, we discuss different types of memories, their characteristics and their use in the computer.

II. MEMORY REPRESENTATION

The computer memory stores different kinds of data like input data, output data, intermediate results, etc., and the instructions. Binary digit or bit is the basic unit of memory. A bit is a single binary digit, i.e., 0 or 1. A bit is the smallest unit of representation of data in a computer. However, the data is handled by the computer as a combination of bits. A group of 8 bits form a byte. One byte is the smallest unit of data that is handled by the computer. One byte (8 bit) can store 28 = 256 different combinations of bits, and thus can be used to represent 256 different symbols. In a byte, the different combinations of bits fall in the range 00000000 to 11111111. A group of bytes can be further combined to form a word. A word can be a group of 2, 4 or 8 bytes. 1 bit = 0 or 1 1 Byte (B) = 8 bits 1 Kilobyte (KB) = 2^10 = 1024 bytes 1 Megabyte (MB) = 2^20 = 1024KB 1 Gigabyte (GB) = 2^30 = 1024 MB = 1024 *1024 KB 1 Terabyte (TB) = 2^40 = 1024 GB = 1024 * 1024 *1024 KB

College of Information Technology / Department of Information Networks ………………………….……………………………….. LEC. (^4) Computer Science Fundamentals/ First Class / First Semester

2

III.CHARACTERISTICS OF MEMORIES

Volatility o Volatile {RAM} o Non-volatile {ROM, Flash memory}Mutability o Read/Write {RAM, HDD, SSD, RAM, Cache, Registers…} o Read Only {Optical ROM (CD/DVD…), Semiconductor ROM}Accessibility o Random Access {RAM, Cache} o Direct Access {HDD, Optical Disks} o Sequential Access {Magnetic Tapes}

IV. MEMORY HIERARCHY

The memory is characterized on the basis of two key factors: capacity and access time.  Capacity is the amount of information (in bits) that a memory can store.  Access time is the time interval between the read/ write request and the availability of data. The lesser the access time, the faster is the speed of memory. Ideally, we want the memory with fastest speed and largest capacity. However, the cost of fast memory is very high. The computer uses a hierarchy of memory that is organized in a manner to enable the fastest speed and largest capacity of memory. The hierarchy of the different memory types is shown in Figure 4.2.

Figure 4.2 Memory hierarchy The Internal Memory and External Memory are the two broad categories of memory used in the computer. The Internal Memory consists of the CPU registers, cache memory and primary memory. The internal memory is used by the CPU to perform the computing tasks. The External Memory is also called the secondary memory. The secondary memory is used to store the large amount of data and the software.

4

V. CPU REGISTERS

Registers are very high-speed storage areas located inside the CPU. After CPU gets the data and instructions from the cache or RAM, the data and instructions are moved to the registers for processing. Registers are manipulated directly by the control unit of CPU during instruction execution. That is why registers are often referred to as the CPU’s working memory. Since CPU uses registers for the processing of data, the number of registers in a CPU and the size of each register affect the power and speed of a CPU. The more the number of registers (ten to hundreds) and bigger the size of each register (8 bits to 64 bits), the better it is.

VI. CACHE MEMORY

Cache memory is placed in between the CPU and the RAM. Cache memory is a fast memory, faster than the RAM. When the CPU needs an instruction or data during processing, it first looks in the cache. If the information is present in the cache, it is called a cache hit , and the data or instruction is retrieved from the cache. If the information is not present in cache, then it is called a cache miss and the information is then retrieved from RAM. Type of Cache memory Cache memory improves the speed of the CPU, but it is expensive. Type of Cache Memory is divided into different levels that are L1, L2, L3: Level 1 (L1) cache or Primary Cache L1 is the primary type cache memory. The Size of the L1 cache very small comparison to others that is between 2KB to 64KB, it depends on computer processor. It is an embedded register in the computer microprocessor (CPU).The Instructions that are required by the CPU that are firstly searched in L1 Cache. Example of registers are accumulator, address register, Program counter etc. Level 2 (L2) cache or Secondary Cache L2 is secondary type cache memory. The Size of the L2 cache is more capacious than L1 that is between 256KB to 512KB. L2 cache is located on computer microprocessor. After searching the Instructions in L1 Cache, if not found then it searched into L2 cache by computer microprocessor. The high-speed system bus interconnecting the cache to the microprocessor. Level 3 (L3) cache or Main Memory The L3 cache is larger in size but also slower in speed than L1 and L2, its size is between 1MB to 8MB. In Multicore processors, each core may have separate L and L2, but all core share a common L3 cache. L3 cache double speed than the RAM.

5

The advantages and disadvantages of cache memory are as follows: Advantages The advantages of cache memory are as follows:  Cache memory is faster than main memory.  It consumes less access time as compared to main memory.  It stores the program that can be executed within a short period of time.  It stores data for temporary use. Disadvantages The disadvantages of cache memory are as follows:  Cache memory has limited capacity.  It is very expensive.

VII. PRIMARY MEMORY (Main Memory) Primary memory is the main memory of computer. It is a chip mounted on the motherboard of computer. Primary memory is categorized into two main types: Random access memory (ram) and read only memory (rom). RAM is used for the temporary storage of input data, output data and intermediate results. The input data entered into the computer using the input device, is stored in RAM for processing. After processing, the output data is stored in RAM before being sent to the output device. Any intermediate results generated during the processing of program are also stored in RAM. Unlike RAM, the data once stored in ROM either cannot be changed or can only be changed using some special operations. Therefore, ROM is used to store the data that does not require a change. Types of Primary Memory

1. RAM (Random Access Memory) The Word “ RAM ” stands for “random access memory” or may also refer to short- term memory. It’s called “random” because you can read store data randomly at any time and from any physical location. It is a temporal storage memory. RAM is volatile that only retains all the data as long as the computer powered. It is the fastest type of memory. RAM stores the currently processed data from the CPU and sends them to the graphics unit.