27.01.2015 Views

Note de curs - Departamentul Automatica, Calculatoare si ...

Note de curs - Departamentul Automatica, Calculatoare si ...

Note de curs - Departamentul Automatica, Calculatoare si ...

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.

D – <strong>de</strong>stinatie, S – sursǎ, d = D ⊕ S ( ⊕ – operatia sau-exclu<strong>si</strong>v se executǎ bitcu-bit<br />

pe bitii corespon<strong>de</strong>nti din adresele binare D <strong>si</strong> S).<br />

SC(A) – multimea <strong>de</strong> noduri vizitatǎ pe un par<strong>curs</strong> pe fiecare din dime<strong>si</strong>unile<br />

listate în multimea A.<br />

Exemplu: la nodul 0010 – SC(1, 3) = {0000, 1000}.<br />

i<br />

e n – un vector <strong>de</strong> n biti care are 1 în pozitia bitului i <strong>si</strong> 0 în rest.<br />

2<br />

Exemplu: e 3 = 100.<br />

Pachetele sunt presupuse a consta în:<br />

(i) d; d = D ⊕ S<br />

(ii) mesajul transmis (“încǎrcǎtura”)<br />

(iii) lista <strong>de</strong> dimen<strong>si</strong>uni vizitate <strong>de</strong>ocamdatǎ – TD<br />

θ – operatia <strong>de</strong> adǎgare (append). Scrierea TD θ x înseamnǎ adǎugarea la finalul<br />

listei TD a lui x.<br />

transmit(j) – rutina <strong>de</strong> trimitere a pachetului (d ⊕ e j , mesaj, TD θ x) pe legǎtura<br />

j-dimen<strong>si</strong>onalǎ <strong>de</strong> la nodul curent.<br />

Algoritm <strong>de</strong> rutare pentru hipercuburi cu <strong>de</strong>fecte<br />

if (d == 0…0)<br />

<strong>de</strong>stinatia a fost atinsǎ; exit<br />

else<br />

for j = 0 to (n – 1) step 1 do {<br />

if (d j == 1) && (legǎtura în dimen<strong>si</strong>unea j din acest nod este fǎrǎ<br />

<strong>de</strong>fect) && (e vj ∉ SC|TD R ) {<br />

transmit(j)<br />

exit<br />

}<br />

}<br />

endif<br />

if (existǎ o legǎturǎ fǎrǎ <strong>de</strong>fect în SC|TD R )<br />

fie h o astfel <strong>de</strong> legǎturǎ<br />

else {<br />

end<br />

m TD<br />

g = max(m: ⊕ = 1<br />

e<br />

R<br />

i<br />

( i)<br />

= = 0... 0 )<br />

if (g == numǎrul <strong>de</strong> elemente din SC(TD)) {<br />

nu existǎ o cale<br />

exit<br />

else<br />

h = elementul al (g + 1)-lea din TD R<br />

endif<br />

transmit(h)<br />

Exemplu pe hipercubul H 3 :<br />

H 3 cu nodul <strong>de</strong>fect 011.<br />

104

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

Saved successfully!

Ooh no, something went wrong!