Binary circuits in computers
Unit of information: bit (binary digit) — 0 or 1 (data values or boolean)
Bit strings: multiple bits together, which can be given a specific meaning (such as natural numbers)
we want a computer that can calculate (expression string → result string(s))
operations:
complements:
therefore, any function ƒ(x) can be written as ƒ(x) = a ⋅ x + b ⋅ (1-x)
can it really? let’s try one:
ƒ(x) = a₀ + a₁x
let b = a₀, a = a₀ + a₁
∴ ƒ(x) = a ⋅ x + b ⋅ (1-x)
ƒ(1) = a
ƒ(0) = b
ƒ(x) = ƒ(1) ⋅ x + ƒ(0) ⋅ x̄
Binary addition — XOR
x ⨁ y = x ⋅ ȳ + y ⋅ x̄
x | y | ⨁ (carry result) |
---|---|---|
0 | 0 | 0 0 |
0 | 1 | 0 1 |
1 | 0 | 0 1 |
1 | 1 | 1 0 |
Binary multiplication — AND
x ⨂ y = x ⋅ y
x | y | ⨂ (carry result) |
---|---|---|
0 | 0 | 0 |
0 | 1 | 0 1 |
1 | 0 | 0 1 |
1 | 1 | 1 0 |