0% found this document useful (0 votes)
38 views40 pages

Lectures - 5-6 SW

Uploaded by

hasnaninali654
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views40 pages

Lectures - 5-6 SW

Uploaded by

hasnaninali654
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

24 BE(SW)

Department of Software Engineering

Computer Fundamentals

Engr. MIR MUHAMMAD


[email protected]
Let’s Begin …

Lecture # 05-06
Computer Memory
• Computer memory is the physical device used to store
data and programs (set of instructions) temporarily
or permanently.

Data
+
Programs

3
Computer Memory

Memory

Primary / Main / Working Secondary / Auxiliary


Cache
Memory Memory

RAM ROM Magnetic Optical Solid State

4
Computer Memory

Primary Memory

Holds Data
and Programs
that are
currently
being
processed by
the processor 5
Types of Primary Memory
• There are two types of primary memory:

6
RAM (Random Access Memory)
• RAM stands for Random Access Memory.
• It stores the data and programs temporarily.
• It is volatile, means it does not retain its contents when
power is turned off.
• It provides the data and programs to the processor so
that it can process the data on the basis of given set of
instructions. Set of Instructions
(from RAM)

Data Process Information


7
RAM (Random Access Memory)
• RAM is a physical chip (collection of chips).

8
RAM (Random Access Memory)
• It is Read and Write memory.

9
RAM (Random Access Memory)
• The access mechanism is random (non sequential),
means we can directly access any byte of RAM with out
touching any other byte.

• The Memory (RAM + ROM) is divided in to pieces of


bytes (8-bits).

• Every byte has got address defined in Hexadecimal.

10
ROM (Read Only Memory)
• It stands for Read Only Memory.

• It stores the special program permanently.

• It is non-volatile, means it retains its contents even


when the power is turned off.

• ROM is physical memory chip which stores special


program called BIOS (Basic Input Output System).
11
ROM (Read Only Memory)
• BIOS is required to start the computer.
• When ever you turn on/ restart the computer, the very
first program that starts is the BIOS (Stored in ROM).
• The job of BIOS is to execute POST operation (Power
On Self Test).
• POST checks whether all the required hardware is
present or not? And all the hardware attached, is
working properly or not?

12
POST (Power On Self Test)

13
ROM (Read Only Memory)
• The access mechanism is Random like RAM.

• ROM is hardware chip.

• BIOS is the set of instruction (Program)

14
ROM (Read Only Memory)
• ROM is Read Only, we can only read but can not easily
change/update the contents.

15
Secondary Memory
• This type of memory is also known as auxiliary/external
memory.
• It is slower than main memory.
• These are used for storing data/Information permanently.
• CPU directly does not access these memories. Contents of
secondary memories are first transferred to main memory,
and then CPU can access it. For example : disk, CD-ROM, DVD
etc.
• It is non-volatile memory.
• Computer may run without secondary memory.
16
Secondary Memory
• Stores data and programs permanently
• its retained after the power is turned off
• Main Examples
1. Hard Disk
2. Optical Disk
3. Flash memory

17
Secondary Memory: Hard Disk
• Called Disk drive or HDD
• stores and provides relatively quick access to large amounts of
data.
• Stores data on an electromagnetically charged surface or set of
surfaces.

18
Inside Hard Disk

track

sector

head

19
Secondary Memory: Optical Disk & Flash
• an optical disc drive (ODD) is a disk drive that uses laser light to store data.
• There are three main types of optical media: CD, DVD, and Blu-ray disc

CD “Compact Disk” can store up to 700MB


DVD “ Digital Video Disk “ can store up to 8.4 GB
Blu-ray disc. can store up to 50 GB

20
Secondary Memory: Flash Disk
• A storage module made of flash memory chips. A Flash disks have no mechanical
platters or access arms, but the term "disk" is used because the data are accessed as
if they were on a hard drive. The disk storage structure is emulated.

21
RAM V/s Hard Disk

22
Cache Memory
• Cache memory is a very high speed semiconductor memory which
can speed up CPU.
• It acts as a buffer between the CPU and main memory.
• It is used to hold those parts of data and program which are most
frequently used by CPU.
• The parts of data and programs are transferred from disk to cache
memory by operating system, from where CPU can access them.
• 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.
23
Cache Memory
• Cache memory has limited capacity.
• Most processors have L1, L2 and L3 (Level 1, Level 2 and
Level 3) Cache.
• L1 cache is built inside the microprocessor
• First, microprocessor finds data in cache memory.
• If data is found in cache, it is called as HIT.
• If data is not found in cache, it is called as MISS.
• In case of MISS, microprocessor requests data from RAM.
24
Cache Memory

CPU HIT
1. First look in cache for data 3. If data is in cache send it to CPU

Cache
2. If data is not in cache fetch from RAM 4. Send data from RAM, write it to cache and
send it to CPU

RAM MISS
25
Memory Measurement Units
– BIT
– Nibble
– Byte
– Word

26
Units of Memory Measurement
• Memory stores the data temporarily or permanently.
• The basic unit of memory is BIT.

BIT = BInary digiT

• A bit can store either of two possible values 0 or 1.

0 OR 1
27
Units of Memory Measurement
• If we combine two bits, they can store one of 4 possible values.

• Example: 10
00
01
10
11

28
Units of Memory Measurement
• If we combine three bits, they can store one of 8 possible values.

• Example: 110
000
001
010
011
100
101
110
111

29
Units of Memory Measurement

2 = Number of possible value


n
Where n = number of bits
21 = 2
22 = 4
23 = 8
24 = 16
25 = 32
26 = 64

30
BIT

Bit
Single binary digit.

Example 1: 0
Example 2: 1
31
Nibble

Nibble
Combination of 4 bits.

Example 1: 1101
Example 2: 1111
Example 3: 1001
32
Byte

Byte
Combination of 8 bits.

Example 1: 11011101
Example 2: 11111101
Example 3: 10010100
33
Word

Word
Combination of 2 bytes (16 bits).

Example 1: 1101110100101101
Example 2: 1111110110110101
Example 3: 1001010000001011
34
Unit of Measurements - Storage
Storage Units
Bit BIT 0 or 1

Byte B 8 bits

Kilobyte KB 1024 bytes

Megabyte MB 1024 kilobytes

Gigabyte GB 1024 megabytes

Terabyte TB 1024 gigabytes

35
Units of Memory Measurement
1 Byte = 8 Bits

1 KB (Kilo Byte) = 1024 Bytes

1 MB (Mega Byte) = 1024 KB

1 GB (Giga Byte) = 1024 MB

1 TB (Tera Byte) = 1024 GB

1 PB (Peta Byte) = 1024 TB

1 EB (Exa Byte) = 1024 PB

1 ZB (Zetta Byte) = 1024 EB

1 YB (Yotta Byte) = 1024 ZB


36
Memory unit
(bit and Byte)

• 1 bit Contain (1 or 0)
• 8 bits Byte
• 16 bits
• 32 bits
• 64 bits
Size Example
• 1 bit - answer to a yes/no question
• 1 byte - a number from 0 to 255.
• 90 bytes: enough to store a typical line of text from a book.
• 4 KB: about one page of text.
• 120 KB: the text of a typical pocket book
• 3 MB - a three minute song (128k bitrate)
• 650-900 MB - a CD-ROM
• 1 GB -114 minutes of uncompressed CD-quality audio at 1.4 Mbit/s
• 8 -16 GB - size of a normal flash drive

38
• 10B is equivalent 10 * 8 = 80 bits
• 3MB is equivalent to how many Bits?
• Answer:
• 3 *1024 = 3072 KB
• 3072*1024 = 3145728 B
• 3145728 * 8 = 25165824 bits

39
40

You might also like