Subcircuits

Subcircuits

Subcircuits are self-contained circuits that appear as "black boxes" in other circuits. A given subcircuit may be used any number of times at multiple levels just as long as it does not become a subcircuit of itself.

There are three types of subcircuits: cards, chips and plug-ins. Plug-ins will be discussed in a separate section.

Cards and chips both begin as circuits designed on the circuit board. The difference between a card and a chip is that the internal structure of a card remains visible and editable while a chip is closed and opaque.

The Hierarchy and Subcircuit Windows present two views on the subcircuit structure of the current project. The Hierarchy Window shows the hierarchical structure of the subcircuits of the circuit currently in view while the Subcircuit Window provides a flat listing of all subcircuits in the project. Subcircuits listed in the Subcircuit Window have Action Menus (right-click the subcircuit name) with several important functions.

The following example shows a half-adder circuit, saved as halfadd.cct, and its respective appearance as a card and a chip. Note that the subcircuit pins correspond to the switches and bulbs of the original circuit.

       

Saving Circuits Containing Subcircuits

Circuits containing cards and/or chips can be saved or exported to XML. When reloaded, all cards or chips will be installed. Note that when imported from XML, a chip in a circuit will appear in the subcircuit window (in red) but cannot be viewed.

Subcircuit Actions

Subcircuits can be added or created in several different ways; these are discussed in subsequent sections.

To delete a subcircuit you must first eliminate all instances of the subcircuit, then right-click the subcircuit in the subcircuit window and select Delete [circuitname] from the popup menu.

You can also use the popup menu to make a given subcircuit into the main circuit, provided this does not create any subcircuit loops.

Viewing Subcircuit Structure

A card may be opened in place ("splashed") or viewed for editing. Chip structure cannot be viewed or edited.

Editing a card

Click on the card in either the subcircuit or hierarchy window. Any changes made in the cards circuit structure will propagate to all instances of the subcircuit. Note: changes to endpoints will cause the instances to be disconnected.

Splashing a card

Double click on the card to splash it open in place.

Double click again to close it.