Files
TI-Studium-Mitschriften/Semester 6/COMARCH/Zusammenfassung/Vorlesung Kompakt.md
fzzinchemical 90dc632ada issue
2025-07-08 18:34:59 +02:00

168 lines
4.7 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 📘 **Kompaktes Lernskript: Computerarchitektur (alle 13 Vorlesungen)**
---
### **1⃣ Einführung Computerarchitektur**
- **Computerarchitektur**: Sicht des Programmierers (ISA, Speicher, I/O)
- **Computerorganisation**: Umsetzung auf Hardware-Ebene (Mikroarchitektur)
- **Von-Neumann-Architektur**:
- Gemeinsamer Speicher für Daten & Programme
- Vorteil: Einfachheit; Nachteil: Von-Neumann-Flaschenhals
- **Harvard-Architektur**:
- Trennung von Daten- und Programmspeicher
- **Abstraktionsebenen**:
- Ebene 0: Digitale Logik
- Ebene 1: Mikroarchitektur
- Ebene 2: ISA
- Ebene 3: Betriebssystem
- Ebene 4: Assemblersprache
- Ebene 5: Hochsprachen
- **Historie**: Zuse Z3 → ENIAC → IBM System/360 → Intel 4004 → ARM
---
### **2⃣ Architekturen**
- **RISC vs. CISC**:
|Merkmal|RISC|CISC|
|---|---|---|
|Befehlssatz|Einfach, gleich lang|Komplex, unterschiedliche Länge|
|Hardware|Einfach|Komplex|
|Beispiele|ARM, MIPS|x86 (Intel, AMD)|
- **Befehlssatztypen**:
- Stack, Akkumulator, Register-Memory, Load/Store
- **Moores Law**: Verdopplung der Transistorzahl alle ~18 Monate
- **Leistungskennzahlen**: MIPS, FLOPS, CPI, IPC
---
### **3⃣ Schaltnetze & Endliche Automaten**
- **Schaltnetz**: stateless, keine Rückkopplung
- **Endlicher Automat (FSM)**: stateful, mit Rückkopplung
- **Flip-Flops**: Zustandspeicher, getaktet
- **DEA**: Zustandslogik + Zustandspeicher + Takt
---
### **4⃣ Prozessor (Teil 1)**
- **MIPS-ISA**:
- R-Typ: `add $s1, $s2, $s3`
- Load/Store: `lw`, `sw`
- Branch: `beq`, `bne`
- **CPU-Leistungsformel**:
CPU-Zeit=IC×CPI×CTCPU\text{-Zeit} = IC \times CPI \times CT
- **Datenpfad-Bausteine**: ALU, Registerfile, Steuerwerk
---
### **5⃣ Prozessor (Teil 2)**
- **Steuersignale**:
- MemtoReg, RegWrite, ALUSrc, Branch, Jump
- **ALU Control**: Bestimmt Operation aus Opcode + Funct
- **Erweiterter Datenpfad**: Unterstützung für Jumps & Branches
---
### **6⃣ Pipelining**
- **5 Pipeline-Stufen**: IF → ID → EX → MEM → WB
- **Vorteil**: Erhöhter Durchsatz, gleiche Latenz
- **Hazards**:
- **Strukturell**
- **Datenhazards**: Forwarding, Stalls
- **Kontrollhazards**: Branch Prediction (Static/Dynamic)
---
### **7⃣ Pipelining: Datapath & Control**
- **Forwarding**: Bypassing von EX/MEM, MEM/WB
- **Load-Use Hazard**: 1-Stall einfügen
- **Branch Prediction**:
- 1-Bit, 2-Bit Predictors
- Branch Target Buffer (BTB)
---
### **8⃣ Pipelining: Exceptions, Interrupts & ILP**
- **Exceptions**: Fehler innerhalb CPU → EPC speichert PC
- **Interrupts**: externe Ereignisse
- **ILP**:
- **Static (VLIW)** vs. **Dynamic (Superscalar)**
- **Speculation**: Branch & Load Speculation
- **Register Renaming**: Verhindert WAW & WAR
---
### **9⃣ Intel vs. ARM**
|Feature|ARM Cortex-A8|Intel Core i7|
|---|---|---|
|Planung|Statisch, in-order|Dynamisch, out-of-order|
|TDP|2 W|130 W|
|Max Instr./Takt|2|4|
---
### **🔟 Speicheranbindung**
- **Speicherhierarchie**: Register → Cache → RAM → SSD/HDD
- **Caches**:
- Direct-Mapped, Set-Associative, Fully-Associative
- Write-Through vs. Write-Back
- **AMAT**:
AMAT=HitTime+MissRate×MissPenaltyAMAT = HitTime + MissRate \times MissPenalty
- **Cache Blocking**: Optimiert Speicherzugriffe
---
### **1⃣1⃣ Assembler**
- **Assembler**: Übersetzt Assemblersprache → Maschinencode
- **Zwei-Pass-Assembler**: Symboltabelle, Opcode-Tabelle
- **Linker**: Relokation & externe Referenzen
- **Makros**: Ersetzung bei Übersetzung
- **Dynamisches Binden**: DLL (Windows), SO (Unix)
---
### **1⃣2⃣ Compiler**
- **Compiler-Phasen**:
1. Lexikalische Analyse
2. Syntaktische Analyse (AST)
3. Semantische Analyse
4. Zwischencode (3-Adress-Code)
5. Optimierung (lokal, global)
6. Codegenerierung
- **Optimierungstechniken**: Loop Unrolling, Constant Folding, Dead Code Elimination
- **Tools**: `cc -E`, `cc -S`, `cc -c`, `cc -o`
---
### **1⃣3⃣ Zuverlässigkeit & Virtualität**
- **Zuverlässigkeit**:
Availability=MTTFMTTF+MTTRAvailability = \frac{MTTF}{MTTF + MTTR}
- **Hamming-Codes**: SEC/DED, ECC DRAM
- **Virtuelle Maschinen (VMs)**:
- Vorteile: Isolation, Sicherheit
- VMM: verwaltet Ressourcen, Traps für privilegierte Instruktionen
- **Virtueller Speicher**:
- Page Tables, TLB, Page Fault Handling
- **Cache-Kohärenz**:
- Snooping, Directory-basierte Protokolle
---
💡 **Merke**: Prinzip der Lokalität & Speicherhierarchie sind Schlüsselthemen für Performance!