Professional Documents
Culture Documents
Curs 1 Introducere
Curs 1 Introducere
Bibliografie:
Noam Nisan and Shimon Schocken - “The Elements of Computing Systems”, MIT Press, 2005.
slide 1
Pe scurt
Obiective:
Metodologie:
slide 2
Detalii
6 proiecte, realizabile individual sau in echipe de cate 2
Metodologia proiectelor:
slide 3
Demo
Pong, pe
computer
slide 4
Structura cursului
Assembly
Language
Assembler
Chapter 6
abstract interface
Computer
Machine Architecture
abstract interface
Language
Chapters 4 - 5
Hardware Gate Logic
abstract interface
Platform Chapters 1 - 3 Electrical
Chips & Engineering
Hardware Physics
Logic Gates
hierarchy
(Abstraction–implementation paradigm)
slide 5
Nivelul aplicatiei: (de exemplu Pong)
Ball
abstraction
Bat
abstraction
slide 6
Human Abstract design Software
abstract interface
Thought hierarchy
Chapters 9, 12
H.L. Language Compiler
& abstract interface
Chapters 10 - 11
Operating Sys.
Virtual VM Translator
abstract interface
Machine Chapters 7 - 8
Assembly
Language
Assembler
Chapter 6
abstract interface
Computer
Machine Architecture
abstract interface
Language
Chapters 4 - 5
Hardware Gate Logic
abstract interface
Platform Chapters 1 - 3 Electrical
Chips & Engineering
Hardware Physics
Logic Gates
hierarchy
slide 7
Nivelul programului la nivel inalt (limbajul Jack)
/** A Graphic Bat for a Pong Game */
class Bat {
field int x, y; // screen location of the bat's top-left corner
field int width, height; // bat's width & height
// The class constructor and most of the class methods are omitted
slide 8
Nivelul sistemului de operare (Jack OS)
/** An OS-level screen driver that abstracts the computer's physical screen */
class Screen {
static boolean currentColor; // the current color
}
}
}
slide 9
Human Abstract design Software
abstract interface
Thought hierarchy
Chapters 9, 12
H.L. Language Compiler
& abstract interface
Chapters 10 - 11
Operating Sys.
Virtual VM Translator
abstract interface
Machine Chapters 7 - 8
Assembly
Language
Assembler
Chapter 6
abstract interface
Computer
Machine Architecture
abstract interface
Language
Chapters 4 - 5
Hardware Gate Logic
abstract interface
Platform Chapters 1 - 3 Electrical
Chips & Engineering
Hardware Physics
Logic Gates
hierarchy
slide 10
Metoda moderna de complilare
slide 11
Compilare efectiva
Cod intermediar
>
Cod sursa push x
Generare push width
(x + width) > 511 parsare + 511 cod add
push 511
gt
x width
slide 12
Masina virtuala (VM) (VM bazata pe stiva, similara cu cea Java JVM)
memory (before) s2
if ((x+width)>511) {
let x=511-width; ... 75
} width 450 450
... sp
// VM implementation x 75
push x // s1 ...
push width // s2
s4 s5 s9
add // s3
push 511 // s4 525 1 511
gt // s5 511 sp 450
if-goto L1 // s6 sp sp
goto L2 // s7
L1:
push 511 // s8 s10 memory (after)
push width // s9
61 ...
sub // s10
sp width 450
pop x // s11
...
L2:
x 61
...
...
slide 13
Human Abstract design Software
abstract interface
Thought hierarchy
Chapters 9, 12
H.L. Language Compiler
& abstract interface
Chapters 10 - 11
Operating Sys.
Virtual VM Translator
abstract interface
Machine Chapters 7 - 8
Assembly
Language
Assembler
Chapter 6
abstract interface
Computer
Machine Architecture
abstract interface
Language
Chapters 4 - 5
Hardware Gate Logic
abstract interface
Platform Chapters 1 - 3 Electrical
Chips & Engineering
Hardware Physics
Logic Gates
hierarchy
slide 14
Programare de nivel jos (pe calculatorul Hack)
...
push x
push width
add
push 511 VM
translator Assembly program
gt
if-goto L1 // push 511
goto L2 @511
L1: D=A // D=511
push 511 @SP
push width A=M
Assembler
M=D // *SP=D
Executable
sub
pop x @SP
@SP 0000000000000000
L2: M=M+1 // SP++ 1110110010001000
...
slide 15
Human Abstract design Software
abstract interface
Thought hierarchy
Chapters 9, 12
H.L. Language Compiler
& abstract interface
Chapters 10 - 11
Operating Sys.
Virtual VM Translator
abstract interface
Machine Chapters 7 - 8
Assembly
Language
Assembler
Chapter 6
abstract interface
Computer
Machine Architecture
abstract interface
Language
Chapters 4 - 5
Hardware Gate Logic
abstract interface
Platform Chapters 1 - 3 Electrical
Chips & Engineering
Hardware Physics
Logic Gates
hierarchy
slide 16
Semantica limbajului masina (platforma Hack)
Instruction code
Address
(0=“address” inst.)
Code syntax
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0000000000000000 @0
1111110111001000 M=M-1
1 1 1 1 1 1 0 1 1 1 0 0 1 0 0 0
instruction
D
Data
ALU
Instruction Memory
Memory A
data out (M)
M
address of next
instruction
Program data in RAM(A)
Counter
slide 18
Human Abstract design Software
abstract interface
Thought hierarchy
Chapters 9, 12
H.L. Language Compiler
& abstract interface
Chapters 10 - 11
Operating Sys.
Virtual VM Translator
abstract interface
Machine Chapters 7 - 8
Assembly
Language
Assembler
Chapter 6
abstract interface
Computer
Machine Architecture
abstract interface
Language
Chapters 4 - 5
Hardware Gate Logic
abstract interface
Platform Chapters 1 - 3 Electrical
Chips & Engineering
Hardware Physics
Logic Gates
hierarchy
slide 19
Proiectare logica
Computer)
slide 20
Porti logice
Platforma Hardware = o multime de chip-uri inter-conectate
Chip-urile sunt realizate din altele mai simple pana la porti logice
a a
Xor out And
b Not
Or out
a b out
Not
0 0 0
And
0 1 1 b
1 0 1
1 1 0
slide 21
Hardware Description Language (HDL)
a
And
Not
Or out
Not
And
b CHIP Xor {
IN a,b;
OUT out;
PARTS:
Not(in=a,out=Nota);
Not(in=b,out=Notb);
And(a=a,b=Notb,out=w1);
And(a=Nota,b=b,out=w2);
Or(a=w1,b=w2,out=out);
}
slide 22
Interfata O optiune de implementare (CMOS)
a
Nand out
b
a b out
0 0 1
0 1 1
1 0 1
1 1 0
slide 23
Human Abstract design Software
abstract interface
Thought hierarchy
Chapters 9, 12
H.L. Language Compiler
& abstract interface
Chapters 10 - 11
Operating Sys.
Virtual VM Translator
abstract interface
Machine Chapters 7 - 8
Assembly
Language
Pe scurt:
Assembler Realizarea acestui
Chapter 6
calculator
de jos in sus
abstract interface
Computer
Machine Architecture
abstract interface
Language
Chapters 4 - 5
Hardware Gate Logic
abstract interface
Platform Chapters 1 - 3 Electrical
Chips & Engineering
Hardware Physics
Logic Gates
hierarchy
slide 24