Presentation is loading. Please wait.

Presentation is loading. Please wait.

At the bottom, all data is binary

Similar presentations


Presentation on theme: "At the bottom, all data is binary"— Presentation transcript:

1 At the bottom, all data is binary
At the bottom, all data is binary

2 Key Questions If 0’s and 1’s are the fundamental “atoms” of information, what are the mechanisms via which they interact? How does information “get processed”, or computation on information occur? What are the basic operations?

3 Gates and Circuits

4 Goals Learn function of basic logic gates AND, OR, NOT, XOR, NAND, NOR
Learn how gates can be combined into simple circuits. Given a circuit, a truth-table, or a Boolean formula, construct the other two. Explain the concept of universality of a collection of gates. Explain how transistors can act as logic gates.

5 “OR” gate inputs output A B A+B 1 inputs output truth table

6 “AND” gate inputs output A B A·B 1 inputs output “truth table”

7 “NOT” gate input output input A ~A, A’, A,¬A 1 output truth table

8 Another view: arithmetic
+ 1 1 B B OR = Addition AND = Multiplication

9 Elwood the Electronic Watchdog

10 output w = d+ps d p s woof 1 Elwood the Electronic Watchdog
1 output w = d+ps Use boolean arithmetic to evaluate! Show method of writing 0/1 values on circuit lines to evaluate, then have them do it. Show how boolean formula is derived from circuit by writing on circuit lines. Show method of evaluating boolean formula on next slide.

11 output w = d+ps example: 010 0 + 10 = 0 + 0 = 0 example: 011 ? d p s
Elwood the Electronic Watchdog output w = d+ps example: 010 0 + 10 = = 0 d p s woof 1 1 example: 011 ?

12 CHALLENGE Draw Circuit Give Truth Table A’B A B A’B 1

13 CHALLENGE: circuit to truth table
output 1 not and or and not Can also reason about circuit to simplify process. Eg, observe that except when B and C are 1, the lower input to the OR gate will be 1, so can fill in all but two rows with 1 output. Then deal with those two rows by inputting values, or note that when A is 1, the upper AND will be 0, and so... What is truth table? - Use the labeling method

14 CHALLENGE: circuit to formula
B C not and or and not What is formula? - Use the labeling method

15 CHALLENGE: formula to circuit
A(B+C’)(C+D) + BC(A’+D) Construct circuit TOP-DOWN APPROACH Do on board either bottom-up or top-down method

16 CHALLENGE: formula to truth table
A(B+C’)(C+D) + BC(A’+D) Example: Find value if A=1, B=0, C=0, D=1 Simply plug in values and simplify! 1(0+1)(0+1) + 00(0+1) = 1(1)(1) + 00(1) = = 1 Do on board either bottom-up or top-down method

17 w = d+ps Formula ? Circuit Truth Table ?

18 Circuit Design We can now do the following:
From formula or circuit, get the other From formula or circuit, get the truth table Given truth table (desired behavior), how can you construct a formula? Given truth table (desired behavior), how can you construct a circuit? Perhaps best to just do it by example.

19 Important Question Are there circuits and formulas for every possible Truth Table? In other words, if I tell you what output behavior I want, for all combinations of input values, can you create a formula and circuit which realizes that behavior?

20 Sum-of-Products method
A’B’C + A’BC + ABC A B C output 1 Expression is giant “OR” (+), with terms corresponding to each row of truth table with a “1” output. The term for a row is a product of variables, one for each input, and either negated (if 0) or unnegated (if 1). A’B’C A’BC ABC

21 Sum-of-Products method
EXAMPLE 2: (you do it) A B C output 1

22 Universality The sum-of-products method shows that no matter what truth table we start with, we can create a circuit from AND, OR, NOT This means that {AND, OR, NOT} are Universal: they can be used to make a circuit for any behavior desired That’s why all we need to build a computer are AND, OR, NOT gates.

23 Other Gates XOR NAND NOR A B Out 1 A B Out 1 A B Out 1
1 A B Out 1 A B Out 1 Amazing Fact: {NAND} is universal all by itself!!

24 More complex circuits Two-bit adder
(“XOR” is 1 when exactly one of inputs is 1) Play with the actual circuit in SimCir

25

26 Boolean Algebra Can simplify complex expressions, just like arithmetic simplification Example: distributive: A(B+C) = AB+AC but also A+BC = (A+B)(A+C) Can show some expressions equivalent to others. Entire industry… circuit simplification/minimization.

27 Transistors Transistors to gates: Sec 4.3 in text Reading and Demo:

28

29 1 micron = 1/ inch .13 micron feature resolution on chips ~1 billion gates on chip. Incredible complexity - how could such a thing be built ??!! (ultimately, we’ll grow them?!)

30 How did we get from {0,1,and/or/not} to TODAY ??!!
How is it possible to build a car, or a skyscraper? You don’t think about a bunch of steel, wires, etc. Complexity, difficult problems, are attacked by breaking them up into subproblems, subsystems, often in different “layers” hierarchically. CS not only has benefited from this method, but it in fact studies methods for such organization.

31 Summary Simple functional units called gates are made from transistors, and manipulate 0’s and 1’s. AND, OR, NOT, plus others Equivalence between circuits, formulas, and truth tables Sum-of-products method to build formula and circuit from a given truth-table specification Set of gates is universal - can realize any truth table or formula we care to specify Complex circuits (we’ll see more later) built out of simple gates to do interesting things


Download ppt "At the bottom, all data is binary"

Similar presentations


Ads by Google