De presentatie wordt gedownload. Even geduld aub

De presentatie wordt gedownload. Even geduld aub

Basiscursus Informatica, 98-99 College 2, H 2 1 Basiscursus Informatica 98/991 Basiscursus Informatica College 2, Data Manupulatie Brookshear H2 Richard.

Verwante presentaties


Presentatie over: "Basiscursus Informatica, 98-99 College 2, H 2 1 Basiscursus Informatica 98/991 Basiscursus Informatica College 2, Data Manupulatie Brookshear H2 Richard."— Transcript van de presentatie:

1

2 Basiscursus Informatica, 98-99 College 2, H 2 1 Basiscursus Informatica 98/991 Basiscursus Informatica College 2, Data Manupulatie Brookshear H2 Richard Benjamins

3 Basiscursus Informatica, 98-99 College 2, H 2 2 Basiscursus Informatica 98/992 Overzicht college 2 n Central processing unit (CPU) n Stored-program concept n Progamma executie n Andere architecturen n Rekenkundige/logische instructies n Communicatie met randapparatuur

4 Basiscursus Informatica, 98-99 College 2, H 2 3 Basiscursus Informatica 98/993 CPU n Deel van computer dat operaties uitvoert ä rekenkundige/logische eenheid: data manipulatie ä controle eenheid: coordinatie machine-activiteiten n Registers: tijdelijke opslag in CPU voor data die gemanipuleerd gaat worden (is) n Cache geheugen: bevat copie van relevant deel centraal geheugen

5 Basiscursus Informatica, 98-99 College 2, H 2 4 Basiscursus Informatica 98/994 Interface CPU-Main memory Arithmetic/ Logic unit Control Unit CPU Main memory Registers Bus

6 Basiscursus Informatica, 98-99 College 2, H 2 5 Basiscursus Informatica 98/995 Controle eenheid n Haalt data op uit centraal geheugen n Stopt het in register van CPU n Informeert rek/log unit in welke registers de data zit n Activeert rek/log unit n Zegt rek/log unit in welk register resultaat te stoppen

7 Basiscursus Informatica, 98-99 College 2, H 2 6 Basiscursus Informatica 98/996 Computer geheugen computer memory main memorymass storage CPU arithmetic/ logic unit control unit registerscache generalspecial purpose

8 Basiscursus Informatica, 98-99 College 2, H 2 7 Basiscursus Informatica 98/997 Optellen twee waarden 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 Machine-instructies

9 Basiscursus Informatica, 98-99 College 2, H 2 8 Basiscursus Informatica 98/998 Machine-instructies n Drie soorten ä data transfer instructies (LOAD, STORE) (stap 1, 2, 4) – copy, geen move ä rekenkundige/logische instructies (AND, OR, XOR, SHIFT, ROTATE) (stap 3) ä controle instructies (STOP, JUMP) (stap 5)

10 Basiscursus Informatica, 98-99 College 2, H 2 9 Basiscursus Informatica 98/999 Data transfer instructies Arithmetic/ Logic unit Control Unit CPU Main memory Bus LOAD STORE Registers

11 Basiscursus Informatica, 98-99 College 2, H 2 10 Basiscursus Informatica 98/9910 Voorbeeld JUMP n Stap 1 LOAD register met waarde uit memory n Stap 2 LOAD ander register met andere waarde uit memory n Stap 3 Als 2de waarde = nul, JUMP naar stap 6 n Stap 4 Deel inhoud 1ste reg. door inhoud 2de reg, stop resultaat in derde register n Stap 5 STORE inhoud derde register in memory n Stap 6 Stop

12 Basiscursus Informatica, 98-99 College 2, H 2 11 Basiscursus Informatica 98/9911 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 step 6

13 Basiscursus Informatica, 98-99 College 2, H 2 12 Basiscursus Informatica 98/9912 Overzicht college 2 n Central processing unit (CPU) n Stored-program concept n Progamma executie n Andere architecturen n Rekenkundige/logische instructies n Communicatie met randapparatuur

14 Basiscursus Informatica, 98-99 College 2, H 2 13 Basiscursus Informatica 98/9913 Programma is ook data n Programma is niet hard-wired in controle eenheid (niet: ander prog --> andere controle) n Programma zit in main memory ä controle eenheid extraheert programma uit geheugen ä decodeert instructies ä executeert instructies n Dus programma is als data

15 Basiscursus Informatica, 98-99 College 2, H 2 14 Basiscursus Informatica 98/9914 Machine-taal n Machine-instructies + coderingsysteem ä op-code veld –welke basis operaties (STORE, AND, ADD,...) ä operand veld –gedetailleerde info over operatie (registers, geheugen-cellen in operatie 4 hexidecimale cijfers (2 bytes) Op-code Operand

16 Basiscursus Informatica, 98-99 College 2, H 2 15 Basiscursus Informatica 98/9915 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 hexidecimale

17 Basiscursus Informatica, 98-99 College 2, H 2 16 Basiscursus Informatica 98/9916 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

18 Basiscursus Informatica, 98-99 College 2, H 2 17 Basiscursus Informatica 98/9917 Architectuur n 256 geheugen cellen (00-FF) a 1 byte n 16 algemene registers (0-F) a 1 byte n 2 special purpose registers ä programma teller (1 byte) ä instructie register (2 bytes) Arithmetic/Logic unit Registers Instruction register Program counter Bus Cel Adres 0 1 2 3 F 00 01 02 03 FF.... Control unit

19 Basiscursus Informatica, 98-99 College 2, H 2 18 Basiscursus Informatica 98/9918 Machine-instructies (vb) 1RXYLOAD reg R met inhoud van geheug cel XY 14A3Stop inhoud van cel A3 in reg 4 1347Stop inhoud van cel 47 in reg 3 2RXYLOAD reg R met bitstring XY 20A3Stop bitstring “A3” in reg 4 2347Stop bitstring “47” in reg 3 3RXYSTORE inhoud van reg R in geheug cel met adres XY 35B1Stop inhoud van reg 5 in geheug cel B1 40RSMOVE bitstring in reg R naar reg S 40A4Copieer inhoud reg A naar reg 4 5RSTADD bitstrings in reg S en T en stop res in reg R

20 Basiscursus Informatica, 98-99 College 2, H 2 19 Basiscursus Informatica 98/9919 Machine-instructies (vervlog) 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 geheug cel 3C COOOHALT

21 Basiscursus Informatica, 98-99 College 2, H 2 20 Basiscursus Informatica 98/9920 Voorbeeld: 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

22 Basiscursus Informatica, 98-99 College 2, H 2 21 Basiscursus Informatica 98/9921 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

23 Basiscursus Informatica, 98-99 College 2, H 2 22 Basiscursus Informatica 98/9922 Overzicht college 2 n Central processing unit (CPU) n Stored-program concept n Progamma executie n Andere architecturen n Rekenkundige/logische instructies n Communicatie met randapparatuur

24 Basiscursus Informatica, 98-99 College 2, H 2 23 Basiscursus Informatica 98/9923 Controle eenheid n Programma teller ä adres van volgende instructie ä rol: bijhouden waar programma is n Instructie register ä bevat de huidige instructie n Machine cyclus ä fetch, decode, execute

25 Basiscursus Informatica, 98-99 College 2, H 2 24 Basiscursus Informatica 98/9924 Teller and instructie reg 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

26 Basiscursus Informatica, 98-99 College 2, H 2 25 Basiscursus Informatica 98/9925 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

27 Basiscursus Informatica, 98-99 College 2, H 2 26 Basiscursus Informatica 98/9926 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)

28 Basiscursus Informatica, 98-99 College 2, H 2 27 Basiscursus Informatica 98/9927 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

29 Basiscursus Informatica, 98-99 College 2, H 2 28 Basiscursus Informatica 98/9928 Progr. 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

30 Basiscursus Informatica, 98-99 College 2, H 2 29 Basiscursus Informatica 98/9929 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,...)

31 Basiscursus Informatica, 98-99 College 2, H 2 30 Basiscursus Informatica 98/9930 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

32 Basiscursus Informatica, 98-99 College 2, H 2 31 Basiscursus Informatica 98/9931 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

33 Basiscursus Informatica, 98-99 College 2, H 2 32 Basiscursus Informatica 98/9932 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

34 Basiscursus Informatica, 98-99 College 2, H 2 33 Basiscursus Informatica 98/9933 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

35 Basiscursus Informatica, 98-99 College 2, H 2 34 Basiscursus Informatica 98/9934 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

36 Basiscursus Informatica, 98-99 College 2, H 2 35 Basiscursus Informatica 98/9935 Programma versus Data n Beide worden bewaard in centraal geheugen n Beide bestaan uit bitstrings n Machine weet niet of string programma of data is n Wat gebeurt er als de teller een geheugenadres aangeeft met gewone data?

37 Basiscursus Informatica, 98-99 College 2, H 2 36 Basiscursus Informatica 98/9936 Overzicht college 2 n Central processing unit (CPU) n Stored-program concept n Progamma executie n Andere architecturen n Rekenkundige/logische instructies n Communicatie met randapparatuur

38 Basiscursus Informatica, 98-99 College 2, H 2 37 Basiscursus Informatica 98/9937 CISC versus RISC n Je kan een processor uitrusten met zeer complexe ingebouwde operaties (Pentium) ä Complex Instruction Set Computer (CISC) n Je kan ingewikkelde manipulaties ook uitvoeren met sequenties van hele simpele maar snelle operaties (Power PC) ä Restricted Instruction Set Computer (RISC)

39 Basiscursus Informatica, 98-99 College 2, H 2 38 Basiscursus Informatica 98/9938 Voor- en nadelen n CISC ä voordeel: makkelijker te programmeren (macro’s) ä nadelen: moelijker te bouwen, minder algemeen, overhead n RISC ä voordeel: simpeler te bouwen ä nadeel: moeilijker te programmeren (lager nivo machine-taal)

40 Basiscursus Informatica, 98-99 College 2, H 2 39 Basiscursus Informatica 98/9939 CISC n Instructies niet direkt door de CPU uitgevoerd, maar geinterpreteerd door een microprogramma dat weer uit meer elementaire instructies bestaat n Bijvoorbeeld: add @cell-a into @cell-b wordt: ä load cel-a in register 1 (R1) ä load cel-b in register 2 (R2) ä add R1 en R2 (resultaat in R1) ä store R1 in cell-b

41 Basiscursus Informatica, 98-99 College 2, H 2 40 Basiscursus Informatica 98/9940 Pipelining n Verhogen van de capaciteit van CPU n Normaal: fetch decode execute fetch decode execute

42 Basiscursus Informatica, 98-99 College 2, H 2 41 Basiscursus Informatica 98/9941 Pipeline met drie fetch fetch decode fetch decode execute decode execute fetch execute fetch decode fetch decode execute n Op elk moment output n Zonder pijp alleen om de drie n Een JUMP haalt rendement naar beneden

43 Basiscursus Informatica, 98-99 College 2, H 2 42 Basiscursus Informatica 98/9942 Multiprocessor machines n Tot nu toe: ä SISD: single instruction stream, single data stream n Parallel programas uitvoeren en gegevens verwerken ä MIMD: multiple instruction, multiple data –verschillende instructies op verschillende data ä SIMD: single instruction, multiple data –zelfde instructies op verschillende data

44 Basiscursus Informatica, 98-99 College 2, H 2 43 Basiscursus Informatica 98/9943 Problemen parallelle mach. n Load balancing/Scaling ä dynamische taak verdeling onder de beschikbare CPU’s zodat ze allemaal efficient gebruikt worden n Combinatorische explosie van overhead ä hoe meer taken, hoe meer werk in verdeling taken over CPU’s en in coordineren van interactie

45 Basiscursus Informatica, 98-99 College 2, H 2 44 Basiscursus Informatica 98/9944 Overzicht college 2 n Central processing unit (CPU) n Stored-program concept n Progamma executie n Andere architecturen n Rekenkundige/logische instructies n Communicatie met randapparatuur

46 Basiscursus Informatica, 98-99 College 2, H 2 45 Voorbeelden a) 1011001 1101011 AND ---------- 1001001 b) 1011001 1101011 XOR ---------- 0110010 c) 1011001 1101011 OR ---------- 1111011

47 Basiscursus Informatica, 98-99 College 2, H 2 46 Basiscursus Informatica 98/9946 Masking n Bitstring combineren met een masker ä bepalen welk deel van bitstring het resultaat bepaalt ä gebruikt voor bitmaps: elke bit representeert iets n Stel: 8-bit geheugen-cel gebruikt als bitmap ä Is 3de van high-order end aanwezig? ä - - ? - - - - - n Gebruik AND masker: 00100000

48 Basiscursus Informatica, 98-99 College 2, H 2 47 Basiscursus Informatica 98/9947 Maskers 10110011 00100000 AND ------------ 00100000 10101010 11110000 OR ------------ 11111010 dupliceer bits met 1 rest heeft 0 dupliceer bits met 0 rest krijgt 1 10101010 11111111 XOR ------------ 01010101 geeft complement bij 1-en

49 Basiscursus Informatica, 98-99 College 2, H 2 48 Basiscursus Informatica 98/9948 Shifts, Rotations n Richting n Circulair (rotatie) 1 0 1 0 1 0 1 1 - 1 0 1 0 1 0 1 (shift 1 naar rechts) 1 1 0 1 0 1 0 1 (roteer een naar rechts)

50 Basiscursus Informatica, 98-99 College 2, H 2 49 Basiscursus Informatica 98/9949 Overzicht college 2 n Central processing unit (CPU) n Stored-program concept n Progamma executie n Andere architecturen n Rekenkundige/logische instructies n Communicatie met randapparatuur

51 Basiscursus Informatica, 98-99 College 2, H 2 50 Basis cursus SWI 97-150 Randapparatuur n Printer n Modem n Extra disk n Soundblaster n Zipdrive n etc.

52 Basiscursus Informatica, 98-99 College 2, H 2 51 Basiscursus Informatica 98/9951 Verbindingen Randapparaat Bus Main memoryControllerCPUControllerRandapparaat Elk randapparaat heeft eigen controler

53 Basiscursus Informatica, 98-99 College 2, H 2 52 Basiscursus Informatica 98/9952 Controler n Soms op moederbord geprikt (kaart) n Converteert boodschappen tussen computer en randapparaat (vertaalslag) n Kan soms direct main memory lezen door bus --> Direct Memory Access (DMA) ä Von Neuman bottleneck n CPU kan controler vragen data te lezen en op bepaald adres tijdelijk op te slaan (buffer)

54 Basiscursus Informatica, 98-99 College 2, H 2 53 Basiscursus Informatica 98/9953 Communicatie: contr-CPU n Analoog aan CPU-main memory n Memory-mapped: controler is “onderdeel” van main memory (1 adres-systeem) n Niet memory-mapped: apparte adressering ä I/O adres (bv. D82A ipv 382A) n Port: alle geheugen cellen (adressen) die controler gebruikt n Handshaking: twee-weg communicatie

55 Basiscursus Informatica, 98-99 College 2, H 2 54 Basiscursus Informatica 98/9954 Parallelle/seriele 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) en baudrate ä baudrate: snelheid van states (niet bits) ä state kan meedere bits bevatten

56 Basiscursus Informatica, 98-99 College 2, H 2 55 Basiscursus Informatica 98/9955 Data compressie n Relative encoding ä plaatje: lange bitstrings met zelfde pixels –codeer the bit + lengte van string ä bewegende beelden: codeer verschillen n Huffman code / frequency dependent ä string van tekens (characters) ä lengte bitstring voor teken omgekeerd evenredig met gebruiksfrequentie  letters e, a, d hebben korte bitpatronen n Lempel-Ziv encoding  herhaalde patronen refereren naar eerdere ( ing, the )


Download ppt "Basiscursus Informatica, 98-99 College 2, H 2 1 Basiscursus Informatica 98/991 Basiscursus Informatica College 2, Data Manupulatie Brookshear H2 Richard."

Verwante presentaties


Ads door Google