This is "programming" at its most fundamental.
Build a diagram of (two-wire) NAND logic gates that will take the input wires A1
, A2
, A4
, A8
, B1
, B2
, B4
, B8
, representing two binary numbers A
to B
from 0 to 15, and return values on the output wires C1
, C2
, C4
, and C8
representing C
, which is the sum of A
and B
modulo 16.
Your score is determined by the number of NAND gates (1 point per gate). To simplify things, you may use AND, OR, NOT, and XOR gates in your diagram, with the following corresponding scores:
NOT: 1
AND: 2
OR: 3
XOR: 4
Each of these scores corresponds to the number of NAND gates that it takes to construct the corresponding gate.
Lowest score wins.
Updates:
03-07 19:09: Due to discussions with Jan Dvorak, it came to my attention that the total number of gates, constants and splits is always determined solely by the number of gates. Because of this, I have simplified the score requirement back down to simply the number of gates required.