Rechnernetze und Organisation

Transcrição

Rechnernetze und Organisation
IAIK – Institut für Angewandte Informationsverarbeitung und Kommunikationstechnologie
Einführung in
Softwareentwicklung-Wirtschaft
Rechnernetze und Organisation
Rechnernetze und Organisation
Dr. Johannes
Einführung in Softwareentwicklung-Wirtschaft 2006: RNO
Professor
HorstWolkerstorfer
Cerjak, 19.12.2005
SEW06_einfuehrung_rno
1
IAIK – Institut für Angewandte Informationsverarbeitung und Kommunikationstechnologie
Übersicht
Motivation
Ziele von RNO
Von der Software zur Hardware
Rechnernetze und Organisation
– C-Programm -> Assembler -> Maschinencode
– Prozessor -> Arithmetikeinheit
– Arithmetikeinheit -> digitale Schaltungen
Zusammenfassung
Dr. Johannes
Einführung in Softwareentwicklung-Wirtschaft 2006: RNO
Professor
HorstWolkerstorfer
Cerjak, 19.12.2005
SEW06_einfuehrung_rno
2
IAIK – Institut für Angewandte Informationsverarbeitung und Kommunikationstechnologie
Motivation
Was sind Computer?
Informationstechnologie:
Rechnernetze und Organisation
– Rechnen
(Computation)
– Kommunizieren (Communication)
– Speichern
(Storage)
Foto © Fujitsu Siemens
Wie funktionieren Computer?
Computer besser verstehen
-> bessere Software
Foto © HP
Foto © Unold
– Effizienter (schneller), Weniger Fehler
Dr. Johannes
Einführung in Softwareentwicklung-Wirtschaft 2006: RNO
Professor
HorstWolkerstorfer
Cerjak, 19.12.2005
Foto © Evva
SEW06_einfuehrung_rno
3
IAIK – Institut für Angewandte Informationsverarbeitung und Kommunikationstechnologie
Ziele von RNO
Computer
Rechnernetze und Organisation
–
–
–
–
Aufbau
Speicher
Busse
Schnittstellen
Prozessoren
–
–
–
–
Assembler
Fetch - Execute
Arithmetik
Interrupts
Hardware
–
–
–
–
Zahlendarstellung
Speichern von Daten
Rechnen mit Daten
Digitale Schaltungen
Netzwerke
– LAN, WAN
– Internet: TCP/IP
– WWW: HTTP
Dr. Johannes
Einführung in Softwareentwicklung-Wirtschaft 2006: RNO
Professor
HorstWolkerstorfer
Cerjak, 19.12.2005
SEW06_einfuehrung_rno
4
IAIK – Institut für Angewandte Informationsverarbeitung und Kommunikationstechnologie
Computer und Software
Computer =
Applikation
Word
Myprog.cpp
Win32 API
Hardware +
Software
Betriebssystem
Rechnernetze und Organisation
Software
Hardware
HAL
Prozessor
(CPU)
Memory
Treiber
Treiber
Grafik
Netzwerk
– Denken in Schichten (Layers)
• Fördert Abstraktion
– Macht Komplexes verständlich
Dr. Johannes
Einführung in Softwareentwicklung-Wirtschaft 2006: RNO
Professor
HorstWolkerstorfer
Cerjak, 19.12.2005
SEW06_einfuehrung_rno
5
IAIK – Institut für Angewandte Informationsverarbeitung und Kommunikationstechnologie
Von der Software zur Hardware:
Ein simples Programm
C-Quellcode
Compiler
– Überprüft Syntax
– Übersetzt Programm
in maschinenlesbaren Code
– Hochsprachen
Programmierung
Source File
Ed
it
void main() {
i = j+k;
}
Compile
Errors
.obj
.lib
Rechnernetze und Organisation
Object Files,
Library Files
Executable
Link
.exe
i = j + k;
Errors
Dr. Johannes
Einführung in Softwareentwicklung-Wirtschaft 2006: RNO
Professor
HorstWolkerstorfer
Cerjak, 19.12.2005
Load
& Run
Output
SEW06_einfuehrung_rno
6
IAIK – Institut für Angewandte Informationsverarbeitung und Kommunikationstechnologie
Von der Software zur Hardware:
Assembler-Code
Assembler
mov EAX, [12011234]
add EAX, [12011238]
mov [1201123C],EA
– Mnemonics (mov, add)
Rechnernetze und Organisation
• Für (Menschen-) Lesbarkeit
Maschinencode
0010000000111001
0001001000000001
0001001000110100
– Binärdarstellung
• Hier: 48 Bit
– Opcode (Befehl)
– Register
– Adressen
Computer verstehen nur sehr einfache Befehle!
– z.B. Daten verschieben (Mov), Addieren (Add)
– Dafür arbeiten sie sehr schnell: Intel-P4: 3 Mrd. Ops / Sek
Dr. Johannes
Einführung in Softwareentwicklung-Wirtschaft 2006: RNO
Professor
HorstWolkerstorfer
Cerjak, 19.12.2005
SEW06_einfuehrung_rno
7
IAIK – Institut für Angewandte Informationsverarbeitung und Kommunikationstechnologie
Von der Software zur Hardware:
Prozessor
Prozessor führt FetchExecute-Algorithmus aus
– Fetch
1.
Fetch
2.
Execute
Rechnernetze und Organisation
• Befehl aus Memory holen
• Befehl dekodieren
– Execute
Input
Daten
CPU
• Befehl ausführen
Output
Daten
– (Holen von Operanden)
• Ergebnis speichern
Input
Output
Programm
Computer
Programme sind auch nur
Daten! (von Neumann Architektur)
Dr. Johannes
Einführung in Softwareentwicklung-Wirtschaft 2006: RNO
Professor
HorstWolkerstorfer
Cerjak, 19.12.2005
Memory
SEW06_einfuehrung_rno
8
IAIK – Institut für Angewandte Informationsverarbeitung und Kommunikationstechnologie
Von der Software zur Hardware:
Arithmetische Operationen
– Mov, Add, Sub, Shl, ...
EAX
EAX
EAX
EAX
Accumulator
IR
ALU
Instr. Register
Arithm. Logic Unit
MAR
MBR
Mem. addr. Reg.
Mem. Buf. Reg.
Data
Control
• Verarbeitet meist 32-Bit Werte
CPU
Instr. pointer
Address
– Arithmetisch-logische Einheit
IP
Control Unit
ALU (arithmetic logic unit)
Systembus
• Wird von Kontrolleinheit gesteuert
Rechnernetze und Organisation
A
B
31 30 ... 3 2 1 0
31 30 ... 3 2 1 0
Arithmetic Logic Unit
(ALU)
Instruction
Load A
Neg A
Add A, B
Sub A, B
AND A, B
OR A, B
XOR A, B
Control
Unit
31 30 ... 3 2 1 0
C
Dr. Johannes
Einführung in Softwareentwicklung-Wirtschaft 2006: RNO
Professor
HorstWolkerstorfer
Cerjak, 19.12.2005
SEW06_einfuehrung_rno
9
IAIK – Institut für Angewandte Informationsverarbeitung und Kommunikationstechnologie
Digitale Schaltungen
Instruktions-Set
Hardware
Computer sind hierarchisch aufgebaut.
– Selbst Prozessoren bestehen aus Modulen, die ...
an-1bn-1
a2 b2
a1 b1
a0 b0
Prozessor
Module
Gatter
Transistoren
cout cn-1
...
cn-2
sn-1
+
+
c2
+
c1
s2
c0
s1
s0
A
B
31 30 ... 3 2 1 0
31 30 ... 3 2 1 0
A
B
A
a0
a0
b0
a0
b0
a0
b0
Rechnernetze und Organisation
+
Arithmetic Unit
add/sub
B
Arith. neg
add/sub
+
Logic
logic/arith
31 30 ... 3 2 1 0
C
Dr. Johannes
Einführung in Softwareentwicklung-Wirtschaft 2006: RNO
Professor
HorstWolkerstorfer
Cerjak, 19.12.2005
SEW06_einfuehrung_rno
10
IAIK – Institut für Angewandte Informationsverarbeitung und Kommunikationstechnologie
Arithmetische Operationen
Addition
A
B
– Sehr grundlegende Operation
– Operiert auf Binärdarstellung von Zahlen
an-1bn-1
Rechnernetze und Organisation
+
a2 b2
a1 b1
+
+
...
cn-2
c2
cn-1 sn-1
+
c1
s2
a0 b0 0
S
c0
s1
+
s0
Ripple Carry Adder
Ripple-Carry Adder
– Addition von 32-Bit Wörtern
• Hierarchischer Aufbau: 32 Volladdierer-Zellen
Dr. Johannes
Einführung in Softwareentwicklung-Wirtschaft 2006: RNO
Professor
HorstWolkerstorfer
Cerjak, 19.12.2005
SEW06_einfuehrung_rno
11
IAIK – Institut für Angewandte Informationsverarbeitung und Kommunikationstechnologie
Volladdierer
3 Bits müssen pro Stelle addiert werden
– si = ai + bi + ci-1
ai bi ci-1 ci si ai + bi + ci-1
Volladdierer
– 8 verschiedene Inputfälle
Rechnernetze und Organisation
• Da 3 Inputs:
23
=8
– Fall 1: 0 + 0 + 0 = 0
– ....
– Fall 8: 1 + 1 + 1 = 3
– Mögliche Ergebnisse
(0,1,2,3) haben in
2 Bits Platz: 2ci + si
0
0
0
0
0 0
0
0
1
0
1 1
0
1
0
0
1 1
0
1
1
1
0 2
1
0
0
0
1 1
1
0
1
1
0 2
1
1
0
1
0 2
1
1
1
1
1 3
Dr. Johannes
Einführung in Softwareentwicklung-Wirtschaft 2006: RNO
Professor
HorstWolkerstorfer
Cerjak, 19.12.2005
ai bi ci-1
+
ci s i
SEW06_einfuehrung_rno
12
IAIK – Institut für Angewandte Informationsverarbeitung und Kommunikationstechnologie
Zusammenfassung
Software
– Durch Compilieren von C-Code entsteht Maschinencode
Hardware
– Prozessoren bieten einfache Funktionalität – die aber schnell
– Digitale Hardware ist aus sehr einfachen Grundzellen aufgebaut
Rechnernetze und Organisation
Mögliche Prüfungsfragen
– Was bringt Denken in Layers/Schichten?
– Was passiert beim Compilieren?
– Kann im Hauptspeicher neben (Input-)Daten auch Programm-Code
gespeichert werden?
– Wie heißt der grundlegende Algorithmus, den Prozessoren
abarbeiten?
Mit besserem Hardware-Verständnis wird
die Software-Entwicklung verbessert!
Dr. Johannes
Einführung in Softwareentwicklung-Wirtschaft 2006: RNO
Professor
HorstWolkerstorfer
Cerjak, 19.12.2005
SEW06_einfuehrung_rno
13

Documentos relacionados