1 / 39

Structura unui calculator

Structura unui calculator. Lab02. Calculatorul?. 0. 0. 1. Calculator?. Calculator?. Calculator?. #include <stdio.h> #include <conio.h> #include <time.h> #include <dos.h> #include <stdlib.h> #define NR_MAX 5000 #define pas 50 typedef struct { double valoare;

eddy
Télécharger la présentation

Structura unui calculator

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Structura unui calculator Lab02

  2. Calculatorul?

  3. 0 0 1 Calculator?

  4. Calculator?

  5. Calculator? #include <stdio.h> #include <conio.h> #include <time.h> #include <dos.h> #include <stdlib.h> #define NR_MAX 5000 #define pas 50 typedef struct { double valoare; int baterie; }nod; int nr_repetari=1; //reteaua de noduri nod a[NR_MAX]; //nr de noduri care sunt active la un moment dat int n; //eroarea maxima admisa pentru valori double epsilon; // tablou temporar la nodul C int b[NR_MAX]; //timp transmisie mesaje pe retea int D=1; // ------------ Functie ce initializeaza valorile interne ale bateriilor ------------------- void init() { randomize(); for(int i=0;i<n;i++) { a[i].baterie=random(101); a[i].valoare=random(1000*epsilon)/1000; } } // ----------- Functie ce simuleaza trimiterea de mesaje ----------------------------------- void cere_valori(int dlay) {

  6. Calculatorul - cum îl abordăm? Software FIC Hardware

  7. START Instrucţiuni de executat? Nu Da Adu instrucţiunea (FETCH) Funcţie de codul operaţiei (OPCODE) Execută instrucţiunea Ce face un calculator? Cine spune asta? De unde? Care unde apare? Cine îl defineşte? Cum? Unde?

  8. Von Neumann Harvard Arhitectura unui calculator

  9. START Instrucţiuni de executat? Nu Da Adu instrucţiunea (FETCH) Funcţie de codul operaţiei (OPCODE) Execută instrucţiunea Funcţionarea Instrucţiune + Instrucţiune 11 10 1

  10. START Instrucţiuni de executat? Nu Da Adu instrucţiunea (FETCH) Funcţie de codul operaţiei (OPCODE) Execută instrucţiunea Etapele execuţiei • Adu instrucţiune • Instruction Access sau • Instruction Fetch • Decodifică instrucţiune • Instruction Decode • Execută instrucţiune • Execution • Data Access • Store (write back) Results

  11. Şi acum...o maşină reală Microprocesorul şcoală IAS* * IAS – Institute for Advanced Studies, Princeton

  12. Structura IAS DPU DR Data /Gate register AR Address register PC Program counter IR Instruction register AC accumulator DPU Data programming unit PCU Program controling unit ICS Internal control signals Arithmetic logic circuit AC Main Memory 25 x 8 biţi DR PCU AR PC IR Control unit ICS

  13. Funcţionarea IAS DPU • Instruction Fetch Arithmetic logic circuit AC Main Memory 25 x 8 biţi DR PCU AR PC IR Control unit ICS

  14. Funcţionarea IAS DPU • Instruction Fetch • Instruction Decode Arithmetic logic circuit AC Main Memory 25 x 8 biţi DR PCU AR PC IR Control unit ICS

  15. Instrucţiunea este un ADD

  16. Funcţionarea IAS - ADD DPU • Instruction Fetch • Instruction Decode • Execution Arithmetic logic circuit AC Main Memory 25 x 8 biţi DR PCU AR PC IR Control unit ICS

  17. Funcţionarea IAS - ADD DPU • Instruction Fetch • Instruction Decode • Execution • Data Access • Write back Results Arithmetic logic circuit AC Main Memory 25 x 8 biţi DR PCU AR PC IR Control unit ICS

  18. Instrucţiunea este un LOAD

  19. Funcţionarea IAS DPU • Instruction Fetch Arithmetic logic circuit AC Main Memory 25 x 8 biţi DR PCU AR PC IR Control unit ICS

  20. Funcţionarea IAS DPU • Instruction Fetch • Instruction Decode Arithmetic logic circuit AC Main Memory 25 x 8 biţi DR PCU AR PC IR Control unit ICS

  21. Funcţionarea IAS - LOAD DPU • Instruction Fetch • Instruction Decode • Execution • Data access Arithmetic logic circuit AC Main Memory 25 x 8 biţi DR PCU AR PC IR Control unit ICS

  22. Funcţionarea IAS - LOAD DPU • Instruction Fetch • Instruction Decode • Execution • Data access • Writeback result Arithmetic logic circuit AC Main Memory 25 x 8 biţi DR PCU AR PC IR Control unit ICS

  23. Mix and match Part 1

  24. IAS vs Von Neumann DPU Arithmetic logic circuit AC Main Memory 25 x 8 biţi DR PCU AR PC IR Control unit ICS

  25. START Instrucţiuni de executat? Nu Da Adu instrucţiunea (FETCH) Funcţie de codul operaţiei (OPCODE) Execută instrucţiunea Etapele execuţiei • Adu instrucţiune • Instruction Access sau • Instruction Fetch • Decodifică instrucţiune • Instruction Decode • Execută instrucţiune • Execution • Data Access • Store (write back) Results

  26. În continuare...o ALTĂmaşină reală Microprocesorul şcoală MIPS

  27. Structura MIPS PC - Program counter; NPC - New PC; IR – Instruction register; Imm – immediate; LMD – loaded memory data; cond – branch condtion

  28. Funcţionarea MIPS - ADD Notă: Selectarea adresei următoare nu este animată

  29. Funcţionarea MIPS - LOAD Notă: Selectarea adresei următoare nu este animată

  30. Mix and match Part 2

  31. MIPS vs VonNeumann

  32. START Instrucţiuni de executat? Nu Da Adu instrucţiunea (FETCH) Funcţie de codul operaţiei (OPCODE) Execută instrucţiunea Etapele execuţiei • Adu instrucţiune • Instruction Access sau • Instruction Fetch • Decodifică instrucţiune • Instruction Decode • Execută instrucţiune • Execution • Data Access • Store (write back) Results

  33. Von Neumann

  34. IAS DPU Arithmetic logic circuit AC Main Memory 25 x 8 biţi DR PCU AR PC IR Control unit ICS

  35. MIPS

  36. P4

More Related