• Non ci sono risultati.

calcolatore Architettura e funzionamento del

N/A
N/A
Protected

Academic year: 2021

Condividi "calcolatore Architettura e funzionamento del"

Copied!
25
0
0

Testo completo

(1)

FONDAMENTI DI INFORMATICA

Prof. PIER LUCA MONTESSORO Università degli Studi di Udine

Architettura e funzionamento del

calcolatore

(2)

Modello di calcolatore

• Si farà uso di un modello semplificato di elaboratore di tipo RISC (Reduced Instruction Set Computer)

• Per esso vengono nel seguito definiti:

– architettura

– linguaggio macchina/linguaggio assembly

(3)

Architettura del processore

Address bus CPU

Control Unit Arithmetic and Logic Unit PC

IR R0

R1 R15

Memoria Dispositivi di I/O 0000

0001 0002 0003 0004 0005 0006 0007

. . . . . .

Data bus Control bus SP

flags

16 fili

3 fili 16 fili

(4)

Caratteristiche del processore

• Parallelismo: 16 bit

• 16 registri general purpose da 16 bit

• 3 registri special purpose non direttamente indirizzabili dalle istruzioni

Program Counter (PC) Instruction Register (IR) Stack Pointer (SP)

• flag:

Z (zero) N (negative)

C (carry: Cn) V (overflow: Cn-1  Cn)

(5)

Caratteristiche del processore

• Isolated I/O: 16 bit per gli indirizzi di I/O

• Macchina “load & store”:

– le uniche istruzioni che possono accedere alla

memoria sono quelle che trasferiscono i dati da e verso i registri

– tutte le altre operazioni operano soltanto sui registri

• Nell’accesso alla memoria l’indirizzo può essere

espresso in tre modi (“modi di indirizzamento”)

(6)

Modi di indirizzamento

• Operando immediato

– la parola che segue l’istruzione contiene il dato (e quindi l’indirizzo del dato è contenuto nel PC)

• Indirizzo assoluto

– la parola che segue l’istruzione (indirizzo nel PC) contiene l’indirizzo del dato

• Indirizzo in registro

– l’indirizzo del dato è contenuto nel registro

specificato dal codice dell’istruzione

(7)

Unità di controllo

sequential logic circuits

instruction register clock

status signals from processor

control

signals to processor ... instruction

decoder

(8)

Unità aritmetico-logica

combinational circuits

and

data registers control

signals from control unit

...

status signals to control unit

flags

(9)

Il control bus

R/W

La CU lo pone a 1 per le operazioni di lettura, a 0 per le operazioni di scrittura

M/IO

La CU lo pone a 1 per le operazioni di lettura o scrittura in memoria, a 0 per le operazioni di lettura o scrittura su dispositivi di input/output

W/B

La CU lo pone a 1 per le operazioni di lettura/scrittura di 1 word, a 0 per le operazioni di lettura/scrittura di 1 byte

(10)

Memoria RAM

0000 0001 0002 0003 0004 0005 0006 0007

. . .

Address bus

Data Control bus

bus

address decoder

. . .

R/W, M/IO, W/B

(11)

Dispositivi di I/O

Address bus

Data Control bus

bus

address decoder

Indirizzo del monitor 0000

Indirizzo della tastiera 0001

R/W, M/IO, W/B

(12)

CPU

Control Unit Arithmetic and Logic Unit PC

IR R0

R1 R15

Memoria Dispositivi di I/O

00 10 CF 36

0000 0001 0002 0003 0004 0005 0006 0007

. . . . . .

SP flags

Instruction fetch (I)

Address bus Data bus Control bus

0003

0003

M/IO = 1 (memory), R/W = 1 (read) W/B = 1 (word)

(13)

CPU

Control Unit Arithmetic and Logic Unit PC

1000 IR R0

R1 R15

Memoria Dispositivi di I/O

00 10 CF 36

0000 0001 0002 0003 0004 0005 0006 0007

. . . . . .

SP flags

Instruction fetch (II)

Address bus

. . .

Data bus Control bus

1000

increment

0005

(14)

Operand fetch - op. immediato (I)

Address bus

. . .

Data bus CPU

Control Unit Arithmetic and Logic Unit PC

1000 IR R0

R1 R15

Memoria Dispositivi di I/O

00 10 CF 36

0000 0001 0002 0003 0004 0005 0006 0007

. . .

SP flags

Control bus

0005

0005

. . .

M/IO = 1 (memory), R/W = 1 (read) W/B = 1 (word)

(15)

Operand fetch - op. immediato (II)

CPU

Control Unit Arithmetic and Logic Unit PC

1000 IR 36CF R0 R1 R15

Memoria Dispositivi di I/O

00 10 CF 36

0000 0001 0002 0003 0004 0005 0006 0007

. . . . . .

SP

flags . . .

increment

0007

Address bus Data bus Control bus

36CF

(16)

CPU

Control Unit Arithmetic and Logic Unit PC

2000 IR R0

R1 R15

Memoria Dispositivi di I/O

A8 51 00 20 00 00

0000 0001 0002 0003 0004 0005 0006 0007

. . .

SP flags

0005

M/IO = 1 (memory), R/W = 1 (read) W/B = 1 (word)

Operand fetch - ind. assoluto (I)

Address bus

. . .

Data bus Control bus

0005

(17)

Operand fetch - ind. assoluto (II)

Address bus

. . .

Data bus Control bus CPU

Control Unit Arithmetic and Logic Unit PC

2000 IR R0

R1 R15

Memoria Dispositivi di I/O 0000

0001 0002 0003 0004 0005 0006 0007

. . . . . .

SP flags

A8 51 00 20 00 00

. . .

increment

0007

0000 0000

M/IO = 1 (memory), R/W = 1 (read) W/B = 1 (word)

(18)

Operand fetch - ind. assoluto (III)

Address bus Data bus Control bus CPU

Control Unit Arithmetic and Logic Unit PC

2000 IR 51A8 R0 R1 R15

Memoria Dispositivi di I/O

A8 51 00 20 00 00

0000 0001 0002 0003 0004 0005 0006 0007

. . .

SP flags

0007

. . .

51A8

(19)

Operand fetch - ind. in registro (I)

Address bus Data bus Control bus CPU

Control Unit Arithmetic and Logic Unit PC

3001 IR R0

0006 R1 R15

Memoria Dispositivi di I/O

97 22

0000 0001 0002 0003 0004 0005 0006 0007

. . .

SP flags

M/IO = 1 (memory), R/W = 1 (read) W/B = 1 (word)

(20)

CPU

Control Unit Arithmetic and Logic Unit PC

3001 IR 2297 R0

0006 R1 R15

Memoria Dispositivi di I/O

97 22

0000 0001 0002 0003 0004 0005 0006 0007

. . .

SP flags

Operand fetch - ind. in registro (II)

Address bus

. . .

Data bus Control bus

2297

(21)

Memory store - ind. assoluto (I)

Address bus CPU

Control Unit Arithmetic and Logic Unit PC

2260 IR 3003 R0 R1 R15

Memoria Dispositivi di I/O

00 22 00 00

0000 0001 0002 0003 0004 0005 0006 0007

. . .

SP flags

0005

. . .

M/IO = 1 (memory), R/W = 1 (read) W/B = 1 (word)

Data bus Control bus

0005

(22)

CPU

Control Unit Arithmetic and Logic Unit PC

2200 IR 3003 R0 R1 R15

Memoria Dispositivi di I/O 0000

0001 0002 0003 0004 0005 0006 0007

. . . . . .

SP flags

00 20 00 00

. . .

increment

M/IO = 1 (memory), R/W = 0 (write) W/B = 1 (word)

0007

. . .

Memory store - ind. assoluto (II)

Address bus Data bus Control bus

0000 0000

(23)

CPU

Control Unit Arithmetic and Logic Unit PC

2200 IR 3003 R0 R1 R15

Memoria Dispositivi di I/O 0000

0001 0002 0003 0004 0005 0006 0007

. . .

SP flags

03 30 00 22 00 00 0007

Memory store - ind. assoluto (III)

Address bus

. . .

Data bus Control bus

3003

(24)

Memory store - ind. in registro (I)

Address bus Data bus CPU

Control Unit Arithmetic and Logic Unit PC

3201 IR 2297 R0

0006 R1 R15

Memoria Dispositivi di I/O 0000

0001 0002 0003 0004 0005 0006 0007

. . .

SP flags

M/IO = 1 (memory), R/W = 0 (write) W/B = 1 (word)

. . .

Control bus

. . .

(25)

Memory store - ind. in registro (II)

CPU

Control Unit Arithmetic and Logic Unit PC

3201 IR 2297 R0

0006 R1 R15

Memoria Dispositivi di I/O

22

0000 0001 0002 0003 0004 0005 0006 0007

. . .

SP flags

97

Address bus

. . .

Data bus Control bus

2297

Riferimenti

Documenti correlati

dato atto che nel corso della trattativa sono state concordare le attività di manutenzione e supporto specialistico nonché le attività di sviluppo della configurazione

Si scrivano in particolare le equazioni degli asintoti e le ascisse dei punti di massimo, di minimo e di flesso.. La funzione ha un asintoto orizzontale per x

[r]

• Linguaggi debolmente tipati: linguaggi nei quali i tipi possono essere ignorati, p.e...

In Python le keys possono essere solo oggetti immutabili: le tuple, per esempio, possono essere usate come chiavi di indicizzazione di un dictionary. Come le tuple e le liste anche

 Le parole chiave char char, int int, float float, double double, ed enum enum descrivono i tipi base; short short, long long, signed signed, unsigned unsigned sono i

© 2001 Pier Luca Montessoro - Davide Pierattoni (vedere nota di copyright a pag. 2) 2 Questo insieme di trasparenze (detto nel seguito slide) è protetto dalle leggi sul copyright

– una variabile di tipo char può avere o meno il segno, ma in ogni caso i caratteri stampabili sono