Contents

Digital Logic Circuit Syntax

The tasks involving Digital Logic Circuits require the user to place Chips and connect pins together with Wires.
The following describes the special syntax used by this website to allow the user to perform those very actions.

Declaring Chips

To declare a chip, write the Chip Type followed by a Chip ID.
For example, to place a NOT chip onto the circuitboard, use the command NOT MYCHIP.
The Chip ID may be any alphanumeric string up to 16 characters, and may not begin with a number.
All Chip IDs must be unique - no two Chips may share the same ID.

Connecting Wires

Chips have pins to read and transmit signal data via wires.
Different Chips may have different pin layouts depending on their Type.
For example, the NOT Chip Type has one IN pin and one OUT pin.
Pins are referenced by the syntax chipID.pinName.
Let's imagine we declare 2 NOT chips by issuing the following commands.

NOT MYCHIP1
NOT MYCHIP2

The two chips are now on the circuit board.

      ┌───────────┐                     ┌───────────┐       
      │           │                     │           │       
 IN ●─┤  MYCHIP1  ├─● OUT          IN ●─┤  MYCHIP2  ├─● OUT 
      │           │                     │           │       
      └───────────┘                     └───────────┘      

We can then wire the output of the first chip into the input of the second chip with the command

MYCHIP1.OUT -> MYCHIP2.IN

And now the state of MYCHIP2.IN is hardwired to MYCHIP1.OUT.

      ┌───────────┐                     ┌───────────┐       
      │           │                     │           │       
 IN ●─┤  MYCHIP1  ├─● OUT -------- IN ●─┤  MYCHIP2  ├─● OUT 
      │           │                     │           │       
      └───────────┘                     └───────────┘       

Multiple wires may be connected to any given OUT pin, but each IN pin may only be connected to a single wire maximum.
Any unconnected IN pin will remain in an unpowered state.

You don't need to worry about the exact positions of the chips and wires. All components are automatically placed.
However, understand that you cannot attach wires to chips before they have been placed onto the circuit board. It is good practice to declare all chips first, then declare all wires, to avoid referencing a chip before it has been declared.

Identifying Specific Pins

Some Chips have multiple pins of the same type.
For example, NAND chips have 2 IN pins and 1 OUT pin.
Specific pins may be referenced using bracked notation.

NOT MYCHIP1
NOT MYCHIP2
NAND MYCHIP3
MYCHIP1.OUT -> MYCHIP3.IN[0]
MYCHIP2.OUT -> MYCHIP3.IN[1]

Ranges of pins can be referenced using colons within the brackets in the format chipID.pinName[startPin:endPin].
If no specific pins are referenced, then it is assumed to reference every pin of that name.
For example, both MYCHIP3.IN and MYCHIP3.IN[0:1] will refer to the first two input pins of the MYCHIP3 Chip.
In this way, multiple wired may connect adjacent pins at once with a single command.
For example, all wires below may be placed with a single INPUT.OUT -> MYCHIP3.IN command.

───────┐                                    ┌───────────┐       
       ├─● OUT[0] ----------------- IN[0] ●─┤           │       
 INPUT │                                    │  MYCHIP3  ├─● OUT 
       ├─● OUT[1] ----------------- IN[1] ●─┤           │       
───────┘                                    └───────────┘       

Built-In Chips and Protected IDs

Most problems will have some chips already present on the circuitboard, such as INPUT or OUTPUT.
The IDs of these chips are pre-determined and considered "protected", meaning you will not be able to assign these IDs to other chips you decalre.

Other Info