01 csap ch1 introduction

Upload: anthony-kwo

Post on 02-Jun-2018

239 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/11/2019 01 CSAP Ch1 Introduction

    1/35

    !"#$%% '()*+,-. /.012,-0,+.-

    '13*,-. % 45,.(6+07(5

    8-9(:31 ;-9529 !:-9,.( 635 452 ?356+5>

  • 8/11/2019 01 CSAP Ch1 Introduction

    2/35

    45,.(6+07(5

    !

    ;2)-@ A-65-=63B C@$$ D %$@$$E.263B F@$$ D C@$$

    ! G:30-@ A-65-=63B C%#H

    E.263B CIIJ

    !

    45=,.+0,(.@ K.L M+=*.3=3*,3 N+7O3.=3! PQ0-@ 82>53: 356 8B=,-) "3RS "3R;-9 T444 #.6E:((.

    ! G1(5-@ IU$$CHU

    ! !)32:@ =(52V=,-2L2,RL30L26

    !

    PQ0- W(+.=@ ?B /**(25,)-5, ,1.(+>1 -)32:X*1(5-

  • 8/11/2019 01 CSAP Ch1 Introduction

    3/35

    Y-Z+2=2,-

    !

    !"#"#$%&'&(#! !"I$CU K2>2,3: 8B=,-)

    ! *+"#$%&',(#

    ! !"#%%$ '()*+,-. /.012,-0,+.- "3R(.3,(.B

  • 8/11/2019 01 CSAP Ch1 Introduction

    4/35

    ':3== 45352`37(5 356 K-=2>5@ ;1- 8(ab3.- W3.6b3.- 45,-.35 M3+

  • 8/11/2019 01 CSAP Ch1 Introduction

    5/35

    *-.'' /''#'0#1(

    !

    W()-b(.9 #$c! d+2` %$c

    ! ![3) e$c

  • 8/11/2019 01 CSAP Ch1 Introduction

    6/35

    f.3625> 803:-

    !

    / g C$c! /? H$c D HCc

    ! ? F$c D FCc

    ! ?' e$c D eCc

    !

    ' U$c D UCc! K J$c D JCc

    ! ! h #Cc

  • 8/11/2019 01 CSAP Ch1 Introduction

    7/35

    '(+.=- PRO-07\-=

    !

    ;12= 0(+.=- b2:: >2\- B(+ 35 25D6-*,1 +56-.=,35625> (< ,1-&11#"23+"4&15' +6 0+7#"1 7&5&(.- 8+09%(#" ':'(#0' .17

    (".7#+;' 9"#'#1( .( (

  • 8/11/2019 01 CSAP Ch1 Introduction

    8/35

    '(+.=-

    =01-6+:-

    >##4 ?+9&8' @#6#"#18#

    %8B::3R+= 356 W2=,(.B (< 0()*+,-.=

    G-.:- 0B0:-n W3.6b2.-6

    45,.( ,( TWK"jGkWl '1J

    CK3,3 *3,1 m)+:7 0B0:-n W3.6b2.-6

    TWK"oIjGkWl '1J

    %$ G2*-:2525> jGkWl '1J

    %%G2*-:2525>

    N-)(.B W2-.3.01B

    jGkWl '1J

    jGkWl '1U

    %IN-)(.B ;-015(:(>B

    '301-j'8/Gl '1e

    %#'301-

    T2.,+3: N-)(.B

    j'8/Gl '1e

    j'8/Gl '1%$

    %J45,-.- 8B=,-)jGkWl '1e

    %U 45,.( ,( G3.3::-: G.(0-==25> jGkWl '1F

    %e E253: ![3)

  • 8/11/2019 01 CSAP Ch1 Introduction

    9/35

    / ;(+. (< '()*+,-. 8B=,-)=

  • 8/11/2019 01 CSAP Ch1 Introduction

    10/35

    ;(*20=

    !

    p56-.=,35625> (< 0()*+,-. =B=,-)! '()*2:-. 8B=,-)

    ! W3.6b3.- P.>352`37(5=

    ! ?+=S 4XP K-\20-S N-)(.BS G.(0-==(.

    !

    '301- )-)(.B! P*-.375> 8B=,-)

    ! T2.,+3: )-)(.B

  • 8/11/2019 01 CSAP Ch1 Introduction

    11/35

    '()*+,-. 8B=,-)

    !

    W3.6b3.- 356 P*-.375> =B=,-) b(.9= ,(>-,1-. ,(-[-0+,- 35 3**:2037(5L

    ! 4)*:-)-5,37(5 (< 3 0()*+,-. 035 0135>- R+, 5(, ,1-

    0(50-*,

  • 8/11/2019 01 CSAP Ch1 Introduction

    12/35

    A1B B(+ =1(+:6 R- 25 ,12= 0:3==q

    !

    ;( R-0()- 95(b:-6>-3R:- 3R(+, ,1- 25,-.307(5R-,b--5 =(ab3.- 356 13.6b3.-L

    ! "-3.5 ,( 3\(26 5+)-.20 -..(.

    ! "-3.5 ,( -[*:(2, ,1- +56-.:B25> 13.6b3.-

    !

    "-3.5 ,1- 6-,32:= (< 6-=2>525> 3 *.(0-==(. mN4G8n

  • 8/11/2019 01 CSAP Ch1 Introduction

    13/35

    G.(>.3) !"##$

    !

    ':3==20 r.=, *.(>.3)! !"##$*.(>.3) 2= 0.-3,-6 +=25> 3 ,-[, -62,(. 356 =3\-6

    3= !"##$&'

    ! 8(+.0- *.(>.3) 2= 3 =-Z+-50- (< R2,=S -301 b2,1 3 \3:+- $ (. %S

    (.>352`-6 25,( H R2,= 03::-6 RB,-

    !

    !301 RB,- .-*.-=-5,= 3 013.30,-.

    ! !"##$&'2= =,(.-6 25 3 r:- 3= 3 =-Z+-50- (< RB,-=L

  • 8/11/2019 01 CSAP Ch1 Introduction

    14/35

    !"##$G.(>.3)

    !

    A.2_-5 25 12>1 :-\-: :35>+3>- '! '(6- @

    %L o250:+6- h=,62(L1g

    IL

    #L 25, )325m\(26n

    JL s

    UL *.25tmu1-::(S b(.:6v5wnx

    eL .-,+.5m$nx

    FL y

  • 8/11/2019 01 CSAP Ch1 Introduction

    15/35

    !"##$G.(>.3)

    !

    !\-.B ' =,3,-)-5, )+=, R- ,.35=:3,-6 ,( )30125-25=,.+07(5= m25 R253.Bn

    ! ;1-=- 25==,.+07(5= 3.- ,1-5 *3093>-6 25,( 35 -[-0+,3R:-

    (RO-0, *.(>.3) 356 =,(.-6 25 3 R253.B r:-

    ! ;.35=:37(5 *.(0-== 2= *-.

  • 8/11/2019 01 CSAP Ch1 Introduction

    16/35

    '()*2:37(5 8B=,-)

    ! G.-*.(0-==25> *13=-

    ! *.-*.(0-==(. m0**n )(62r-= ,1- (.2>253: ' *.(>.3) 300(.625>

    ,( ,1- o 62.-07\-

    ! ![3)*:-@ o250:+6- h=,62(L1g ,-::= ,1- *.-*.(0-==(. ,( .-36 ,1-

    =,62(L1 r:- 356 25=-., 2, 25,( ,1- *.(>.3) ,-[,L

    ! '()*2:37(5 *13=-

    !

    0()*2:-. m00:n ,.35=:3,-= ,1- ,-[, r:- 1-::(L2 25,( ,1- ,-[, r:-1-::(L= b1201 0(5,325= 35 3==-)R:B :35>+3>- *.(>.3)L !301

    =,3,-)-5, 25 35 3==-)R:B :35>+3>- .-*.-=-5,= (5- )30125-D

    :35>+3>- 25=,.+07(5 25 3 ,-[,

  • 8/11/2019 01 CSAP Ch1 Introduction

    17/35

    '()*2:37(5 8B=,-)

    ! /==-)R:B *13=-

    !

    3==-)R:-. m3=n ,.35=:3,-= 1-::(L= 25,( )30125-D:35>+3>-25=,.+07(5=S *3093>-= ,1-5 25,( 3 .-:(03,3R:- (RO-0, *.(>.3)

    356 =,(.- ,1- .-=+:, 25,( 3 r:- 1-::(L(

    ! "25925> *13=-

    ! :259-. m:6n )-.>-= 1-::(L( b2,1 *.25tL( 356 ,1- .-=+:, 2= 35

    -[-0+,3R:- (RO-0, r:-

  • 8/11/2019 01 CSAP Ch1 Introduction

    18/35

    p56-.=,356 1(b 0()*2:37(5 =B=,-) b(.9=

    !

    P*7)2`25> *.(>.3) *-.

  • 8/11/2019 01 CSAP Ch1 Introduction

    19/35

    W3.6b3.- P.>352`37(5

    !

    ;( +56-.=,356 b13, 13**-5= b1-5 b- .+5 ,1- 1-::(*.(>.3)S b- 5--6 ,( 95(b 1(b ,1- 13.6b3.- 2=

    (.>352`-6L

    ! 45 >-5-.3: ,1- 0()*(5-5, (< 3 0()*+,-. =B=,-) 0(5=2=,=

    (< @

    ! ?+=

    ! 4XP 6-\20-=

    ! N325 N-)(.B

    ! G.(0-==(.

  • 8/11/2019 01 CSAP Ch1 Introduction

    20/35

    W3.6b3.- P.>352`37(5

    Personal Computer

    Processor(active)

    Computer

    Control(brain)

    Datapath

    (brawn)

    Memory(passive)

    (whereprograms,datalive whenrunning)

    Devices

    Input

    Output

    Keyboard,Mouse

    Display,Printer

    Disk(whereprograms,datalive whennot running)

  • 8/11/2019 01 CSAP Ch1 Introduction

    21/35

    W3.6b3.- P.>352`37(5

    main

    memory

    I/O

    bridge

    bus interface

    ALU

    register file

    CPU chip

    system bus memory bus

    Hard diskcontroller

    graphicsadapter

    USBcontroller

    mouse keyboard monitor

    disk

    I/O bus Expansion slotsuntuk devais lain

    seperti LAN, dll

    21

  • 8/11/2019 01 CSAP Ch1 Introduction

    22/35

    W3.6b3.- P.>352`37(5

    !

    ?+=! G3.3::-: 0(56+2,= ,13, 03..B RB,-= (< 252\-5 25 b(.6=

    ! 45,-: G-57+)S b(.6 =2`- | J RB,-=

    !

    45,-: 4,352+)S b(.6 =2`- | H RB,-=

    !

    !)R-66-6S b(.6 =2`- | % (. I RB,-=

    ! 4XP K-\20-=

    ! '(55-07(5 ,( ,1- (+,=26- b(.:6

    ! ![3)*:-@ 9-BR(3.6S )(+=-S )(52,(.S 62=9 6.2\- m62=9n

    ! !\-.B 4XP 6-\20- 2= 0(55-0,-6 +=25> 3 0(5,.(::-. (. 363*,-.

    !

    '(5,.(::-. @ 012* =-, 25 ,1- 6-\20- 2,=-:< (. (5 ,1- )(,1-.R(3.6

    !

    /63*,-. @ 03.6 ,13, *:+>= 25,( ,( ,1- =:(, (< ,1- )(,1-.R(3.6

  • 8/11/2019 01 CSAP Ch1 Introduction

    23/35

    W3.6b3.- P.>352`37(5

    !

    N325 N-)(.B!

    ;-)*(.3.B =,(.3>- ,13, 1(:6= R(,1 *.(>.3) 356 63,3 2, )352*+:3,-=b12:- ,1- *.(0-==(. 2= .+5525> ,1- *.(>.3)L

    ! G1B=203::BS ,1- )325 )-)(.B 2= 3 0(::-07(5 (< KB53)20 Y356() /00-==N-)(.B mKY/Nn

    ! "(>203::BS ,1- )325 )-)(.B 2= 3 (.>352`-6 3= 3 :25-3. 3..3B

    !

    G.(0-==(. m'-5,.3: G.(0-==25> p52, c 'Gpn!

    ;1- -5>25- ,13, -[-0+,-= ,1- 25=,.+07(5= =,(.-6 25 ,1- )325 )-)(.B

    !

    '(5=2=,= (< .->2=,-.=S /"p 356 *.(>.3) 0(+5,-. mG'n

    ! /, 35B *(25, (< 7)- ,1- G' m0(5,325= 366.-==n 2= 3:b3B= *(25,= ,( 3525=,.+07(5 25 ,1- )325 )-)(.BL

    ! G.(0-==(. 2= 3:b3B= 6(25> ,1- =3)- ,3=9 (\-. 356 (\-. 3>325

    ! Y-36 35 25=,.+07(5

  • 8/11/2019 01 CSAP Ch1 Introduction

    24/35

    W3.6b3.- P.>352`37(5

    !

    G.(0-==(.! W3= (5:B 3 2=,-.= 356 3.2,1)-70X:(>20 +52, /"p

    ! @#5&'(#"@ 2=,-.

    !

    DEF @#.7 @ 0(*B 3 RB,- (. 3 b(.6 2=,-.! DEF >"&(# @0(*B 3 RB,- (. 3 b(.6 2=,-. ,( 35 4XP 6-\20-

  • 8/11/2019 01 CSAP Ch1 Introduction

    25/35

    ![-0+75> hello9"+5".0 m%n

    main

    memory

    I/O

    bridge

    bus interface

    ALU

    register file

    CPU chip

    system bus memory bus

    Hard diskcontroller

    graphicsadapter

    USBcontroller

    mousekeyboard monitor

    disk

    I/O busExpansion slotsFor other devices

    such as networkadapter, etc

    !

    Read the !"##$command from keyboard

    hello

    usertypes

    hello

    25

  • 8/11/2019 01 CSAP Ch1 Introduction

    26/35

    ![-0+75> hello*.(>.3) mIn

    main

    memory

    I/O

    bridge

    bus interface

    ALU

    register file

    CPU chip

    system bus memory bus

    Hard diskcontroller

    graphicsadapter

    USBcontroller

    mousekeyboard monitor

    disk

    I/O bus Expansion slotsuntuk devais lain

    seperti LAN, dll

    !Loading theexecutable from disk to

    main memory

    hello executable

    stored on disk

    hello, world\n

    kode hello

    26

  • 8/11/2019 01 CSAP Ch1 Introduction

    27/35

    ![-0+75> hello*.(>.3) m#n

    main

    memory

    I/O

    bridge

    bus interface

    ALU

    register file

    CPU chip

    system bus memory bus

    Hard diskcontroller

    graphicsadapter

    USBcontroller

    mousekeyboard monitor

    disk

    I/O bus Expansion slotsfor other devices

    such as LAN, etc

    A.275> (+,*+,

  • 8/11/2019 01 CSAP Ch1 Introduction

    28/35

    N-)(.B W2-.3.01B

  • 8/11/2019 01 CSAP Ch1 Introduction

    29/35

    '301- N-)(.B

    !

    '301- )-)(.B 2= 5--6-6 ,( =(:\- ,1- *.(R:-) (< =*--662z-.-50- R-,b--5 ,1- *.(0-==(. 356 )325 )-)(.B

    ! '301- 2= 3 12>1 =*--6 =,370 Y/N m2=,-.=n

    ! '301- 1(:6= ,1- )(=, .-0-5,:B 300-=-=-6 25

  • 8/11/2019 01 CSAP Ch1 Introduction

    30/35

    ;1- P8 )353>-= ,1- WA

    !

    G.2)3.B G+.*(=-@! N353>-= 3:: 13.6b3.- 0()*(5-5,=

    ! G.(\26- 3**:2037(5= b2,1 b2)*:- 356 +52

  • 8/11/2019 01 CSAP Ch1 Introduction

    31/35

    /R=,.307(5=

    ! G.(0-==!

    4= ,1- P8 3R=,.307(5 (< .+5525> *.(>.3)

    !

    N+:7*:- *.(0-== 035 .+5 0(50+..-5,:B

    !

    P8 9--*= ,.309 (< 3:: ,1- =,3,- 25:(R3: 63,3

    Processor Main memory I/O devices

    Processes

    Files

    Virtual memory

  • 8/11/2019 01 CSAP Ch1 Introduction

    32/35

  • 8/11/2019 01 CSAP Ch1 Introduction

    33/35

    E2:-=

    !

    / =-Z+-50- (< RB,-=! !\-.B 4XP 6-\20- 2= )(6-:-6 3= 3 r:-

    ! /:: 25*+, 356 (+,*+, 2= *-. 356 b.275>

    r:-= mp52[ 4XPn

  • 8/11/2019 01 CSAP Ch1 Introduction

    34/35

    '()*+,-. /R=,.307(5

    I/O systemProcessor

    Compiler

    Operating

    System

    (Windows 98)

    Application (Netscape)

    Digital Design

    Circuit Design

    Instruction SetArchitecture

    ! Both Software and Hardware consist of hierarchical layers.!

    Each lower layer hides the complexity from the layer above

    ! This abstraction principle is the way to cope with complexity

    Datapath & Control

    transistors

    MemoryHardware

    Software Assembler

    EL3011

  • 8/11/2019 01 CSAP Ch1 Introduction

    35/35

    ;1- ?2> G20,+.-

    35

    Both hardware and software consist of hierarchicallayers, with each lower layer hiding details from thelevel above. This principle of abstraction is the wayboth hardware designers and software designers copewith the complexity of computer systems.One key

    interface between the levels of abstraction is theinstruction set architecture: the interface between thehardware and low-level software. This abstractinterface enables many implementations of varyingcost and performance to run identical software.

    John L. Hennessy

    David A. Patterson