03.08.2013 Views

Edwin Jan Klein - Universiteit Twente

Edwin Jan Klein - Universiteit Twente

Edwin Jan Klein - Universiteit Twente

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.

Chapter 4<br />

Figure 4.9. A Primitive with instantaneous result forwarding.<br />

A pseudo code implementation of a coupler with a port configuration as shown in<br />

Figure 4.10 is given in Listing 4.2. The coupler is typically an instantaneous optical<br />

construct as was pointed out in Chapter 4.2.1. This is reflected by the code where,<br />

after the actual calculation, the calculation functions of the connected primitives are<br />

called directly. Although only one direction of the signal forwarding is shown in<br />

Figure 4.9 the data between the primitives is actually allowed to be forwarded in any<br />

direction as dictated by the implementation rules. In Listing 4.2 this bi-directionality<br />

is implemented using two separate calculations where one is called for data entering<br />

port 1 or 2 and the other for data entering port 3 or 4.<br />

Figure 4.10. A coupler primitive and its nodes.<br />

Listing 4.2. Pseudo code for the calculation function of coupler primitive.<br />

(instantaneous primitive)<br />

Calculate()<br />

{<br />

If a new value has been placed on ports 1 or 2<br />

{<br />

Calculate the values at ports 3 and 4 the using the coupler<br />

propagation matrix (eq. 2.8);<br />

}<br />

}<br />

Primitive<br />

n1<br />

n2<br />

I1<br />

Im<br />

Primitive<br />

F ( x .. xn<br />

, I1..<br />

I<br />

1 m<br />

Find the ports that are connected to ports 3 and 4 and place the values<br />

calculated for port 3 and 4 in these ports;<br />

Call the Calculation() function of the primitives that are the parent of these ports<br />

If a new value has been placed on ports 3 or 4<br />

{<br />

……………………<br />

}<br />

86<br />

)<br />

n3<br />

n4<br />

O1<br />

Primitive

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

Saved successfully!

Ooh no, something went wrong!