2 gates


Published on

logic gates

Published in: Education, Technology, Business
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

2 gates

  1. 1. Computer Science 101 Logic Gates and Simple Circuits
  2. 2. Transistor - Electronic Switch <ul><li>Base High (+5v or 1) Makes connection </li></ul><ul><li>Base Low (0v or 0) Disconnects </li></ul><ul><li>Say, 500 million transistors on a chip 1 cm 2 </li></ul><ul><li>Change states in billionth of sec </li></ul><ul><li>Solid state </li></ul>Collector Base Emitter Switch
  3. 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. 4. Gates <ul><li>A gate is an electronic device that takes 0/1 inputs and produces a 0/1 result. </li></ul>
  5. 5. NOT Gate <ul><li>Input High (+5v or 1) Output Low (0v or 0) </li></ul><ul><li>Input Low (0v or 0) Output High (+5v or 1) </li></ul><ul><li>Output is opposite of Input </li></ul>+5v Input Ground Output NOT Gate A _ A
  6. 6. AND Gate <ul><li>Output is 1 only if </li></ul><ul><ul><li>Input-1 is 1 and </li></ul></ul><ul><ul><li>Input-2 is 1 </li></ul></ul><ul><li>Output = Input1 AND Input2 </li></ul>+5v Output Input-1 Input-2 AND Gate A AB B
  7. 7. OR Gate <ul><li>Output is 1 if </li></ul><ul><ul><li>A is 1 or if </li></ul></ul><ul><ul><li>B is 1 </li></ul></ul><ul><li>Output = A OR B </li></ul>+5v Output A B OR Gate A A + B B
  8. 8. Boolean Expression  Python <ul><li>Logical operators </li></ul><ul><ul><li>AND  and (Python) </li></ul></ul><ul><ul><li>OR  or (Python) </li></ul></ul><ul><ul><li>NOT  not (Python) </li></ul></ul><ul><li>NOT ((x>y) AND ((x=5) OR (y=3)) </li></ul><ul><li>not((x>y) and ((x==5)or(y==3))) </li></ul><ul><li>while (not((x>y) and ((x==5)or(y==3)))) : … </li></ul>
  9. 9. Abstraction <ul><li>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. </li></ul><ul><li>We suppress the fine details of how these functions are carried out or implemented. </li></ul><ul><li>In this way, we are able to focus on the big picture. </li></ul><ul><li>If the implementation changes, our high level work is not affected. </li></ul>
  10. 10. Abstraction Examples <ul><li>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. </li></ul><ul><li>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. </li></ul>
  11. 11. Boolean Exp  Logic Circuit <ul><li>To draw a circuit from a Boolean expression: </li></ul><ul><ul><li>From the left, make an input line for each variable. </li></ul></ul><ul><ul><li>Next, put a NOT gate in for each variable that appears negated in the expression. </li></ul></ul><ul><ul><li>Still working from left to right, build up circuits for the subexpressions, from simple to complex. </li></ul></ul>
  12. 12. Logic Circuit: _ ____ AB+(A+B)B A B Input Lines for Variables
  13. 13. Logic Circuit: _ ____ AB+(A+B)B A B NOT Gate for B _ B
  14. 14. Logic Circuit: _ ____ AB+(A+B)B A B _ Subexpression AB _ B _ AB
  15. 15. Logic Circuit: _ ____ AB+(A+B)B A B Subexpression A+B _ B _ AB A+B
  16. 16. Logic Circuit: _ ____ AB+(A+B)B A B ___ Subexpression A+B _ B _ AB A+B ____ A+B
  17. 17. Logic Circuit: _ ____ AB+(A+B)B A B ___ Subexpression (A+B)B _ B _ AB A+B ____ A+B ____ (A+B)B
  18. 18. Logic Circuit: _ ____ AB+(A+B)B Entire Expression A B _ AB A+B ____ A+B _ B ____ (A+B)B
  19. 19. Logic Circuit  Boolean Exp <ul><li>In the opposite direction, given a logic circuit, we can write a Boolean expression for the circuit. </li></ul><ul><li>First we label each input line as a variable. </li></ul><ul><li>Then we move from the inputs labeling the outputs from the gates. </li></ul><ul><li>As soon as the input lines to a gate are labeled, we can label the output line. </li></ul><ul><li>The label on the circuit output is the result. </li></ul>
  20. 20. Logic Circuit  Boolean Exp _ _ AB+AB A B _ A _ B A+B _ AB _ AB _ _ AB+AB ______ _ _ (AB+AB)(A+B) ______ Entire Expression
  21. 21. Simplification Revisited <ul><li>Once we have the BE for the circuit, perhaps we can simplify. </li></ul>
  22. 22. Logic Circuit  Boolean Exp Reduces to:
  23. 23. The Boolean Triangle Boolean Expression Truth Table Logic Circuit
  24. 24. The Boolean Triangle Boolean Expression Truth Table Logic Circuit
  25. 25. If we only had an Al Gore Rhythm!