03 MemoryAddressing ArchitectureTypes
03 MemoryAddressing ArchitectureTypes
1
16/01/24
Some Terminologies
2
16/01/24
• For higher data transfer rate, memory is oRen organized such that
mulCple bytes can be read or wriUen simultaneously.
• Necessary to bridge the processor-memory speed gap.
• Shall be discussed later.
Processor-Memory
Performance Gap
• With technological
advancements, both
processor and memory are
becoming faster.
• However, the speed gap is
steadily increasing.
• Special techniques are
needed to bridge this gap.
• Cache memory
• Memory interleaving
3
16/01/24
4
16/01/24
Address Contents
0000 0000 0000 0000 0000 0001
0000 0001 0000 0100 0101 0000
0000 0010 1010 1000 0000 0000
: :
1111 1111 1011 0000 0000 1010
An example: 28 x 16 memory
Some Examples
1. A computer has 64 MB (megabytes) of byte-addressable memory. How
many bits are needed in the memory address?
• Address Space = 64 MB = 26 x 220 B = 226 B
• If the memory is byte addressable, we need 26 bits of address.
2. A computer has 1 GB of memory. Each word in this computer is 32 bits.
How many bits are needed to address any single word in memory?
• Address Space = 1 GB = 230 B
• 1 word = 32 bits = 4 B
• We have 230 / 4 = 228 words
• Thus, we require 28 bits to address each word.
• If the memory is “byte addressable”, we would need 30 bits of address.
16/01/24 Computer Architecture and Opera2ng System (CS31702) 10
5
16/01/24
6
16/01/24
An Example
• Represent the following 32-bit number in both LiUle-Endian and Big-Endian in memory
from address 2000 onwards:
01010101 00110011 00001111 11000011
LiZle Endian Big Endian
Address Data Address Data
2000 11000011 2000 01010101
2001 00001111 2001 00110011
2002 00110011 2002 00001111
2003 01010101 2003 11000011
7
16/01/24
An Example
• Compute S = (A + B) – (C – D)
A typical program in assembly
LOAD R1,A language.
LOAD R2,B Assembly language instrucCons
ADD R3,R1,R2 // R3 = A + B are machine dependent.
LOAD R1,C
LOAD R2,D
SUB R4,R1,R2 // R4 = C – D
SUB R3,R3,R4 // R3 = R3 – R4
STORE S,R3
8
16/01/24
Von-Neumann Architecture
• InstrucCons and data are stored in the same
memory module.
• Suitable for most of the general purpose
Program /
processors. Data
Processor
• Disadvantage: Memory
• The processor-memory bus acts as the boUleneck.
• All instrucCons and data are moved back and forth
through the pipe.
Harvard Architecture
• Separate memory for program and data.
Program
• InstrucCons are stored in program memory Memory
and data are stored in data memory.
Processor
• InstrucCon and data accesses can be done
Data
in parallel. Memory
• However, the processor-memory
boUleneck remains.