24.10.2013 Views

porte logiche - Fisica

porte logiche - Fisica

porte logiche - Fisica

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Corso di Laurea in<br />

<strong>Fisica</strong><br />

Informatica I per la<br />

<strong>Fisica</strong><br />

Lezione 3: <strong>porte</strong> <strong>logiche</strong><br />

1


In base due possono essere effettutate le normali<br />

operazioni aritmetiche, utilizzando gli algoritmi usuali<br />

Per esempio la somma tra due numeri:<br />

2


Non è degno di uomini eccellenti perdere<br />

ore come schiavi e faticare su calcoli che<br />

potrebbero essere affidati a chiunque se<br />

venissero usate le macchine.<br />

Gottfried Wilhelm Leibnitz<br />

3


E’ possibile costruire una macchina che faccia i calcoli al<br />

posto dell’uomo?<br />

Cominciamo dalla operazione più semplice: la somma<br />

PROBLEMA: Costruire un sommatore<br />

4


Vediamo nel dettaglio la somma a 1 bit:<br />

B1 +<br />

_____ B2 =<br />

S<br />

0 +<br />

_____ 0 =<br />

0<br />

0 +<br />

_____ 1 =<br />

1<br />

1 +<br />

_____ 1 =<br />

10<br />

5


Operatori logici, cenni di logica booleana<br />

La somma non è la sola operazione che si può fare sui bit.<br />

Oltre alle operazioni algebriche esistono le operazioni LOGICHE<br />

Operazione LOGICA NOT Tavola di verità<br />

6


Operazione LOGICA OR Tavola di verità<br />

7


Operazione LOGICA AND<br />

Tavola di verità<br />

8


Algebra di Boole: ….. George Boole (1815 - 1864)<br />

NOT<br />

OR<br />

Vediamo qualche esempio….<br />

AND<br />

9


NOT<br />

OR<br />

AND<br />

Se I1 = 1 ------> NOT (I1) = 0 Se I1 = 0 ------> NOT (I1) = 1<br />

Se I1 = 0 e I2 = 1 ------> I1 AND I2 = 0<br />

Se I1 = 1 e I2 = 1 ------> I1 AND I2 = 1<br />

Se I1 = 0 e I2 = 1 ------> I1 OR I2 = 1<br />

10


NOT<br />

OR<br />

AND<br />

Se I1 = 0 e I2 = 1 ------> (I1 OR I2) AND I1 = ?<br />

Se I1 = 1 e I2 = 0 ------> (I1 AND I2) OR (I1 OR I2) = ?<br />

Se I1 = 1 e I2 = 1 ------> (I1 OR I2) AND (I1 OR I2) = ?<br />

11


NOT<br />

Reti combinatorie<br />

OR<br />

AND<br />

X = ((A AND B) OR (A AND C)) OR (B AND C)<br />

X = ((A B) + (A C)) + (B C) NOT A = A’<br />

12


Algebra di Boole<br />

14


Esercizio:<br />

Determinare la rete combinatoria che la soddisfa<br />

17

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!