Download presentation
Presentation is loading. Please wait.
Published byPreston Harrington Modified over 9 years ago
1
CBP 2013-14Comp 1017 Digital Technologies1 Let’s make a Computer
2
CBP 2013-14Comp 1017 Digital Technologies2 Let’s make a CPU
3
CBP 2004-5Comp 1017 Digital Technologies3 Pentium
4
CBP 2004-5Comp 1017 Digital Technologies4 Arithmetic Logic Unit Input AInput B Output ALU Integer Execution Unit 5 32 add 1 32 sub
5
CBP 2004-5Comp 1017 Digital Technologies5 Input AInput B Output ALU Multimedia MMX
6
CBP 2004-5Comp 1017 Digital Technologies6 5 32 add 0 1 2 3 4 3 2 5 Processing Idea Nr. 1 Move data from memory Move data into memory 3. 2. 1. Data Memory Move data in and out of data memory
7
CBP 2004-5Comp 1017 Digital Technologies7 5 32 add 0 1 2 3 4 3 2 5 Processing Idea Nr.2 IP (Code Memory) mov 3 in from memory mov 2 in from memory add the two numbers mov the result to memory Instruction Memory Program Move instructions into CPU from code memory
8
CBP 2004-5Comp 1017 Digital Technologies8 Registers-1 0 1 4 6 8 6 8 AX BX
9
CBP 2004-5Comp 1017 Digital Technologies9 Registers-2 0 1 4 6 8 6 8 4 AX BX MAR
10
CBP 2004-5Comp 1017 Digital Technologies10 ip Data Memory Instruction Memory 0 1 4 mar Our CPU so far …
11
CBP 2004-5Comp 1017 Digital Technologies11 SAM-2
12
CBP 2004-5Comp 1017 Digital Technologies12 Hierarchy of Programming 2. Written in HLL (C) 3. CPU executes machine code mov ax,[x] mov bx,[y] add ax, bx mov [w],ax w = x + y ; 1. Application
13
CBP 2004-5Comp 1017 Digital Technologies13 Moving data into Registers Instruction Memory 0 1 2 mar 3 4 mov ax, [1] 8 5 8 7 6 1 BX AX mov ax, [1] mov bx, [2] 7 For example …
14
CBP 2004-5Comp 1017 Digital Technologies14 Moving data into Memory Instruction Memory 0 1 2 mar 3 4 mov [3], ax 8 5 8 7 6 1 BX AX mov [3], ax mov [0], bx 7 For example … 8 7
15
CBP 2004-5Comp 1017 Digital Technologies15 Adding Numbers Instruction Memory 0 1 2 mar 3 4 add ax, bx 8 5 7 6 1 BX AX Add ax,bx 7 For example … 8 8 7 15
16
CBP 2004-5Comp 1017 Digital Technologies16 I’ve never wrestled with such a complex problem before It must take a lot of organization and control !
17
CBP 2004-5Comp 1017 Digital Technologies17 Pentium Organization and control
18
CBP 2004-5Comp 1017 Digital Technologies18 Fetch-Execute Cycle 1. Fetch instruction from memory 2. Decode the instruction and read any registers 3. Do any ALU operations (execute units) 5. Write back results to registers add ax, bx 4. Do any Memory Access ALU <- ax ALU <- bx ax + bx (Data cache) ax <- ALU None needed
19
CBP 2004-5Comp 1017 Digital Technologies19 add ax, bx add ax 0 1 4 3 2 bx Fetch-Exec : State 1 Instruction Fetch 8 3 7 1 9 3 1 AX BX
20
CBP 2004-5Comp 1017 Digital Technologies20 0 1 4 3 2 Fetch-Exec : State 2 Decode, Register Operations 8 3 7 1 9 add ax, bx add axbx 3 1 3 1 AX BX
21
CBP 2004-5Comp 1017 Digital Technologies21 0 1 4 3 2 Fetch-Exec : State 3 ALU Operation 8 3 7 1 9 add ax, bx add axbx AX BX 3 1 4
22
CBP 2004-5Comp 1017 Digital Technologies22 0 1 4 3 2 Fetch-Exec : State 4 Memory Access 8 3 7 1 9 add ax, bx add axbx AX BX 3 1 4
23
CBP 2004-5Comp 1017 Digital Technologies23 0 1 4 3 2 Fetch-Exec : State 5 Register Write 8 3 7 1 9 add ax, bx add axbx BX 3 1 4 4
24
CBP 2004-5Comp 1017 Digital Technologies24 Fetch-Execute Cycle 1. Fetch instruction from memory 2. Decode the instruction and read any registers 3. Do any ALU operations (execute units) 5. Write back results to registers (Organization and Control) mov ax, [1] 4. Do any Memory Access Read the ‘1’ Put ‘1’ into MAR Data into ax Read memory at addr ‘1’
25
CBP 2004-5Comp 1017 Digital Technologies25 mov ax, [1] mov ax 0 1 4 3 2 1 Fetch-Exec : State 1 Instruction Fetch 8 3 7 1 9
26
CBP 2004-5Comp 1017 Digital Technologies26 mov ax, [1] mov ax 0 1 4 3 2 1 Fetch-Exec : State 2 Decode, Register Operations 8 3 7 1 9
27
CBP 2004-5Comp 1017 Digital Technologies27 mov ax, [1] mov ax 0 1 4 3 2 1 Fetch-Exec : State 3 ALU Operation 1 8 3 7 1 9
28
CBP 2004-5Comp 1017 Digital Technologies28 mov ax, [1] mov ax 0 1 4 3 2 1 Fetch-Exec : State 4 Memory Access 1 8 3 7 1 9 8
29
CBP 2004-5Comp 1017 Digital Technologies29 mov ax, [1] mov ax 0 1 4 3 2 1 Fetch-Exec : State 5 Register Write 1 8 3 7 1 9 8 8
30
CBP 2004-5Comp 1017 Digital Technologies30 Pentium 5 1 2 3 4 1.Fetch 2.Decode 3.ALU 4.Mem Ops 5.Reg Write
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.