cse120wi11lec10[1] instruct execution parts
Post on 08-Apr-2018
217 Views
Preview:
TRANSCRIPT
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 1/31
Asbinary,whatis11111111 +1
1/26/11 © 2010 Larry Snyder, CSE 1
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 2/31
StartbycheckingtheProcessingReference
Whatdoyounoticefromtheirexample?
1/26/11 © 2010 Larry Snyder, CSE 2
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 3/31
CreateaFontFromUnderTools
1/26/11 © 2010 Larry Snyder, CSE 3
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 4/31
Pickafont;rememberits
nameandsize!
1/26/11 © 2010 Larry Snyder, CSE 4
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 5/31
Checkthestepsintheexample
loadFont();announcefontwithtextFont();use
1/26/11 © 2010 Larry Snyder, CSE 5
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 6/31
1/26/11 © 2010 Larry Snyder, CSE 6
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 7/31
LawrenceSnyderUniversityofWashington,Seattle
© Lawrence Snyder 2004
Remember Back To The Lightbot
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 8/31
Ourfirstdiscussionof Lightbotnotedthat
theinstructionswere
formedofcompositeoperations…
Today…weseethatcomputer’s
instructionsare,too
1/26/11 © 2010 Larry Snyder, CSE 8
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 9/31
1/26/11 © 2010 Larry Snyder, CSE 99
Deterministicallyexecuteinstructionstoprocessinformation
“Deterministically”meansthatwhenacomputer
choosesthenextinstructiontoperformitisrequiredbyitsconstructiontoexecuteaspecificinstruction
basedonlyontheprogramandinputitisgiven
Computers have no freewill and they are not cruel
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 10/31
1/26/11 © 2010 Larry Snyder, CSE 1010
Computer=instructionexecutionengine▪ Thefetch/executecycleistheprocessthatexecutes
instructions
Thecomputerinternalpartsimplementthis
cycle
Instruction Fetch (IF)
Instruction Decode (ID)
Data Fetch (DF)Instruction Execution (EX)
Result Return (RR)
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 11/31
1/26/11 © 2010 Larry Snyder, CSE 1111
The Hard Disk is the α-device
Mouse
Keyboard
Scanner
Hard DiskFloppy Disk
Monitor
Printer
SpeakersMemory Output
ALU Control Input
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 12/31
1/26/11 © 2010 Larry Snyder, CSE 1212
Programsandtheirdatamustbeinthememory
whiletheyarerunning
0
G
1
o
2
D
3
a
4
w
5
g
6
s
7
!
8
!
9
0
10
...
11
0
byte=8 bits
1 0 0 0 1 0 0
memory addressesMemory locations
memory contents
Groups of four
bytes are a word
Memory Output
ALU Control Input
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 13/31
1/26/11 © 2010 Larry Snyder, CSE 1313
Fetch/Executecycleishardwiredincomputer’s
control;it’sthe“engine”
The instructions executed have the form
ADDB 20, 10, 16
6
10 11 12 13 14 15
12
16 17 18 19
18
20
...
21
Put in memory location 20 the contents of memory
location 10 + contents of memory location 16
Memory Output
ALU Control Input
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 14/31
1/26/11 © 2010 Larry Snyder, CSE 1414
Instructionstellwherethedatais,notwhat thedatais…contentschange
One instruction has many effects
ADDB 20, 10, 16
8
10 11 12 13 14 15
7
16 17 18 19
15
20
...
21
60
10 11 12 13 14 15
-55
16 17 18 19
5
20
...
21
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 15/31
1/26/11 © 2010 Larry Snyder, CSE 1515
Arithmetic/LogicUnitdoestheactualcomputing
Most computers have only about
a 100-150 instructions hard wired
Each type of data has its own separate instructionsADDB : add bytes ADDBU : add bytes unsigned
ADDH : add half words ADDHU : add halves unsigned
ADD : add words ADDU : add words unsigned
ADDS : add short decimal numbers
ADDD : add long decimal numbers
Memory Output
ALU Control Input
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 16/31
1/26/11 © 2010 Larry Snyder, CSE 1616
Inputunitsbringdatatomemoryfromoutsideworld;outputunitssenddatatooutsideworldfrommemory
▪ Most peripheral devices are “dumb” meaning that
the processor assists in their operation▪ Disks are memory devices because they can
output information and input it back again
Memory Output
ALU Control Input
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 17/31
1/26/11 © 2010 Larry Snyder, CSE 1717
Theprogramcounter(PC)tellswherethenextinstructioncomesfrom
▪ Instructionsareawordlong,soadd4tothePCtofindthenextinstruction
110 111 112 113 114 115 116 117 118 119 120
...
121
ADD 210,216,220 AND 414,418,720
Program Counter: 112
OR688,724
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 18/31
RunInstruction:2200:Add800,428,884
1/26/11 © 2010 Larry Snyder, CSE 18
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 19/31
1/26/11 © 2010 Larry Snyder, CSE 19
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 20/31
1/26/11 © 2010 Larry Snyder, CSE 20
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 21/31
1/26/11 © 2010 Larry Snyder, CSE 21
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 22/31
1/26/11 © 2010 Larry Snyder, CSE 22
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 23/31
1/26/11 © 2010 Larry Snyder, CSE 23
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 24/31
1/26/11 © 2010 Larry Snyder, CSE 2424
Therateacomputer“spinsaround”theFetch/Executecycleiscontrolledbyit’s
clock
▪ Currentclocksrun2‐3GHz▪ Inprinciple,thecomputershoulddooneinstruction
percycle,butoftenitfailsto
▪ Modernprocessorstrytodomorethanone
instructionpercycle,andoftensucceed
Clock rate is not a good indicator of speed
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 25/31
1/26/11 © 2010 Larry Snyder, CSE 2525
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 26/31
1/26/11 © 2010 Larry Snyder, CSE 26
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 27/31
1/26/11 © 2010 Larry Snyder, CSE 2727
Silicon,asemiconductor‐‐sometimesitconductsandsometimesitdoesn’t
▪ It’spossibletocontrolwhensemiconductorsdoanddon’tconduct
Ex.:AND428,884,800
Send “yes” signal on wire
Make semiconductor conduct
if memory location 428 is true
Detect presence/absence of “yes”
Make semiconductor conduct
if memory location 884 is true
Compute by controlling conducting
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 28/31
1/26/11 © 2010 Larry Snyder, CSE 2828
A transistor has 3 wires
ChannelGate
Chargedobjectsarefamiliar‐‐useanyloncombonadryday
▪ Achargedfieldcancontrolwhether
▪ asemiconductorconductsornot
Thechargeofthecontrolwire(gate)iskey
▪ Neutralgate,channeldoesn’tconduct
▪ Chargedgate,channelconducts
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 29/31
1/26/11 © 2010 Larry Snyder, CSE 2929
Thefield‐effectideaisimplementedinmetal‐oxide‐semiconductortransistors
SchematicinSi
Wire Wire
GateInsulator
Channel
Cross section view View from above
Silicon
Slice across chip, look end on From Above
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 30/31
1/26/11 © 2010 Larry Snyder, CSE 301/26/11 © 2010 Larry Snyder, CSE 30
8/6/2019 Cse120wi11lec10[1] Instruct Execution Parts
http://slidepdf.com/reader/full/cse120wi11lec101-instruct-execution-parts 31/31
1/26/11 © 2010 Larry Snyder, CSE 3131
Fetch/executecyclerunsinstructions 5stepstointerpretmachineinstructions
Programsmustbeinthememory
Dataismovedinandoutofmemory
Instructions, data are represented in binary
top related