MPS W1-L1 Introduction To Computer Systems I
MPS W1-L1 Introduction To Computer Systems I
Outline
• Microprocessor vs Microcontroller
• Program loading and execution
• Memory and I/O interfacing with CPU
▫ Memory read and write operations
• CPU Architectures
▫ Harvard architecture
▫ Von-Neumann architecture
3
Affordable
Space & power efficient
Not Versatile
Bulky
Expensive
Versatility
4
Memory Characteristics
• Location
• Capacity
• Organization
• Access Method
• Physical type
• Unit of transfer
9
Memory Characteristics
• Capacity
▫ Word size – n
▫ Number of words - 𝟐𝒌
• Organization
▫ How memory is
arranged/organized
• Access time
▫ Time taken to access the
memory
Memory size = 𝟐𝒌 ∗ 𝒏
10
• Address lines
▫ k-bits address lines
• Control lines
▫ R/OE – read enable
▫ W/WE - write enable
• Voltage connections
▫ Ground
▫ 𝑽𝑪𝑪
11
Try this!
• 1Kbytes memory
▫ i.e. Word size is 1 bytes
Try this!
• 1Kbytes memory
▫ i.e. Word size is 2 bytes
Try this!
• Memory addresses
▫ i.e. 0-255
• Word Size
▫ i.e. 16 bits
256x16 = 𝟐𝟖 𝒙𝟏𝟔
14
Try this!
• Size of address bus
▫ i.e. 8-bits
Try this!
Read/Write enable
IO/Mem Enable
18
𝐴0
𝐴1
𝐴2
𝐴3
𝐴4
.
.
.
.
.
IO/𝑴𝑬𝑴 .
.
I/O Devices 𝐴15
19
Fixed Part
𝐴0
𝐴1
𝐴2
𝐴3
𝐴4 IO/𝑴𝑬𝑴
.
.
.
.
.
IO/𝑴𝑬𝑴 . Address decoder
.
I/O Devices 𝐴15 for addresses 0-15
20
Try this!
- ALU
- Program counter (PC)
Components of a CPU has address of next
instruction.
- Instruction decoder
- Registers
𝐴0 = 22h
𝐴1 = 33ℎ
𝐴2 = 41ℎ
𝐴3 = 24ℎ
𝐴4 = 88ℎ
.
R
.
ALU
PC
e
g .
i
s
t
.
Instruction
e
r
.
decoder s
IO/𝑴𝑬𝑴 .
.
I/O Devices 𝐴15 = 01h
25
Instruction Current
Number CPU Instr
- ALU
- ---
- Program counter (PC)
0 A<-[16]
- Instruction decoder
1
- Registers
2
𝐴0 = 22h
PC Instruction 𝐴1 = 33ℎ
pointed by 𝐴2 = 41ℎ
PC 𝐴3 = 24ℎ
0 A<-[16] 𝐴4 = 88ℎ
.
1 A<-[3] R
.
ALU
PC
e
g .
3 B=[16]+[3] i
s .
0 t
7 A<-[17] Instruction
e
r
.
decoder s
D<-B
IO/𝑴𝑬𝑴 .
.
I/O Devices 𝐴15 = 01h
IO (1-4)
Instruction Current
Number CPU
Instruction
- ALU
- --- - Program counter (PC)
0 A<-[16] - Instruction decoder
1 - Registers
2
𝐴0 = 22h
PC Instruction 𝐴1 = 33ℎ
pointed by 𝐴2 = 41ℎ
PC 𝐴3 = 24ℎ
0 A<-[16] 𝐴4 = 88ℎ
.
1 A<-[3] R
.
ALU
PC
e
g .
3 B=[16]+[3] i
s .
1 t
7 A<-[17] Instruction
e
r
.
decoder s
D<-B
IO/𝑴𝑬𝑴 .
.
I/O Devices 𝐴15 = 01h
IO (1-4)
Instruction Current
Number CPU
Instruction
- ALU
- --- - Program counter (PC)
0 A<-[16] - Instruction decoder
1 A<-[3] - Registers
2
𝐴0 = 22h
PC Instruction 𝐴1 = 33ℎ
pointed by 𝐴2 = 41ℎ
PC 𝐴3 = 24ℎ
0 A<-[16] 𝐴4 = 88ℎ
.
1 A<-[3] R
.
ALU
PC
e
g .
3 B=[16]+[3] i
s .
3 t
7 A<-[17] Instruction
e
r
.
decoder s
D<-B
IO/𝑴𝑬𝑴 .
.
I/O Devices 𝐴15 = 01h
IO (1-4)
Instruction Current
Number/A
ddress
CPU
Instruction
- ALU
- --- - Program counter (PC)
0 A<-[16] - Instruction decoder
1 A<-[3] - Registers
3 B=[16]+[3]
𝐴0 = 22h
PC Instruction 𝐴1 = 33ℎ
pointed by 𝐴2 = 41ℎ
PC 𝐴3 = 24ℎ
0 A<-[16] 𝐴4 = 88ℎ
.
1 A<-[3] R
.
ALU
PC
e
g .
3 B=[16]+[3] i
s .
7 t
7 A<-[17] Instruction
e
r
.
decoder s
D<-B
IO/𝑴𝑬𝑴 .
.
I/O Devices 𝐴15 = 01h
IO (1-4)
Decoding Instructions
• CPU understands binary language.
• Machine code is a binary format of an instruction.
▫ Two parts: Op-code and Operand
30
Harvard Architecture
More space, fast, complex, more efficient, high cost
Von-Neumann Architecture
Less, space, slow, simple,less efficient, low cost
31
Conclusion
• Microprocessor has ALU, CU and registers.
Microcontroller has memory, I/O ports and CPU on chip.
• CPU loads the program and executes the instructions
sequentially.
• Memory and I/O interfacing with CPU
▫ CPU shares the address, data and control lines/bus as it interfaces memory
and I/O devices.
▫ Memory read and write operations are controlled using the read enable,
write enable and chip select bits.
• CPU Architecture
▫ Harvard vs Von-Neumann Architecture
32
Reading Material
• Textbook:
▫ Chapter 1, Section 1.2
▫ Chapter 2, Section 2.1-2.4
33
Questions?