🡄 Previous

Next 🡆

Contents > Functions

Constant

A constant function outputs the same value regardless of its input:

f(x) = k

A 1-bit function that always returns 0 is realized by XORing the input with itself:

f(A) = A ⊕ A = 0

The code below links both inputs of an XOR gate with a horizontal I-tetromino.

false.t
ih 0
xor 0 1

in i -2..1 0
out o -2..1 12

The tests in the following image affirm the circuit consistently outputs 0.

False

A 1-bit function that always returns 1 is realized by XNORing the input with itself:

f(A) = A ⊕ A = 1

A horizontal I-tetromino joins the inputs of an XNOR gate in the code below.

true.t
ih 0
xnor 0 1

in i -2..1 0
out o -1..1 17

The following image reveals the circuit invariably yields 1.

True

A constant byte function is an assemblage of eight 1-bit constant functions. The image below depicts the constant byte function f(x) = 0 for an arbitrary input value.

Clear

And here is the requisite f(x) = 42 function:

42

🡄 Previous

Next 🡆