13.12.2012 Views

Theoretical and Experimental DNA Computation (Natural ...

Theoretical and Experimental DNA Computation (Natural ...

Theoretical and Experimental DNA Computation (Natural ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

4.12 A Worked Example: The List Ranking Problem 105<br />

1. LDA 2n + k<br />

2. STA 4n + k /* rank(k) :=distance(k)<br />

3. HALT<br />

Combinational circuit realization<br />

First instruction block<br />

Input: M[1],...,M[5n], each consisting of r bits<br />

Output: M[1],...,M[5n] representing the contents of memory after the n<br />

processors have executed the first instruction.<br />

For each processor k the following combinational circuit is used:<br />

ACC[] := FETCH(M[···],bin(k));<br />

M[···]:=STORE(ACC[], 1,bin(n + k));<br />

ACC[] := bin(k);<br />

ACC[] := SUB(ACC[],FETCH(M[···],bin(n + k));<br />

M[···]:=STORE(ACC[], 1,bin(3n + k));<br />

ACC := FETCH(M[···],bin(3n + k));<br />

r−1<br />

∧<br />

cond := i=0 (ACC[i] ≡ 0);<br />

ACC[] := bin(1);<br />

M[···]:=STORE(ACC[],cond,bin(2n + k));<br />

ACC[] := bin(0);<br />

M[···]:=STORE(ACC[], ¬cond, bin(2n + k));<br />

Total size of first instruction = n × (3Size(FETCH)+4Size(STORE)+<br />

Size(SUB)+Size(cond − eval)) = O(n 2 log n).<br />

Depth is at most 3Depth(FETCH)+4Depth(STORE)+Depth(SUB)+<br />

Depth(cond − eval) =O(log n).<br />

Second instruction block<br />

Input: M[1],...,M[5n], each consisting of r bits<br />

Output: M[1],...,M[5n] representing the contents of memory after the n<br />

processors have executed the first instruction.<br />

ACC[] := bin(n)<br />

ACC[] := ADD(ACC[],FETCH(M[···],bin(n + k)));<br />

M[···]:=STORE(ACC[], 1,bin(3n + k));<br />

ACC[] := FETCH(M[···],FETCH(M[···],bin(3n + k));<br />

ACC[] := SUB(ACC[],FETCH(M[···],bin(n + k));<br />

M[···]:=STORE(ACC[], 1,bin(3n + k));<br />

ACC[] := FETCH(M[···],bin(3n + k));<br />

r−1<br />

∧<br />

cond := ¬( i=0 (ACC[i] ≡ 0));

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

Saved successfully!

Ooh no, something went wrong!