Tutorial 2: Building a multi-level circuit
Tutorials
... Tutorial 2: Building a multi-level circuit
In this tutorial we will build an 8-bit adder in four stages: half-adder, full-adder, 4-bit adder and 8-bit adder.
I. Building a half-adder
- Add 2 switches ( ), 2 bulbs ( ), 2 three-terminal
connector ( ), (see Connectors), an AND-gate
( ) and an XOR-gate ( ) to the circuit board; label the
endpoints and connect the components as shown:
- Select File | Save Project ( ) and save as
halfadd.cct.
II. Building the full-adder
- With halfadd.cct loaded select File | New Main Circuit ( ). Drag 2 halfadd cards from the subcircuit window.
- Add 1 switch bank ( ), 1 bulb bank ( ),
and an OR-gate ( ); label the endpoints and connect as shown.
- Save as fulladd.cct.
III. Building the 4-bit adder
- Select File | New Project
- Select Elements | Add Card ( ) and choose fulladd.cct. Click
on the circuit board to add the fulladd card.
- Drag 3 more fulladd cards from the subcircuit window.
- Add 1 switch bank ( ), 1 single switch, 1 bulb
bank ( ), and 1 single bulb (in that order); label the
endpoints and connect as shown. Select Use Bank Pin from the
Action menus of the three terminal banks. (See Subcircuits:Special Topics: Bank Pins and LEDs).
- Save as add4.cct.
- Right-click add4 in the subcircuit window and select Export add4 as chip.
IV. Building the 8-bit adder
- Select File | New Project
- Select Elements | Add Chip ( ) and choose add4.chp. Click
on the circuit board to add the add4 chip.
- Repeat to add 1 more add4 chip.
- Add 1 switch bank ( ), 1 single switch, 1 bulb
bank ( ), and 1 single bulb (in that order); select bank
pins, label the endpoints and connect as shown.
- Save as add8.cct.
- Select File | Export XML Project and export as add8.xml.
V. Importing add8
- Select File | New Project
- Select File | Import XML Project and choose add8.xml. Note that add4 appears in the subcircuit window (in red) but cannot be viewed.