11.07.2015 Views

Come si codificano gli stati: Sia N il numero di bit per la codifica ...

Come si codificano gli stati: Sia N il numero di bit per la codifica ...

Come si codificano gli stati: Sia N il numero di bit per la codifica ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Soluzioni Esercizi su Funzioni Logiche:1) F=(z(xy’)’+x+yz’)’+x’y’F=(z(x’+y’’)+x+yz’)’+x’y’=(zx’+zy+x+yz’)’+x’y’==(zx’+x+y(z+z’))’+x’y’=con<strong>si</strong>dero che (z+z’)=1=(zx’+x+y)’+x’y’=(zx’)’(x’)(y’)+x’y’= raccolgo x’=x’((zx’)’(y’)+y’) = x’(y’((zx’)’+1)) = con<strong>si</strong>dero che (zx’)’+1 = 1=x’y’2) F=x’(y+z)’+z , G = (z’+x’(yz’)’)’F=x’(y+z)’+z=x’(y’z’)+z=x’y’z’+z == x’y’+zcon<strong>si</strong>dero che Az’+z=A+zG = (z’+x’(yz’)’)’ = (z’+x’(y’+z’’))’ = z’’(x’(y’+z))’ == z(x’’+(y’+z)’) = z(x+y’’z’) = zx+yz’z = zx con<strong>si</strong>dero che z’z = 0F+G = x’y’+z + zx = x’y’+z(1+x)=x’y’+zFG = (x’y’+z)zx = zxx’y’+zzx = zx con<strong>si</strong>dero che xx’ = 0Con<strong>si</strong>derazioni su esempio progetto <strong>di</strong> un circuito<strong>si</strong>ncrono:<strong>Come</strong> <strong>si</strong> <strong>co<strong>di</strong>ficano</strong> <strong>gli</strong> <strong>stati</strong>:<strong>Sia</strong> N <strong>il</strong> <strong>numero</strong> <strong>di</strong> <strong>bit</strong> <strong>per</strong> <strong>la</strong> co<strong>di</strong>fica, devevalere: 2 N ≥ <strong>numero</strong> <strong>di</strong> <strong>stati</strong>Nel caso in esempio, <strong>il</strong> <strong>numero</strong> <strong>di</strong> <strong>stati</strong> è 4,quin<strong>di</strong> 2 2 = 4, <strong>il</strong> <strong>numero</strong> <strong>di</strong> <strong>bit</strong> è 2.– A 00 (y1y2)– B 01– C 10– D 11A 1 0 B0 0 C1 0 D 100110La funzione <strong>di</strong> tran<strong>si</strong>zione de<strong>gli</strong> <strong>stati</strong>:È scritta nel<strong>la</strong> forma:f(ingresso/i, co<strong>di</strong>fica dello stato) -> stato futuroTran<strong>si</strong>zione de<strong>gli</strong> <strong>stati</strong> nell’esempio:– f(0,00) → 00– f(1,00) → 01– f(0,01) → 10– f(1,01) → 01– f(0,10) → 00– f(1,10) → 11– f(0,11) → 10– f(1,11) → 0100 1 0101011100110<strong>Come</strong> <strong>si</strong> ricava <strong>la</strong> funzione delle uscite:È scritta nel<strong>la</strong> forma:h(-, co<strong>di</strong>fica dello stato) -> valore delle usciteNel caso in esempio, l’uscita vale 1 nello stato11:– h(-,00) → 0– h(-,01) → 0– h(-,10) → 0– h(-,11) → 100 1 0101011100110<strong>Come</strong> <strong>si</strong> <strong>si</strong>ntetizzano le funzioni circuitali:Si hanno due tipi <strong>di</strong> funzioni:-Funzioni <strong>di</strong> stato-Funzioni <strong>di</strong> uscitaIl <strong>numero</strong> <strong>di</strong> funzioni <strong>di</strong> stato è uguale dal<strong>numero</strong> <strong>di</strong> <strong>bit</strong> del<strong>la</strong> co<strong>di</strong>fica de<strong>gli</strong> <strong>stati</strong>Il <strong>numero</strong> <strong>di</strong> funzioni <strong>di</strong> uscita è uguale al<strong>numero</strong> <strong>di</strong> <strong>bit</strong> <strong>di</strong> uscita del circuito000 1 010101110<strong>Come</strong> <strong>si</strong> <strong>si</strong>ntetizzano le funzioni circuitali:Nel caso in esempio <strong>si</strong> avranno:-2 funzioni <strong>di</strong> stato-1 funzione <strong>di</strong> uscita-<strong>Come</strong> <strong>si</strong> determina l’espres<strong>si</strong>one del<strong>la</strong>funzione <strong>di</strong> uscita:– h(-,00) → 0– h(-,01) → 0– h(-,10) → 0– h(-,11) → 1y1y21. Con<strong>si</strong>dero quando l’uscita vale 1.2. Trascrivo <strong>la</strong> co<strong>di</strong>fica dello stato nelseguente modo:se <strong>il</strong> <strong>bit</strong> nel<strong>la</strong> colonna y vale 1, scrivo yse <strong>il</strong> <strong>bit</strong> nel<strong>la</strong> colonna y vale 0, scrivo y’i.e. La funzione <strong>di</strong> uscita sarà: 00h = y1 * y200 1 01010111011011


<strong>Come</strong> <strong>si</strong> <strong>si</strong>ntetizzano le funzioni circuitali:-<strong>Come</strong> <strong>si</strong> determinano le espres<strong>si</strong>oni dellefunzioni <strong>di</strong> stato:– f(0,00) → 00– f(1,00) → 01– f(0,01) → 10– f(1,01) → 01– f(0,10) → 00– f(1,10) → 11– f(0,11) → 10– f(1,11) → 01iStati futuri y1 e y2Stati presenti y1 y21. Con<strong>si</strong>dero quando <strong>la</strong> prima uscita dellostato futuro vale 1 (i.e. y1).2. Trascrivo l’espres<strong>si</strong>one con<strong>si</strong>derando<strong>gli</strong> ingres<strong>si</strong> e <strong>la</strong> co<strong>di</strong>fica de<strong>gli</strong> <strong>stati</strong> presenti:se <strong>il</strong> <strong>bit</strong> nel<strong>la</strong> colonna k vale 1, scrivo kse <strong>il</strong> <strong>bit</strong> nel<strong>la</strong> colonna k vale 0, scrivo k’i.e. La funzione <strong>di</strong> stato f1 sarà:f1 = i’y1’y2+iy1y2’+i’y1y200 1 0101011100110<strong>Come</strong> <strong>si</strong> <strong>si</strong>ntetizzano le funzioni circuitali:-<strong>Come</strong> <strong>si</strong> determinano le espres<strong>si</strong>oni dellefunzioni <strong>di</strong> stato:– f(0,00) → 00– f(1,00) → 01– f(0,01) → 10– f(1,01) → 01– f(0,10) → 00– f(1,10) → 11– f(0,11) → 10– f(1,11) → 01iStati futuri y1 e y2Stati presenti y1 y21. Con<strong>si</strong>dero quando <strong>la</strong> seconda uscita dellostato futuro vale 1 (i.e. y2).2. Trascrivo l’espres<strong>si</strong>one con<strong>si</strong>derando<strong>gli</strong> ingres<strong>si</strong> e <strong>la</strong> co<strong>di</strong>fica de<strong>gli</strong> <strong>stati</strong> presenti:se <strong>il</strong> <strong>bit</strong> nel<strong>la</strong> colonna k vale 1, scrivo kse <strong>il</strong> <strong>bit</strong> nel<strong>la</strong> colonna k vale 0, scrivo k’i.e. La funzione <strong>di</strong> stato f2 sarà:f2 = iy1’y2’+iy1’y2+iy1y2’+iy1y2Tramite semplificazioni (comunque fac<strong>il</strong>menteintuib<strong>il</strong>e dai racco<strong>gli</strong>menti) f2 = i00 1 0101011100110• Le funzioni ottenute sono f 1 , f 2 e h:f 1 = y 1 ’y 2 i’ + y 1 y 2 ’i + y 1 y 2 i’f 2 = i<strong>Come</strong> <strong>si</strong> traducono le funzioni circuitali neicomponenti:f 1 = y 1 ’y 2 i’ + y 1 y 2 ’i + y 1 y 2 i’f 2 = ih = y 1 y 21. Il <strong>numero</strong> <strong>di</strong> flip flop è uguale al <strong>numero</strong> <strong>di</strong><strong>bit</strong> necessari <strong>per</strong> <strong>la</strong> co<strong>di</strong>fica de<strong>gli</strong> <strong>stati</strong> (i.e. 2)2. Ogni funzione <strong>di</strong> stato determina l’ingressodel flip flop corrispondente3. L’uscita del circuito è determinata dal<strong>la</strong>funzione <strong>di</strong> uscita h00h = y 1 y 200 01 10 110000 1 010101111 0 1011011• Il circuito che implementa <strong>il</strong> “riconoscitore” <strong>di</strong>sequenza è:EserciziClockiy 1y 2h• 1) Progettare una FSM con ingresso x ed uscitaz in grado <strong>di</strong> riconoscere <strong>la</strong> sequenza “011”.• 2) Progettare <strong>il</strong> circuito <strong>si</strong>ncrono derivante dal<strong>la</strong>seguente FSM– L’uscita è uguale a 1 resetsoltanto nello stato CA0Cinreset?out01101clockB


esetSoluzione Esercizio 1)Soluzione Esercizio 2)• NB: Non è pos<strong>si</strong>b<strong>il</strong>e unire <strong>stati</strong> A e C <strong>per</strong>chéhanno <strong>di</strong>verse uscite!01• Pos<strong>si</strong>b<strong>il</strong>e co<strong>di</strong>fica de<strong>gli</strong> <strong>stati</strong>:0–A 000 11–B 01A 0 B0B 0 C0C 0 D 1–C 100resetA0C1011B01Soluzione Esercizio 2) [cont.]Soluzione Esercizio 2) [cont.]• Funzioni <strong>di</strong> tran<strong>si</strong>zione <strong>di</strong> stato:– f(0,00) = 00– f(1,00) = 01– f(0,01) = 10– f(1,01) = 00– f(0,10) = 00– f(1,10) = 01• La funzione <strong>di</strong> uscita èsemplice:–h = y 1 y 2 ’f 1 = y1’y2i’f 2 = iy 2 ’reset000110010101inresetclocky 1y 2out

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

Saved successfully!

Ooh no, something went wrong!