unigate-gf

public project

GFMPW-0
It is quite well known that any logic circuit can be built using only NAND gates. For instance, an XNOR gate is equivalent to the following construction:

Such gates are called universal. Any Boolean function with 2 inputs and 1 output can be built from at most 5 NAND gates.

We can also define a gate *U*_{21} that is universal in a stricter sense, such that any Boolean function with 2 inputs and 1 output is realized with just a single copy of *U*_{21}. This gate would obviously need more than 2 inputs, but it's usually still more economical than the *2k* inputs and *k* outputs used from a set of NAND chips (1≤*k*≤5).

As an example, this is how we get the NAND of *p* and *q* and the XNOR of *p* and *q* by wiring up *U*_{21}'s four inputs *a*, *b*, *c* and *d* to a suitable combination of *p*, *q*, 0 and 1:

⮟ ⮟ ⮟ ⮟ ⮟ ⮟ ⮟ ⮟ ⮟ ⮟ ⮟

So *U*_{21} stands in for any combinatorial logic with 2 inputs and 1 output. And any Boolean function with 3 inputs and 1 output can be built with at most 3 copies of *U*_{21}. But that doesn't stop us from creating a gate *U*_{31} that's *even* more universal and does so with a single copy when wired correctly:

This repository contains a chip design with four independent gates *U*_{21}, *U*_{31}, *U*_{41} and *U*_{22} where each *U _{ij}* can be wired to act as an arbitrary function with

Implement any combinatorial logic on 4 inputs by wiring up the pins the right way

gf180mcuC