primary input and primary output labels (start with N+1)</span>
primary_inputs  = [N+1];
primary_outputs = [N+2];
M = N + length( primary_inputs ) + length( primary_outputs );

<span class="comment">% fan-in cell array for a straight chain of inverters</span>
FI{1} = [N+1];   <span class="comment">% fan-in of the first inverter is the primary input</span>
<span class="keyword">for</span> k = 2:N
  FI{k} = [k-1]; <span class="comment">% fan-in of other inverters is the inverter feeding into them</span>
<span