De presentatie wordt gedownload. Even geduld aub

De presentatie wordt gedownload. Even geduld aub

Inleiding Informatica, 2000-2001 College 2, H 2 - nr1 17 October 2000 - 13:50 Basiscursus Informatica 98/991 SWI Inleiding Informatica Brookshear hoofdstuk.

Verwante presentaties


Presentatie over: "Inleiding Informatica, 2000-2001 College 2, H 2 - nr1 17 October 2000 - 13:50 Basiscursus Informatica 98/991 SWI Inleiding Informatica Brookshear hoofdstuk."— Transcript van de presentatie:

1

2 Inleiding Informatica, 2000-2001 College 2, H 2 - nr1 17 October 2000 - 13:50 Basiscursus Informatica 98/991 SWI Inleiding Informatica Brookshear hoofdstuk 2 Data Manipulatie

3 Inleiding Informatica, 2000-2001 College 2, H 2 - nr2 17 October 2000 - 13:50 Basiscursus Informatica 98/992 Overzicht college 3 n 2.1 Central processing unit (CPU) n 2.2 Stored-program concept n 2.3 Progamma executie n NIET: 2.4 Rekenkundige/logische instructies n 2.5 Communicatie met randapparatuur n NIET: 2.6 Andere architecturen

4 Inleiding Informatica, 2000-2001 College 2, H 2 - nr3 17 October 2000 - 13:50 Basiscursus Informatica 98/993 Overzicht college 3 n 2.1 Central processing unit (CPU) n 2.2 Stored-program concept n 2.3 Progamma executie n 2.5 Communicatie met randapparatuur

5 Inleiding Informatica, 2000-2001 College 2, H 2 - nr4 17 October 2000 - 13:50 Basiscursus Informatica 98/994 Eenvoudig CPU model Arithmetic/ Logic Unit Control Unit CPU Main memory Registers Bus

6 Inleiding Informatica, 2000-2001 College 2, H 2 - nr5 17 October 2000 - 13:50 Basiscursus Informatica 98/995 CPU n Cruciaal onderdeel van computer dat bewerkingen uitvoert: ä 1. controle eenheid: coördinatie van uitvoering instructies ä 2. ALU = rekenkundige/logische eenheid: voert instructies uit ä 3. registers: zeer tijdelijke opslag in CPU voor data en instructies

7 Inleiding Informatica, 2000-2001 College 2, H 2 - nr6 17 October 2000 - 13:50 Basiscursus Informatica 98/996 Bus en Cache n Bus: snelle verbinding tussen CPU en werkgeheugen n Cache: hulpgeheugen van CPU, vormt snelle buffer tussen CPU en werkgeheugen ä voordeel: snelle toegang voor CPU ä voordeel: ontlasting van de bus

8 Inleiding Informatica, 2000-2001 College 2, H 2 - nr7 17 October 2000 - 13:50 Basiscursus Informatica 98/997 Soorten computer geheugen computer memory main memorymass storage CPU Arithmetic/ Logic Unit Control unit registerscache generalspecial purpose

9 Inleiding Informatica, 2000-2001 College 2, H 2 - nr8 17 October 2000 - 13:50 Basiscursus Informatica 98/998 Registers n Algemene registers (general purpose): bevatten doorgaande invoer en uitvoer naar ALU n Speciale registers: programma-teller en instructie register (komt later in par 2.3)

10 Inleiding Informatica, 2000-2001 College 2, H 2 - nr9 17 October 2000 - 13:50 Basiscursus Informatica 98/999 Taken controle eenheid n Verplaatst data van werkgeheugen/cache naar de algemene registers van CPU n Geeft door aan ALU in welke registers de data zitten n Activeert ALU n Geeft door aan ALU in welk register resultaat gezet moet worden

11 Inleiding Informatica, 2000-2001 College 2, H 2 - nr10 17 October 2000 - 13:50 Basiscursus Informatica 98/9910 Bereken: x + y = z n Stap 1. Haal waarde x op, stop in register 1 n Stap 2. Haal waarde y op, stop in register 2 n Stap 3. Activeer optel-circuit (ALU) met inhoud van regs 1, 2 en reg 3 voor resultaat n Stap 4. Zet inhoud register 3 in werkgeheugen n Stap 5. Stop

12 Inleiding Informatica, 2000-2001 College 2, H 2 - nr11 17 October 2000 - 13:50 Basiscursus Informatica 98/9911 Soorten machine-instructies n data transfer instructies (LOAD, STORE) (stap 1, 2, 4) NB. copy, geen move n rekenkundige/logische instructies (AND, OR, XOR, SHIFT, ROTATE) (stap 3) n controle instructies (STOP, JUMP) (stap 5)

13 Inleiding Informatica, 2000-2001 College 2, H 2 - nr12 17 October 2000 - 13:50 Basiscursus Informatica 98/9912 Data transfer instructies Arithmetic/ Logic unit Control Unit CPU Main memory Bus LOAD STORE Registers

14 Inleiding Informatica, 2000-2001 College 2, H 2 - nr13 17 October 2000 - 13:50 Basiscursus Informatica 98/9913 Voorbeeld JUMP n Stap 1 LOAD register 1 met waarde uit geheugen n Stap 2 LOAD register 2 met andere waarde geheugen n Stap 3 JUMP, als 2 e waarde = nul, naar stap 6 n Stap 4 ALU: deel inhoud 1 e register door inhoud 2 e register stop resultaat in 3 e register n Stap 5 STORE inhoud 3 e register in geheugen n Stap 6 STOP

15 Inleiding Informatica, 2000-2001 College 2, H 2 - nr14 17 October 2000 - 13:50 Basiscursus Informatica 98/9914 JUMP n Unconditional JUMP ä spring naar stap 6 n Conditional JUMP ä als waarde = 9, dan spring naar stap 6 n Als 0 = 0, dan spring naar stap 6

16 Inleiding Informatica, 2000-2001 College 2, H 2 - nr15 17 October 2000 - 13:50 Basiscursus Informatica 98/9915 Overzicht college 3 n 2.1 Central processing unit (CPU) n 2.2 Stored-program concept n 2.3 Progamma executie n 2.5 Communicatie met randapparatuur

17 Inleiding Informatica, 2000-2001 College 2, H 2 - nr16 17 October 2000 - 13:50 Basiscursus Informatica 98/9916 ‘Stored-program concept’ n Eerste computers: eenvoudig programma ‘hard-wired’, alleen data gecodeerd n Analogie: wasmachine met vaste was- programma’s, de was is variabel n Later: programma ook gecodeerd, gebruikt vaste, elementaire instructie-set van CPU n Programma en data zitten in hetzelfde geheugen

18 Inleiding Informatica, 2000-2001 College 2, H 2 - nr17 17 October 2000 - 13:50 Basiscursus Informatica 98/9917 Voorbeeld machine (Appendix C) n 16 algemene registers van 8 bits (0.. F) n 2 special purpose registers ä programma teller (1 byte) ä instructie register (2 bytes) n 256 geheugencellen van 8 bits (00.. FF) n machine instructie is 16 bits (2 bytes): ä 4 bits op-code, 12 bits operand

19 Inleiding Informatica, 2000-2001 College 2, H 2 - nr18 17 October 2000 - 13:50 Basiscursus Informatica 98/9918 Hexidecimaal Bit patroonHexidecimaal 00000 00011 00102 00113 01004 01015 01106 01117 10008 10019 Bit patroonHexidecimaal 1010A 1011B 1100C 1101D 1110E 1111F Machine-instructie = 16 bits = 2 bytes = 4 hex codes

20 Inleiding Informatica, 2000-2001 College 2, H 2 - nr19 17 October 2000 - 13:50 Basiscursus Informatica 98/9919 Voorbeeld architectuur CPU Main memory Arithmetic/Logic unit Registers Instruction register Program counter Bus CelAdres 0 1 2 3 F 00 01 02 03 FF.... Control unit

21 Inleiding Informatica, 2000-2001 College 2, H 2 - nr20 17 October 2000 - 13:50 Basiscursus Informatica 98/9920 Machine-instructie n op-code veld ä code voor de basisoperaties (STORE, AND, ADD, JUMP, HALT, etc.) n operand veld ä gedetailleerde info over operatie (registers, geheugen-cellen in operatie 4 hexidecimale cijfers (4 x 4 = 16 bits = 2 bytes) Op-code Operand

22 Inleiding Informatica, 2000-2001 College 2, H 2 - nr21 17 October 2000 - 13:50 Basiscursus Informatica 98/9921 Voorbeeld machinetaal 1RXYLOAD reg R met inhoud van geheugen cel XY bv: 14A3Stop inhoud van cel A3 in reg 4 bv: 1347Stop inhoud van cel 47 in reg 3 2RXYLOAD reg R met bitstring XY bv: 20A3Stop bitstring “A3” in reg 4 bv: 2347Stop bitstring “47” in reg 3 3RXYSTORE inhoud van reg R in geheug cel met adres XY bv: 35B1Stop inhoud van reg 5 in geheug cel B1 40RSMOVE bitstring in reg R naar reg S bv: 40A4Copieer inhoud reg A naar reg 4 5RSTADD bitstrings in reg S en T en stop res in reg R

23 Inleiding Informatica, 2000-2001 College 2, H 2 - nr22 17 October 2000 - 13:50 Basiscursus Informatica 98/9922 Machinetaal (vervolg) 6RSTADD (breuken) 7RSTOR 8RSTAND 9RSTXOR AR0XROTATE BRXYJUMP naar instructie in geheug cel met adres XY als bitstring in reg R gelijk is aan bitstring in reg 0. Anders ga door met volgende instructie B43CAls inhoud reg 4 = reg 0, ga naar geheugencel 3C COOOHALT

24 Inleiding Informatica, 2000-2001 College 2, H 2 - nr23 17 October 2000 - 13:50 Basiscursus Informatica 98/9923 Vragen n Waarom is B03C een onvoorwaardelijke sprong naar de instructie in cel 3C? n Hoeveel instructies kunnen in deze voorbeeld-taal nog worden toegevoegd? n Hoe kent de machine het verschil tussen data en instructies?

25 Inleiding Informatica, 2000-2001 College 2, H 2 - nr24 17 October 2000 - 13:50 Basiscursus Informatica 98/9924 Nogmaals: optellen n Stap 1. Haal 1ste waarde op, stop in register X n Stap 2. Haal 2de waarde op, stop in register Y n Stap 3. Activeer optel-circuit (rek/log) met inhoud van regs X, Y en reg Z voor resultaat n Stap 4. Sla resultaat op in Z n Stap 5. Stop

26 Inleiding Informatica, 2000-2001 College 2, H 2 - nr25 17 October 2000 - 13:50 Basiscursus Informatica 98/9925 Voorbeeld programma n Stap 1. Haal waarde op uit cel 6C, stop in reg 5 n Stap 2. Haal waarde op uit cel 6D, stop in reg 6 n Stap 3. Tel op inhoud reg 5 en 6, stop in reg 0 n Stap 4. Sla resultaat cel 6E n Stap 5. Stop n Stap 1. 156C n Stap 2. 166D n Stap 3. 5056 n Stap 4. 306E n Stap 5. C000

27 Inleiding Informatica, 2000-2001 College 2, H 2 - nr26 17 October 2000 - 13:50 Basiscursus Informatica 98/9926 Overzicht college 3 n 2.1 Central processing unit (CPU) n 2.2 Stored-program concept n 2.3 Progamma executie n 2.5 Communicatie met randapparatuur

28 Inleiding Informatica, 2000-2001 College 2, H 2 - nr27 17 October 2000 - 13:50 Basiscursus Informatica 98/9927 Speciale registers n Programma teller ä geheugenadres van volgende instructie ä rol: bijhouden waar programma is n Instructie register ä bevat de huidige instructie n Machine cyclus van de controle eenheid: ä fetch, decode, execute

29 Inleiding Informatica, 2000-2001 College 2, H 2 - nr28 17 October 2000 - 13:50 Basiscursus Informatica 98/9928 Teller and instructie register CPU Main memory Arithmetic/Logic unit Registers Instruction register Program counter Bus CelAdres 0 1 2 3 F 00 01 02 03 FF.... Control unit

30 Inleiding Informatica, 2000-2001 College 2, H 2 - nr29 17 October 2000 - 13:50 Basiscursus Informatica 98/9929 Machine cyclus n Fetch ä haal volgende instructie op (raadpleeg teller) ä stop in instructie-register ä update teller naar volgende instructie n Decode ä analyseer op-code en operand velden n Execute ä voer instructie uit ä ga naar fetch, tenzij C000

31 Inleiding Informatica, 2000-2001 College 2, H 2 - nr30 17 October 2000 - 13:50 Basiscursus Informatica 98/9930 JUMP instructie n B258: als inhoud reg2=reg0, spring naar instructie in cel 58 n Wat er gebeurt in de “executie”: ä als inhoud reg2=reg0, stop adres “cel 58” in programma teller ä overschrijf oude waarde die eerder in cyclus was opgehaald n Volgende “fetch” heeft nieuw adres (van JUMP)

32 Inleiding Informatica, 2000-2001 College 2, H 2 - nr31 17 October 2000 - 13:50 Basiscursus Informatica 98/9931 Voorbeeld executie n Stap 1. Haal waarde op uit cel 6C, stop in reg 5 n Stap 2. Haal waarde op uit cel 6D, stop in reg 6 n Stap 3. Tel op inhoud reg 5 en 6, stop in reg 0 n Stap 4. Sla resultaat cel 6E n Stap 5. Stop n Stap 1. 156C n Stap 2. 166D n Stap 3. 5056 n Stap 4. 306E n Stap 5. C000

33 Inleiding Informatica, 2000-2001 College 2, H 2 - nr32 17 October 2000 - 13:50 Basiscursus Informatica 98/9932 Programma in geheugen n Stap 1. 156C n Stap 2. 166D n Stap 3. 5056 n Stap 4. 306E n Stap 5. C000 AdresInhoudcel A015 A16C A216 A36D A450 A556 A630 A76E A8C0 A900

34 Inleiding Informatica, 2000-2001 College 2, H 2 - nr33 17 October 2000 - 13:50 Basiscursus Informatica 98/9933 Voorbeeld executie 0 AdresInhoudcel A015 A16C A216 A36D A450 A556 A630 A76E A8C0 A900 n Programma in centraal geheugen ä begin op A0 ä opeenvolgende adressen n 1 cel=1 byte, 1 instructie =2bytes (1 instr in 2 cel) n Teller telkens 2 adressen ophogen (A0, A2, A4,...)

35 Inleiding Informatica, 2000-2001 College 2, H 2 - nr34 17 October 2000 - 13:50 Basiscursus Informatica 98/9934 Voorbeeld executie 1 AdresInhoudcel A015 A16C A216 A36D A450 A556 A630 A76E A8C0 A900 n Begin: teller op A0 n Fetch: 156C + teller A2 n Decode: LOAD n Execute n Na eerste cyclus: ä teller: A2 ä Instructie reg: 156C

36 Inleiding Informatica, 2000-2001 College 2, H 2 - nr35 17 October 2000 - 13:50 Basiscursus Informatica 98/9935 Voorbeeld executie 2 AdresInhoudcel A015 A16C A216 A36D A450 A556 A630 A76E A8C0 A900 n Teller op A2 n Fetch: 166D + teller A4 n Decode: LOAD n Execute n Na tweede cyclus: ä teller: A4 ä Instructie reg: 166D

37 Inleiding Informatica, 2000-2001 College 2, H 2 - nr36 17 October 2000 - 13:50 Basiscursus Informatica 98/9936 Voorbeeld executie 3 AdresInhoudcel A015 A16C A216 A36D A450 A556 A630 A76E A8C0 A900 n Teller op A4 n Fetch: 5056 + teller A6 n Decode: ADD n Execute n Na derde cyclus: ä teller: A6 ä Instructie reg: 5056

38 Inleiding Informatica, 2000-2001 College 2, H 2 - nr37 17 October 2000 - 13:50 Basiscursus Informatica 98/9937 Voorbeeld executie 4 AdresInhoudcel A015 A16C A216 A36D A450 A556 A630 A76E A8C0 A900 n Teller op A6 n Fetch: 306E + teller A8 n Decode: STORE n Execute n Na vierde cyclus: ä teller: A8 ä Instructie reg: 306E

39 Inleiding Informatica, 2000-2001 College 2, H 2 - nr38 17 October 2000 - 13:50 Basiscursus Informatica 98/9938 Voorbeeld executie 5 AdresInhoudcel A015 A16C A216 A36D A450 A556 A630 A76E A8C0 A900 AA n Teller op A8 n Fetch: C000 + teller AA n Decode: HALT n Execute n Na vijfde cyclus: ä teller: AA ä programma is klaar

40 Inleiding Informatica, 2000-2001 College 2, H 2 - nr39 17 October 2000 - 13:50 Basiscursus Informatica 98/9939 Programma versus Data n Beide worden bewaard in centraal geheugen n Beide bestaan uit bitstrings n Machine weet niet of bits programma of data is n Wat gebeurt er als de teller een geheugenadres aangeeft met gewone data?

41 Inleiding Informatica, 2000-2001 College 2, H 2 - nr40 17 October 2000 - 13:50 Basiscursus Informatica 98/9940 Overzicht college 3 n 2.1 Central processing unit (CPU) n 2.2 Stored-program concept n 2.3 Progamma executie n 2.5 Communicatie met randapparatuur

42 Inleiding Informatica, 2000-2001 College 2, H 2 - nr41 17 October 2000 - 13:50 Basis cursus SWI 97-141 Randapparatuur n Printer n Modem n Extra disk n Soundblaster n Zipdrive n etc.

43 Inleiding Informatica, 2000-2001 College 2, H 2 - nr42 17 October 2000 - 13:50 Basiscursus Informatica 98/9942 Bus verbindingen Randapparaat Bus Main memoryControllerCPUControllerRandapparaat Elk randapparaat heeft eigen controler

44 Inleiding Informatica, 2000-2001 College 2, H 2 - nr43 17 October 2000 - 13:50 Basiscursus Informatica 98/9943 Controller n Insteekmodule of vast op moederbord, elk ‘device’ heeft eigen controller n Kleine computertjes op zich die een randapparaat aansturen n Kan soms direct werkgeheugen lezen door bus --> Direct Memory Access (DMA) ä bus competitie: Von Neuman bottleneck n CPU kan controler vragen data te lezen en op bepaald adres tijdelijk op te slaan (buffer)

45 Inleiding Informatica, 2000-2001 College 2, H 2 - nr44 17 October 2000 - 13:50 Basiscursus Informatica 98/9944 Communicatie: contr-CPU n Analoog aan CPU-werkgeheugen n Memory-mapped: controller is “onderdeel” van werkgeheugen (1 adres-systeem) n Niet memory-mapped: aparte adressering ä I/O adres (bv. D82A ipv 382A) n Poort: representeert de toegang tot het ‘geheugengebied’ van een controller

46 Inleiding Informatica, 2000-2001 College 2, H 2 - nr45 17 October 2000 - 13:50 Basiscursus Informatica 98/9945 2-weg communicatie n Controller communiceert met CPU, maar ook met randapparatuur n Controller stuurt randapparatuur aan, maar krijgt ook ‘status’ informatie terug, bv ‘ready’ signaal, ‘out-of-paper’, ‘cannot read’, etc. n Speciaal bitpatroon van het randapparaat: status word, bepaalt mede de normale verwerking van een programma

47 Inleiding Informatica, 2000-2001 College 2, H 2 - nr46 17 October 2000 - 13:50 Basiscursus Informatica 98/9946 Parallelle/seriële comm. n Parallel: bits in string worden parallel verstuurd ä elke bit op een apart kanaal ä snel, maar vereist moderne technologie n Serieel: bit voor bit op zelfde kanaal ä kan met oudere tech., bv. telefoonlijn/modem n Snelheid in bps (bits per second) ä glasvezel: > 100 Mbps en meer


Download ppt "Inleiding Informatica, 2000-2001 College 2, H 2 - nr1 17 October 2000 - 13:50 Basiscursus Informatica 98/991 SWI Inleiding Informatica Brookshear hoofdstuk."

Verwante presentaties


Ads door Google