Computer Science 1000 Digital Circuits
Digital Information computers store and process information using binary as we’ve seen, binary affords us similar advantages as other representations e.g. we saw how we could add binary numbers, just as we add decimal numbers
Binary Representation recall that the way in which information is represented depends on the component RAM: capacitor charge hard drive: magnetic fields processor: voltages for our purposes, the most important point to remember is that there are exactly two states binary numbers: 1 0 logic: true false gate input/outputs: on off your text refers to such a binary system as a PandA representation, where information is made up of states that are Present and Absent
PandA from pg. 198 of your text
Processing your CPU processes information what does that mean? one possible definition: create a new state (output) from an existing state (input) by state, I am referring to a binary sequence Input Processing Output
Processing – Example consider our addition example from the previous lecture Input (Existing State) Output (New State)
0010 Processing – Example what we require is a device that can: take two binary numbers as input produces their sum as output in fact, this is (part of) what the arithmetic logic unit (ALU) in your processor does the question is: how? Binary Adder
Logic Gates at a very basic level, processors are constructed using gates a logic gate is a very simple device: has a number of inputs produces a single output think of each input as a wire that is either on or off on represents a 1 in binary, or a true in logic off represents a 0 in binary, or a false in logic
Logic Gates - Continued the output of a logic gate depends on (and only on) its inputs in other words, for each possible combination of its inputs, there is a specific output we represent this using a truth table the truth table of a gate depends on its type
Not Gate one of the simplest gate types also known as an inverter takes one input, and produces a single output symbol: InputOutput
Not Gate a not-gate simply inverts its input that is if its input wire is on, its output is off if its input wire is off, its output is on hence, the truth table is constructed as follows: InputOutput onoff on
Truth Table Representation in the interest of space, on and off in truth tables are often represented as 1 and 0 hence, our previous truth would be written as follows: unless otherwise stated, this will be the representation that we adopt InputOutput 01 10
AND Gate an example of a gate with two inputs its output is on only if both of its inputs are on otherwise, the output is off Symbol: ABOutput Truth Table:
Truth Table – Multiple Inputs note that our truth table now has four rows one for each possible configuration of inputs suppose we had a gate with three inputs how many rows would that require? ABCOutput In general, any circuit with n binary inputs will require 2 n rows in its truth table.
Digital Circuits by themselves, gates are quite limited in what they do there are only so many uses for an AND gate the real power of gates is when we begin to combine them that is, the output of one gate becomes the input to another gate
Digital Circuits Example: suppose we have a NOT gate and an AND gate we could connect them in the following configuration notice that we still have two inputs (A,B) and one output the output of the not gate is attached to the first input of the AND gate
Digital Circuits Example: what does the truth table of our circuit look like? to determine this, let’s consider each input state individually ABOutput
Digital Circuits Example: when A is 0 and B is 0 the output of the not gate is 1 hence, the input to our AND gate is 1 and 0 the output of our AND gate is 0 ABOutput
Digital Circuits Example: when A is 0 and B is 1 the output of the not gate is 1 hence, the input to our AND gate is 1 and 1 the output of our AND gate is 1 ABOutput
Digital Circuits Example: when A is 1 and B is 0 the output of the not gate is 0 hence, the inputs to our AND gate are 0 and 0 the output of our AND gate is 0 ABOutput
Digital Circuits Example: when A is 1 and B is 1 the output of the not gate is 0 hence, the inputs to our AND gate are 0 and 1 the output of our AND gate is 0 ABOutput
Digital Circuit previous example demonstrated a digital circuit an assembly of logic gates like logic gates, each digital circuit has: input(s) output(s) a truth table like logic gates, digital circuits can be used in the construction of other circuits output from one circuit connected to another digital circuit
Digital Circuit - Rendering circuits are often rendered in an enclosed shape this makes it clear what the inputs and outputs to the system are
Digital Circuit - Rendering in fact, if we know the inputs, outputs, and truth table, then we often are not concerned with how the circuit is built becomes a “black box” handy when this circuit is used as part of a larger circuit ABOutput
Digital Circuit – Example 2 suppose I rearrange my previous circuit into the following configuration what would the truth table of this circuit be?
Digital Circuit – Example 2 Answer (discussed in class): ABOutput
Digital Circuit – Solving our circuits so far are reasonably small, and therefore easy and quick to derive truth table step through each individual configuration of the inputs however, as circuits grow, this task becomes more difficult and time consuming
Digital Circuit – Solving as a consequence, it is often helpful to label intermediate points in the circuit, and solve for those points explicitly in the truth table usually, these intermediate points are the output from a gate that are being input into another gate consider our previous example let’s label the output of the NOT gate as point C C
Digital Circuit – Solving now, when we create our truth table, we will create an “output” column for C as well although this might initially seem like more work, it will ultimately make computing the output easier C ABCOutput
Digital Circuit – Solving compute the values for column C C ABCOutput ABC
Digital Circuit – Solving now, compute the values for the output column notice that the output depends only on C and B we need not even consider A the output is 1 if C and B are 1, and 0 otherwise C ABCOutput ABC ABC
OR Gate another common example of a gate with two inputs its output is off only if both of its inputs are off otherwise, the output is on notice how this contrasts with and Symbol: ABOutput Truth Table:
Digital Circuit suppose we replace the AND gate in our previous circuit with an OR gate compute the resulting truth table for the output ABOutput
Digital Circuit first, to simplify our computation, let’s add an intermediate point at the NOT gate call it C C will require a column in the truth table ABOutput C ABC
Digital Circuit now, let’s calculate the values for column C C ABCOutput ABC
Digital Circuit now, we can calculate the values for the output based on columns B and C recall our definition for the OR gate – the output is off if both of its inputs are off, and on otherwise C ABCOutput ABC ABC