How to make a Subcircuit in LogicWorks
Example: Making a full adder into a subcircuit:
- Create your full adder as you did in Lab #0. (Do not put any binary switches on the inputs, or
binary probes on the outputs.)
- Put an input port on each input: you'll find the 'Port In' device in the connect.clf library.
- Put an output port on each output: you'll find the 'Port Out' device in the connect.clf library. (You may want to rotate the output port 180 degrees: use
the leftmost icon in the Palette to do this.)
- Give names to the input and output ports, as in A, B, and Cin for the input ports, and S and Cout for the output ports.
- Save this device, but leave its window open.
- From Tools menu select DevEditor. From the Options/Subcircuits/Part type menu choose the "Create a subcircuit symbol and store the subcircuit with it.." option..
- From the menu of parts that is displayed in the 'Select Internal Circuit' window, select the device you just made, and click 'internal'.
- Click 'Done' to close the PartType dialog box. You'll notice there is a list of port names in the window at the left of the DevEditor window.
- Choose the AutoCreate Symbol option in the Options menu.
- Type the same names (e.g. A, B, Cin) that you used above in the 'Left Pin Names' window in the AutoSym window; separate them with a Return.
- Type the same names (e.g. S, Cout) that youused above in the 'Right Pin Names' in the AutoSym window; separate them with a Return.
- Type the name you want for this circuit (e.g. myFullAdder) in the Part Name window, and click on 'Generate'.
- Choose File/Save Part As option to save this circuit in one of the libraries, (e.g. 'primlogi.clf').
- Now you can add this subcircuit just like any other part in the libraries.
Good luck!