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

  1. 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:

  2. Select File | Save Project ( ) and save as halfadd.cct.

II. Building the full-adder

  1. With halfadd.cct loaded select File | New Main Circuit ( ). Drag 2 halfadd cards from the subcircuit window.

  2. Add 1 switch bank ( ), 1 bulb bank ( ), and an OR-gate ( ); label the endpoints and connect as shown.

  3. Save as fulladd.cct.

III. Building the 4-bit adder

  1. Select File | New Project
  2. Select Elements | Add Card ( ) and choose fulladd.cct. Click on the circuit board to add the fulladd card.
  3. Drag 3 more fulladd cards from the subcircuit window.
  4. 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).

  5. Save as add4.cct.
  6. Right-click add4 in the subcircuit window and select Export add4 as chip.

IV. Building the 8-bit adder

  1. Select File | New Project
  2. Select Elements | Add Chip ( ) and choose add4.chp. Click on the circuit board to add the add4 chip.
  3. Repeat to add 1 more add4 chip.
  4. 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.

  5. Save as add8.cct.
  6. Select File | Export XML Project and export as add8.xml.

V. Importing add8

  1. Select File | New Project
  2. Select File | Import XML Project and choose add8.xml. Note that add4 appears in the subcircuit window (in red) but cannot be viewed.