-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes
55 lines (44 loc) · 1.96 KB
/
notes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Any Boolean Function f(x,y,z...) can be expressed with three Boolean Operators AND, NOT and OR.
The number of boolean functions that can be defined over 'n' variables is 2^(2^n)
i.e. for n = 2, we can have 2^(2^2) = 16 functions . Here is a table for that:
function-16 | x, y
----------------------------------
constant 0 0
And x.y
x and not y x.~y
x x
not x and y ~x.y
y y
Xor x.~y + ~x.y
or x + y
Nor ~(x+y)
equivalence x.y + ~x.~y
not y ~y
not x ~x
if y then x x + ~y
if x then y y + ~x
Nand ~(x.y)
constant 1 1
Nand fn can implement any of the AND, OR or NOT operators:
AND = (x NAND y) NAND (x NAND y)
NOT = (x NAND x)
OR = (x NAND x) NAND (y NAND y)
Functions and Gates:
Given a boolean function f() and n input variables x1,x2,...xn and
m output variables o1,o2,....om.
the gate logic of the function would implement: f(x1,x2...xn) = {o1,o2,...,om}
such that we have m possible outputs from the gate logic.
The hardware to implement this boolean strucuture could be anything that is capable
of computing such functions: eg. electronic computers made of silicon that run on
electricity, an intricate system of tubes and valves or even biological systems.
Composition of Primitive Gates allows us to model boolean functions and hence
boolean circuits using logic gates such as NAND gates.
As we build up more complex functions, these can themselves be viewed as abstract
patterns that could be used in other even more complex functions. This allows
abstractions and that is the key to taming complexity.
An abstraction is a generalized pattern that has the power to be applicable in many
situations, hence relieving the designer of knowing its exact details when building
on top of it. All we care for is the correct interface or the API.
The implementation is independent of the abstraction or the interface.
Implementation determines non-functional properties like speed, cost, efficiency
simplicity, usability etc.