The gates at a glance
Thirteen parts sit in the Gates library. Twelve are shown here with truth tables read from our test circuit, which Logisim-evolution 5.0.0 reproduced row for row (F85). The thirteenth, PLA, is described below.
NOT gate
Inverts one input.
| A | Out |
|---|---|
| 0 | 1 |
| 1 | 0 |
Buffer
Passes the value on unchanged. Adds a delay step and shows the bus width.
| A | Out |
|---|---|
| 0 | 0 |
| 1 | 1 |
AND gate
1 only when all inputs are 1.
| A | B | Out |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
OR gate
1 when any input is 1.
| A | B | Out |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
NAND gate
AND followed by NOT.
| A | B | Out |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
NOR gate
OR followed by NOT.
| A | B | Out |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
XOR gate
1 when the two inputs differ. With three or more inputs see below.
| A | B | Out |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
XNOR gate
1 when the two inputs are equal.
| A | B | Out |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Odd Parity gate
1 when an odd number of inputs are 1. Same as XOR for two inputs.
| A | B | Out |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Even Parity gate
1 when an even number of inputs are 1. Same as XNOR for two inputs.
| A | B | Out |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Controlled Buffer
Passes A when C is 1, and drives nothing (U) when C is 0.
| A | C | Out |
|---|---|---|
| 0 | 0 | U |
| 0 | 1 | 0 |
| 1 | 0 | U |
| 1 | 1 | 1 |
Controlled Inverter
Passes NOT A when C is 1, and drives nothing (U) when C is 0.
| A | C | Out |
|---|---|---|
| 0 | 0 | U |
| 0 | 1 | 1 |
| 1 | 0 | U |
| 1 | 1 | 0 |
Describe this circuit
Components: Input pin A; Input pin B; Input pin C; NOT Gate 1; Output pin NOT; Buffer 1; Output pin BUF; AND Gate 1; Output pin AND; OR Gate 1; Output pin OR; NAND Gate 1; Output pin NAND; NOR Gate 1; Output pin NOR; XOR Gate 1; Output pin XOR; XNOR Gate 1; Output pin XNOR; Odd Parity 1; Output pin ODD; Even Parity 1; Output pin EVEN; Controlled Buffer 1; Output pin CBUF; Controlled Inverter 1; Output pin CINV.
- Input pin A connects to NOT Gate 1, Buffer 1, AND Gate 1, OR Gate 1, NAND Gate 1, NOR Gate 1, XOR Gate 1, XNOR Gate 1, Odd Parity 1, Even Parity 1, Controlled Buffer 1, Controlled Inverter 1 (net A, a).
- Input pin B connects to AND Gate 1, OR Gate 1, NAND Gate 1, NOR Gate 1, XOR Gate 1, XNOR Gate 1, Odd Parity 1, Even Parity 1 (net B, b).
- Input pin C connects to Controlled Buffer 1, Controlled Inverter 1 (net C, c).
- NOT Gate 1 connects to Output pin NOT (net not, NOT).
- Buffer 1 connects to Output pin BUF (net buf, BUF).
- AND Gate 1 connects to Output pin AND (net and, AND).
- OR Gate 1 connects to Output pin OR (net or, OR).
- NAND Gate 1 connects to Output pin NAND (net nand, NAND).
- NOR Gate 1 connects to Output pin NOR (net nor, NOR).
- XOR Gate 1 connects to Output pin XOR (net xor, XOR).
- XNOR Gate 1 connects to Output pin XNOR (net xnor, XNOR).
- Odd Parity 1 connects to Output pin ODD (net odd, ODD).
- Even Parity 1 connects to Output pin EVEN (net even, EVEN).
- Controlled Buffer 1 connects to Output pin CBUF (net cbuf, CBUF).
- Controlled Inverter 1 connects to Output pin CINV (net cinv, CINV).
Download circ-gates-gallery.circ.
XOR with three or more inputs
Set Number Of Inputs to 3 and the XOR gate’s default behaviour is “exactly one input is on”, not parity. The second setting makes it a parity gate, like chained two-input XORs.
| # | A | B | C | Default | Odd number on |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | |
| 0 | 0 | 1 | 1 | 1 | |
| 0 | 1 | 0 | 1 | 1 | |
| 0 | 1 | 1 | 0 | 0 | |
| 1 | 0 | 0 | 1 | 1 | |
| 1 | 0 | 1 | 0 | 0 | |
| 1 | 1 | 0 | 0 | 0 | |
| 1 | 1 | 1 | 0 | 1 |
Describe this circuit
Components: Input pin A; Input pin B; Input pin C; XOR Gate 1; Output pin One; XOR Gate 2; Output pin Odd.
- Input pin A connects to XOR Gate 1, XOR Gate 2 (net A, a).
- Input pin B connects to XOR Gate 1, XOR Gate 2 (net B, b).
- Input pin C connects to XOR Gate 1, XOR Gate 2 (net C, c).
- XOR Gate 1 connects to Output pin One (net one, One).
- XOR Gate 2 connects to Output pin Odd (net odd, Odd).
Inputs: how many, inverted, unconnected
Number Of Inputs
Gates take 2 to 64 inputs in 5.0.0. A new gate has 2 inputs; in classic 2.7.1 the default instance has 5 (the default instance has 3 ports in 5.0.0 and 6 in 2.7.1, F23). Course screenshots from 2.7.1 often show 5-input gates with unused inputs.
Negate an input
Each input has a Negate attribute that draws a bubble on it. We tried to build a gate with one negated input in a generated file and did not get the expected table, so we do not publish a tested result. If you need an inverted input and want a result you can check, put a NOT gate in front of it.
Unconnected inputs
| # | A | B | AND, 3 inputs | OR, 3 inputs |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | |
| 0 | 1 | 0 | 1 | |
| 1 | 0 | 0 | 1 | |
| 1 | 1 | 1 | 1 |
A spare input does no harm, but an input you meant to wire and missed is silently ignored: check the connection dots. The project option Gate Output When Undefined can change this; we did not test its other setting.
Multi-bit gates
Data Bits above 1 makes a bitwise gate.
| # | A | B | Y |
|---|---|---|---|
| 0x0 | 0x0 | 0x0 | |
| 0x5 | 0x3 | 0x1 | |
| 0xa | 0xc | 0x8 | |
| 0xf | 0x9 | 0x9 | |
| 0xf | 0xf | 0xf | |
| 0x6 | 0x6 | 0x6 |
Rotate, resize and switch shapes
Select a gate and change Facing in the Properties panel to rotate it. The Gate Size attribute changes its width. The gate shape (distinctive or rectangular) is a Preference, and the command line takes –gates ANSI or –gates IEC (the option and its error text are in the error list). We did not test the shape setting in the window.
Buffers, tri-state and buses
A Controlled Buffer passes its input when its control is 1 and drives nothing when the control is 0. Two of them on one wire make a shared bus. Our test gave this table (F10):
| # | A | B | SelA | SelB | Y |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | U | |
| 0 | 0 | 0 | 1 | 0 | |
| 0 | 0 | 1 | 0 | 0 | |
| 0 | 0 | 1 | 1 | 0 | |
| 0 | 1 | 0 | 0 | U | |
| 0 | 1 | 0 | 1 | 1 | |
| 0 | 1 | 1 | 0 | 0 | |
| 0 | 1 | 1 | 1 | E | |
| 1 | 0 | 0 | 0 | U | |
| 1 | 0 | 0 | 1 | 0 | |
| 1 | 0 | 1 | 0 | 1 | |
| 1 | 0 | 1 | 1 | E | |
| 1 | 1 | 0 | 0 | U | |
| 1 | 1 | 0 | 1 | 1 | |
| 1 | 1 | 1 | 0 | 1 | |
| 1 | 1 | 1 | 1 | 1 |
See wire colours for the circuit and what red means. A plain Buffer is useful for adding one step of delay, for fan-out, and for showing a width.
PLA
The Gates library also holds a PLA (programmable logic array). It has a program table you edit in a dialog. We did not test it. To turn a truth table into gates instead, use Combinational Analysis.
Transistors and transmission gates
They sit in the Wiring library, not Gates. Logisim models them as simple switches. We did not test them for this page.
Common mistakes
- Expecting a 3-input XOR to be parity: it is not, by default.
- Leaving a gate input unconnected and not noticing: it is ignored (F40).
- Two outputs on one wire: red wire, E (F07).
- A loop through gates with a defined start value: Oscillation apparent.
- Copying a 5-input gate from an old screenshot: new gates have 2 inputs.
Version differences
| Feature | 2.7.1 | 5.0.0 |
|---|---|---|
| Default number of inputs | 2.7.1: yes5 (6 ports) | 5.0.0: yes2 (3 ports) |
| PLA | 2.7.1: untestednot in our 2.7.1 component list | 5.0.0: yesin the Gates library |
| Parity gates and controlled gates | 2.7.1: untested | 5.0.0: yestested (F85) |
| Maximum Number Of Inputs | 2.7.1: untested | 5.0.0: partial64, per the documentation |
Cells say untested where we did not run 2.7.1. See also all components.