• Tidak ada hasil yang ditemukan

lecture 05 computer architecture

N/A
N/A
Protected

Academic year: 2017

Membagikan "lecture 05 computer architecture"

Copied!
30
0
0

Teks penuh

(1)

www.nand2tetris.org

(2)

Babbage’s Analytical Engine (1835)

!

"

#

(3)

Some early computers and computer scientists

Blaise Pascal

(4)

Von Neumann machine

(circa 1940)

Arithmetic Logic

Unit (ALU)

CPU

Registers

Control

Memory

(data

+

instructions)

Input

device

Output

device

(5)

Arithmetic Logic

Unit (ALU)

CPU

Registers

Control

Memory

(data

+

instructions)

Input

device

Output

device

Processing logic: fetch-execute cycle

(

) *

+

ALU

out = f (register values)

ALU

,

(6)

-The Hack chip-set and hardware platform

Nand

Not

And

Or

Xor

Mux

Dmux

Not16

And16

Or16

Mux16

Or8Way

Mux4Way16

Mux8Way16

DMux4Way

DMux8Way

HalfAdder

FullAdder

Add16

Inc16

ALU

DFF

Bit

Register

RAM8

RAM64

RAM512

RAM4K

RAM16K

PC

Memory

CPU

Computer

done

done

done

(7)

The Hack computer

.

+ )

*

/

!01.#

.

!0 .#*

2

3

2

4

!

#

2

5

!

#

67

!

#-$8

9

:

;

4

* <$=

=<8

,

)

5

*

(8)

Lecture / construction plan

/

.

*

3

4

5

(9)

Instruction memory

out

15

16

address

ROM32K

>

*

;

ROM

+ )

;

ROM

$8

*

out = ROM32K[address]

(10)

-Data memory

"

!

#

?

*

;

RAM[

)

]

*

address

),

out

;

RAM[

)

]

@(*

address

),

in

(,

load

$,

)

+

!14#

?

*

;

RAM[

)

]

*

14

out = peek(

)

)

;

RAM[

)

]

@(*

14

poke(

)

,

(

)

peek

poke

14

.

peek

poke

,

A

(11)

Lecture / construction plan

/

.

*

3

4

5

(12)

Screen

;

4

0 .

*

*

out = Screen[address]

*

if load then Screen[address] = in

4

*

=<8

<$=

)

load

out

in

16

15

16

address

Screen

Physical

Screen

;

Screen.hdl

D

(13)

Screen memory map

+

(row,col)

(

)

*

"

!

#* 4

col%16

Screen[row*32+col/16]

1

0

!

col/16

#

+

* 7

14

drawPixel(row,col)

0 1

255

. . .

. . .

0 1 2 3 4 5 6 7 511

0011000000000000 0000000000000000

0000000000000000 0

0001110000000000 0000000000000000

0000000000000000 32

0100100000000000 0000000000000000

0000000000000000 8129

8130

8160

. . .

row 255

. . .

refresh several times each second

Screen

/

+ )

,

'5

(14)

-Keyboard

5

*

$8

/

*

!$8

#

) ,

E

)

1

*

+

)

*

"

!

#*

Keyboard

+

*

14

keyPressed()

4

)

*

;

)

Keyboard.hdl

-,

)

)

)

-;

)

(15)

Lecture / construction plan

/

.

*

3

4

5

(16)

Memory:

conceptual / programmer’s view

7

*

;

! - -

,

,

#,

$85

;

!

#,

( '5

Data

Screen

memory

map

Keyboard map

Memory

(17)

Memory:

physical implementation

*

E

$8,F'F

RAM16K

$8,F'G

=G,<%<

Screen

=G,<%8

keyboard

load

out

in

16

15

16

RAM16K

(16K mem. chip)

address

0

16383

Screen

(8K mem. chip)

16384

24575

24576

Keyboard

(one register)

Memory

Keyboard

Screen

;

Memory

)

RAM16K

,

Screen

,

Keyboard

,

-;

)

A

,

(18)

-Lecture / construction plan

/

.

*

3

4

5

(19)

A pledge to patience ...

H

/

,

II

- /

, /

- ;

,

-

,

H B

D

(

- 1

)

-

(20)

CPU

instruction

inM

16

1

15

15

16

outM

16

writeM

addressM

pc

reset

1

C

P

U

to data

memory

to instruction

memory

from

data memory

from

instruction

memory

(21)

CPU

instruction

inM

16

1

15

15

16

outM

16

writeM

addressM

pc

reset

1

C

P

U

to data

memory

to instruction

memory

from

data memory

from

instruction

memory

(22)

The

C

-instruction revisited

jum p

dest

com p

1

1

1

a c 1 c 2 c 3 c 4 c 5 c 6 d 1 d 2 d 3 j 1 j 2 j 3

binary:

(23)

(

*

reset

inM

addressM

pc

outM

A/M

instruction

decode

C ALU output

writeM

C C

jum p

dest

com p

1

1

1

a c 1 c 2 c 3 c 4 c 5 c 6 d 1 d 2 d 3 j 1 j 2 j 3

binary:

dest = com p; jum p

CPU

implementation

*

instruction

;

decode

,

(24)

-Lecture / construction plan

/

.

*

3

4

5

(25)

Computer

-on-a-chip

interface

Computer

reset

(26)

Computer

-on-a-chip

implementation

Data

Memory

(Memory)

instruction

C

P

U

Instruction

Memory

(ROM32K)

inM

outM

addressM

writeM

pc

reset

CHIP Computer {

IN reset;

PARTS:

// implementation missing

CHIP Computer {

IN

reset

;

PARTS:

// implementation missing

}

/

*

(27)

)-The spirit of things

D

D

(

D

D

(

-!0

,

(28)

Lecture plan

/

.

*

3

4

5

(29)

Perspective: from here to a “real” computer

.

/?1

4

!/?1,

,

, H#

.

?

(30)

---Perspective: some issues we haven’t discussed

(among many)

/4 ? 0/4

!

?

#

+

*

)

,

,

,

, H

J

-4

Referensi

Dokumen terkait

Hal ini terjadi pada kontrol (MF1), sedang pada perlakuan (MF3, MF4, MF5, MF6) tidak tampak gejala spesifik infeksi virus dengue. Hasil ini sesuai dengan fungsi protein E sebagai

We believe the growth outlook for low cost housing in Indonesia will remain robust in the coming years given strong government support in the form of liquidity loans

MESIR To JAKARTA By Air &amp; Sea Freight LCL &amp; FCL MYANMAR To JAKARTA By Air &amp; Sea Freight LCL &amp; FCL NEPAL To JAKARTA By Air &amp; Sea Freight LCL &amp; FCL NORWEGIA

Efek psikologis yang paling sederhana dan jelas dari stres kerja adalah turunnya kepuasan kerja Penelitian ini bertujuan untuk mengetahui pengaruh faktor-faktor stres

Penelitian ini bertujuan untuk (1) mengetahui pola konsumsi pangan rumah tangga di lokasi MKRPL Kabupaten Bengkulu Tengah (dekat perkotaan) dan lokasi MKRPL Desa Sulau

Kesimpulan dari permasalahan yang ditulis penulis diatas adalah bahwa website yang penulis buat ini sudah membantu masyarakat yang mempunyai permasalahan pada pembelian listrik

Clinical Profile of Extrapulmonary Tuberculosis Among TB-HIV Patients in Cipto Mangunkusumo Hospital.. Gurmeet Singh 1 , Anna Uyainah 1 , Evy Yunihastuti 2 , Darma

Hasil penelitian ini berupa Sistem Informasi Pariwisata Kabupaten Sidoarjo berbasis WebSIG yang menyajikan informasi pariwisata yang memiliki tampilan peta berupa