Ocs package: Difference between revisions

Jump to navigation Jump to search
531 bytes added ,  22 September 2015
Line 19: Line 19:
Below we show three methods for constructing the circuit data structure
Below we show three methods for constructing the circuit data structure


__TOC__
* [[Ocs package#Build the AND GATE structure directly| using an Octave script ]]
 
* [[Ocs package#Build the AND gate circuit structure parsing a .spc file| parsing a SPICE netlist]]
{{Code|Load the AND circuit structure parsing a .spc file |<syntaxhighlight lang="octave" style="font-size:13px">
* [[Ocs package#Build the AND gate circuit structure parsing an IFF netlist| parsing an IFF netlist]]
outstruct = prs_spice ("and");
</syntaxhighlight>
}}
 
{{Code|Load the AND circuit structure parsing an IFF netlist |<syntaxhighlight lang="octave" style="font-size:13px">
outstruct = prs_iff ("and");
</syntaxhighlight>
}}
 


Once the circuit data structure is loaded the simulation can be started by the following commands


{{Code|Run the AND gate simulation |<syntaxhighlight lang="octave" style="font-size:13px">
{{Code|Run the AND gate simulation |<syntaxhighlight lang="octave" style="font-size:13px">
Line 45: Line 37:




==== Build the AND GATE structure directly ====
==== Build the AND gate circuit structure parsing an IFF netlist ====
{{Code|Load the AND circuit structure parsing an IFF netlist |<syntaxhighlight lang="octave" style="font-size:13px">
outstruct = prs_iff ("and");
</syntaxhighlight>
}}


==== Using an IFF netlist ====
{{Code|IFF netlist for the AND gate (.cir file)|<syntaxhighlight lang="text" style="font-size:13px">
{{Code|IFF netlist for the AND gate (.cir file)|<syntaxhighlight lang="text" style="font-size:13px">
% 0.1b1
% 0.1b1
Line 172: Line 173:


endfunction
endfunction
</syntaxhighlight>
}}
==== Build the AND gate circuit structure parsing a .spc file ====
{{Code|Load the AND circuit structure parsing a .spc file |<syntaxhighlight lang="octave" style="font-size:13px">
outstruct = prs_spice ("and");
</syntaxhighlight>
</syntaxhighlight>
}}
}}
349

edits

Navigation menu