SmithLogo

CSC 103

How Computers Work

Smith Computer Science



Lecture Notes 04: Logic Gates


Outline

This class we'll discuss:





For now, we're looking at the "what?" not the "how?"




Recap: Boolean Logic

recall that we can combine logical operators to obtain a truth value output:


Now, we want to convert this logic that uses truth values into circuits that use electrical signlas.




Recap: The Water Analogy

recall that we can use water to build intuition about how circuits and signals work





The Diode

The diode is an electric component that acts like a "one way valve" but for current, instead of water.

The symbol for a diode is like an arrow with a barrier (current can onl pass in the direction of the arrow):

magic




The Transistor

A transistor is an electronics component that lets electricity pass through from one of its input pins (collector) to one of its output pins (emitter) if there is an input on the third signal pin (base).

magic

The brilliance here is that this allows an electric signal (that can be programmed) to control another electric signal; making the electric component capable of self-guidance.

The transistor works like that:



The following is an animation of a simplified transistor:



Check an animation that explains how a transistor works by using the water analogy.

One of the main uses of a transistor is as a switch, where some signal allows the passage of current to another part of the circuit.

However, the signal can be a low-voltage (low current) one and it might allow the passage of a HIGH-voltage (high-current) one.
Because of this, transistors can also be used as Amplifiers:



We can join several of these transistors in different ways to create circuits that reproduce logic operations on input variables (signals).




Combining transistors to generate logic

Given the way transistors work, and using the simplified operation shown above,
Activity 1 :[2 minutes] : Analyze this diagram and discover the behavior of the circuit:



  1. How should we analyze it?
  2. What does this resemble in Boolean Logic?




Logic Gates

A logic gate is a digital circuit that behaves like its boolean operator counterpart.

The Boolean Operations and the Logic gates are shown in the tables below:



Let's see one simplified view of a gate in and how the transistors help the logic:
and

The transistors act as switches that can let current flow through or not.
In this case, the two inputs (a and b) are used to activate the switches (into the base of the transistor) to allow the passage of a default True (current).

Note that only if both a and b are 1 does the output of the gate result in 1.

In the water analogy, it is like a pipe with a reservoir in one side and two valves in series.
and

Either both valves are open or no water flows.

Note that in this example, instead of water pressure, we are using gravity. I have added this example in case you see it somewhere else in the literature or on the web.


Activity 2 :[2 minutes] : Analyze this diagram and discover the behavior of the circuit:



  1. What does this resemble in Boolean Logic?


Building a NOT circuit

We need two switches to build a NOT:

  • \(\texttt{V}^+\) is a constant source of high voltage
  • is a ground connection (low voltage)
  • A is the input wire
  • Y is the output wire
  • The triangles in the switches indicate
  • differing response to the gate input:
    • when one is open,
    • the other will be closed


The way it works is shown below:








From Notations for Boolean functions to Circuit Diagrams

There are three ways in which we can represent Boolean functions:

  1. A Truth Table (which shows inputs and outputs for a function);
  2. Algebraic notation: Mathematical description of the combination of operators and symbols that make the funciton;
  3. Physical (real or simulated) Circuit Diagram
We've seen the first two, now let's see how we can create a circuit diagram that replicates the behavior indicated by a truth table or a mathematical notation.




Circuit Diagrams

Let's now look at converting the truth tables and algebraic notations into actual circuits!

We will be using the simplified circuit symbols that represent each gate.

Working Backwards

Before building complex circuits, let's analyze one (break it into parts and understand its function).

Activity 3 :[2 minutes] : Analyze this diagram and discover the behavior of the circuit:



Express the output (Y) in terms of the inputs ( A, B, C).
  1. Express this circuit in algebraic notation.
  2. Fill out the following table:

Working Forwards



We're going to produce two circuits using an online simulator.

The link for the simulator is this one: logic.ly

The following image shows the main view of the work area:


(No need to buy it!)

The following are the symbols for "input", "lightbulb output", and a "NOT" gate.



The following are the symbols for "and", an "or", and "NOT" gates.



The following is the "label" sign (to mark or annotate your circuits).



You can see several examples here: logic.ly samples.

Circuit Exercises

Activity 4 :[3 minutes] : Use the simulator to replicate this circuit and extract its truth table or algebraic expression:




You'll note that the output is "fed-back" to the input. That is OK. Simply build the circuit to test how it works and follow the rules to build a table.
  1. First: How many inputs does this have?
  2. Second: Build the algebraic notation and/or truth table (you can use the actual circuit to verify)
  3. Third: Are all input-output combinations possible?


Activity 5 :[3 minutes] : Use the simulator to construct the circuit for the following expression: \[ Y=( \overline{A \cdot B} ) \oplus (C+D) \]

If we have time:

Activity 6 :[3 minutes] : Create the diagram and truth table for the following circuit:



Note that:





The Format for the Final Project

The final project will have the following format:



Topics:

  1. Multi-core processors
  2. Smartphone
  3. Tablet
  4. Parallel computing
  5. Sensor technology
  6. Chatbots
  7. Cloud gaming
  8. Smart speakers (Alexa, Siri, Cortana)
  9. Computing in the medical world (bioinformatics, biomedical informatics)
  10. Speech recognition technology and software
  11. Wearable computing
  12. Sensor technology
  13. Nanotechnology and computing
  14. Supercomputers
  15. Quantum computers
  16. Robotics




Before next class (Thursday 09/16)



[Due for everyone]
read about Signed number representation




1-Minute Debrief

Please fill this out before leaving:

Enter the password to proceed:






1-Minute Debrief