V1CP1 – week 6Central Processing Unit
2
adresbus
databus
controlebus
CPU MEMORY I/O
Blokschema computersysteem(recap)
3
n bepaalt het adresbereik – max. 2n geheugenregisters
m – vaak gelijk aan het aantal bits per register
Central Processing Unit (CPU)
Bron: Wikipedia
4
adresbus
databus
controlebus
BIU
Registers
ALUStatus register
Stack pointer
PC
ICU
Instructie register
TU
1001001001001110
1001001001001110
Opbouw van de CPU
5
Onderdelen van de CPU
CPU = Central Processing Unit ICU = Internal Control Unit TU = Timing Unit ALU = Arithmetic Logic Unit BIU = Bus Interface Unit Registers (general purpose) Program Counter (PC) Stackpointer Statusregister Instruction register
6
John von Neumann (28-12-1903 - 8-2-1957)
Stored Program Architecture
7
BIU
Registers
1001001001001110
1001001001001110
ALUStatus register
Stack pointer
PC
TU
ICU
Instructie register 1001101101100011
0011100101111010
Data en instructies staan in het geheugen
8
FInstruction
Fetch
DInstruction
Decode
EInstruction Execution
SStore Result
Von Neumann cyclus
9
Werking van een processor
1. Haal een instructie op (Fetch)- zet inhoud PC op adresbus- geef een leessignaal op controlebus- verhoog inoud van PC- plaats data van databus in Instructie Register
2. Decodeer de instructie (Decode)
3. Voer de instructie uit (Execute)
4. Sla het resultaat op (Store)
5. Ga naar 1
10
adres
data
adres stabiel
R/W
Lees cyclus Schrijf cyclusSchrijf cyclus
Bus timing
11
…etc…
C=A or B0110
C=A and B1010
C=A-B0010
C=A+B1100
C=A+10100
C=B1000
C=A0000
functief0
f1
f2
f3
Arithmetic/Logic Unit (ALU)
A B
C
statusn z v c
functie
ALU
12
0000011000001000 0x0608 Z80: LD B,8
1010011000001000 0xC608 6809: LDB #8
0000011000001000 0x0608 8080: MVI B,8
0xB72345 6809: STA 2345 Big Endian
0x324523 Z80: LD (2345),A Little Endian
High Low
Machine instructies
13
Kenmerken van een instructie
Binaire code (instruction format) Lengte (aantal geheugenadressen) Invloed op de statusvlaggen Hoe vindt de CPU de data voor de instructie
(adressing mode) Hoeveel klokcycli kost de uitvoering
14
Instructietypen
Verplaatsing (mov, ldr, str)
Bewerking Logisch (and, or, lsl, … ) Rekenkundig (add, sub, mul, … )
Sprong Conditioneel (beq, bne, … ) Niet conditioneel (jmp, bra, … )
Subroutine aanroep (call, ret, …) Speciale instructies (nop, hlt, swi, … )
15
CPU demo (ZEP2)
16
Cache geheugen(in Core 2 Duo)
Bron: www.zdnet.com.au
17
18
PCI gebaseerd computersysteem
19
Accellerated Graphics Port (AGP)
20
Intel PM855 Chipset
Bron: www.intel.com
21
PCI Express Based System
Bron: AV Bhatt, Intel
22
PCI Express Lanes
Bron: AV Bhatt, Intel
23
Opdrachten
Bestudeer hfdst. 7.4 t/m 7.4.3 Bestudeer hfdst. 8.3