Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Science 101 Logic Gates and Simple Circuits.

Similar presentations


Presentation on theme: "Computer Science 101 Logic Gates and Simple Circuits."— Presentation transcript:

1 Computer Science 101 Logic Gates and Simple Circuits

2 Transistor - Electronic Switch Collector Base EmitterSwitch Base High (+5v or 1) Makes connection Base High (+5v or 1) Makes connection Base Low (0v or 0) Disconnects Base Low (0v or 0) Disconnects Say, 500 million transistors on a chip 1 cm 2 Say, 500 million transistors on a chip 1 cm 2 Change states in billionth of sec Change states in billionth of sec Solid state Solid state

3 Moore’s Law In 1965, Intel co-founder Gordon Moore saw the future. His prediction, now popularly known as Moore's Law, states that the number of transistors on a chip doubles about every two years.

4 Gates A gate is an electronic device that takes 0/1 inputs and produces a 0/1 result. A gate is an electronic device that takes 0/1 inputs and produces a 0/1 result.

5 NOT Gate +5v Input Ground Input High (+5v or 1) Output Low (0v or 0) Input High (+5v or 1) Output Low (0v or 0) Input Low (0v or 0) Output High (+5v or 1) Input Low (0v or 0) Output High (+5v or 1) Output is opposite of Input Output is opposite of Input Output NOT Gate A _A_A

6 AND Gate +5v Output is 1 only if Output is 1 only if Input-1 is 1 and Input-2 is 1 Output = Input1 AND Input2 Output = Input1 AND Input2 Output Input-1Input-2 AND Gate A ABB

7 OR Gate Output is 1 if Output is 1 if A is 1 or if B is 1 Output = A OR B Output = A OR B +5v Output A B OR Gate A A + B B

8 Boolean Expression  Python Logical operators Logical operators AND  and (Python)AND  and (Python) OR  or (Python)OR  or (Python) NOT  not (Python)NOT  not (Python) NOT ((x>y) AND ((x=5) OR (y=3)) NOT ((x>y) AND ((x=5) OR (y=3)) not((x>y) and ((x==5)or(y==3))) not((x>y) and ((x==5)or(y==3))) while (not((x>y) and ((x==5)or(y==3)))) : … while (not((x>y) and ((x==5)or(y==3)))) : …

9 Abstraction In computer science, the term abstraction refers to the practice of defining and using objects or systems based on the high level functions they provide. In computer science, the term abstraction refers to the practice of defining and using objects or systems based on the high level functions they provide. We suppress the fine details of how these functions are carried out or implemented. We suppress the fine details of how these functions are carried out or implemented. In this way, we are able to focus on the big picture. In this way, we are able to focus on the big picture. If the implementation changes, our high level work is not affected. If the implementation changes, our high level work is not affected.

10 Abstraction Examples Boolean algebra - we can work with the Boolean expressions knowing only the properties or laws - we do not need to know the details of what the variables represent. Boolean algebra - we can work with the Boolean expressions knowing only the properties or laws - we do not need to know the details of what the variables represent. Gates - we can work with the logic gates knowing only their function (output is 1 only if inputs are …). Don’t have to know how gate is constructed from transistors. Gates - we can work with the logic gates knowing only their function (output is 1 only if inputs are …). Don’t have to know how gate is constructed from transistors.

11 Boolean Exp  Logic Circuit To draw a circuit from a Boolean expression: To draw a circuit from a Boolean expression: From the left, make an input line for each variable. From the left, make an input line for each variable. Next, put a NOT gate in for each variable that appears negated in the expression. Next, put a NOT gate in for each variable that appears negated in the expression. Still working from left to right, build up circuits for the subexpressions, from simple to complex. Still working from left to right, build up circuits for the subexpressions, from simple to complex.

12 Logic Circuit: _ ____ AB+(A+B)B A B Input Lines for Variables

13 Logic Circuit: _ ____ AB+(A+B)B A B NOT Gate for B _B_B

14 Logic Circuit: _ ____ AB+(A+B)B A B _ Subexpression AB _B_B _ AB

15 Logic Circuit: _ ____ AB+(A+B)B A B Subexpression A+B _B_B _ AB A+B

16 Logic Circuit: _ ____ AB+(A+B)B A B ___ Subexpression A+B _B_B _ AB A+B ____ A+B

17 Logic Circuit: _ ____ AB+(A+B)B A B ___ Subexpression (A+B)B _B_B _ AB A+B ____ A+B ____ (A+B)B

18 Logic Circuit: _ ____ AB+(A+B)B A B Entire Expression _ AB A+B ____ A+B _B_B ____ (A+B)B

19 Logic Circuit  Boolean Exp In the opposite direction, given a logic circuit, we can write a Boolean expression for the circuit. In the opposite direction, given a logic circuit, we can write a Boolean expression for the circuit. First we label each input line as a variable. First we label each input line as a variable. Then we move from the inputs labeling the outputs from the gates. Then we move from the inputs labeling the outputs from the gates. As soon as the input lines to a gate are labeled, we can label the output line. As soon as the input lines to a gate are labeled, we can label the output line. The label on the circuit output is the result. The label on the circuit output is the result.

20 Logic Circuit  Boolean Exp A B _A_A _B_B A+B _ AB _ AB _ AB+AB _ AB+AB ______ _ _ (AB+AB)(A+B) ______ Entire Expression

21 Simplification Revisited Once we have the BE for the circuit, perhaps we can simplify. Once we have the BE for the circuit, perhaps we can simplify.

22 Logic Circuit  Boolean Exp Reduces to:

23 The Boolean Triangle Boolean Expression Truth Table Logic Circuit

24 The Boolean Triangle Boolean Expression Truth Table Logic Circuit

25


Download ppt "Computer Science 101 Logic Gates and Simple Circuits."

Similar presentations


Ads by Google