Computer Science 101 Logic Gates and Simple Circuits.

of 25/25
Computer Science Computer Science 101 101 Logic Gates and Simple Logic Gates and Simple Circuits Circuits
  • date post

  • Category


  • view

  • download


Embed Size (px)

Transcript of Computer Science 101 Logic Gates and Simple Circuits.

  • Computer Science 101Logic Gates and Simple Circuits

  • Transistor - Electronic SwitchBase High (+5v or 1) Makes connectionBase Low (0v or 0) DisconnectsSay, 500 million transistors on a chip 1 cm2Change states in billionth of secSolid state

  • Moores LawIn 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.

  • GatesA gate is an electronic device that takes 0/1 inputs and produces a 0/1 result.

  • NOT Gate+5v InputGroundInput High (+5v or 1) Output Low (0v or 0) Input Low (0v or 0) Output High (+5v or 1) Output is opposite of InputOutput

  • AND Gate+5vOutput is 1 only ifInput-1 is 1 andInput-2 is 1 Output = Input1 AND Input2Output

  • OR GateOutput is 1 ifA is 1 or ifB is 1Output = A OR B

  • Boolean Expression PythonLogical operatorsAND and (Python)OR or (Python)NOT not (Python) 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)))) :

  • AbstractionIn 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. In this way, we are able to focus on the big picture. If the implementation changes, our high level work is not affected.

  • Abstraction ExamplesBoolean 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 ). Dont have to know how gate is constructed from transistors.

  • Boolean Exp Logic CircuitTo draw a circuit from a Boolean expression: 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. Still working from left to right, build up circuits for the subexpressions, from simple to complex.

  • Logic Circuit: _ ____ AB+(A+B)BABInput Lines for Variables

  • Logic Circuit: _ ____ AB+(A+B)BABNOT Gate for B_B

  • Logic Circuit: _ ____ AB+(A+B)BAB _Subexpression AB_B _AB

  • Logic Circuit: _ ____ AB+(A+B)BAB Subexpression A+B_B _ABA+B

  • Logic Circuit: _ ____ AB+(A+B)BAB ___ Subexpression A+B_B _ABA+B____A+B

  • Logic Circuit: _ ____ AB+(A+B)BAB ___ Subexpression (A+B)B_B _ABA+B____A+B ____(A+B)B

  • Logic Circuit: _ ____ AB+(A+B)BEntire Expression

  • Logic Circuit Boolean ExpIn 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. 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. The label on the circuit output is the result.

  • Logic Circuit Boolean Exp_ _AB+AB

  • Simplification RevisitedOnce we have the BE for the circuit, perhaps we can simplify.

  • Logic Circuit Boolean ExpReduces to:

  • The Boolean TriangleBoolean ExpressionTruthTableLogicCircuit

  • The Boolean TriangleBoolean ExpressionTruthTableLogicCircuit