computer science 1000 digital circuits. digital information computers store and process information...

36
Computer Science 1000 Digital Circuits

Upload: lynette-wade

Post on 28-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

Computer Science 1000

Digital Circuits

Page 2: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

Digital Informationcomputers store and process information

using binaryas we’ve seen, binary affords us similar

advantages as other representationse.g. we saw how we could add binary numbers,

just as we add decimal numbers

Page 3: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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

Page 4: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

PandA from pg. 198 of your text

Page 5: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

Processingyour CPU processes informationwhat 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 1205

Processing Output

Page 6: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

Processing – Exampleconsider our addition example from the

previous lecture

1011+0010 1101

Input (Existing State)

Output (New State)

Page 7: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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?

11011011

Binary Adder

0010

1011

Page 8: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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

Page 9: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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

Page 10: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

Not Gate one of the simplest gate types also known as an inverter takes one input, and produces a single output symbol:

Input Output

Page 11: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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:

Input Output

on off

off on

0 1

1 0

Page 12: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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

Input Output

0 1

1 0

Page 13: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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:

A B Output

0 0 0

0 1 0

1 0 0

1 1 1

Truth Table:

Page 14: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

Truth Table – Multiple Inputsnote that our truth table now has four rows

one for each possible configuration of inputssuppose we had a gate with three inputs

how many rows would that require?

A B C Output

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

In general, any circuit with n binary inputs will require 2n rows in its truth table.

Page 15: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

Digital Circuitsby 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

Page 16: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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

Page 17: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

Digital Circuits Example:

what does the truth table of our circuit look like? to determine this, let’s consider each input state individually

A B Output

0 0

0 1

1 0

1 1

Page 18: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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

A B Output

0 0

0 1

1 0

1 1

0

0

10

0

Page 19: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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

A B Output

0 0

0 1

1 0

1 1

0

1

11

0

1

Page 20: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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

A B Output

0 0

0 1

1 0

1 1

1

0

00

0

1

0

Page 21: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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

A B Output

0 0

0 1

1 0

1 1

1

1

00

0

1

0

0

Page 22: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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

Page 23: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

Digital Circuit - Rendering circuits are often rendered in an enclosed shape this makes it clear what the inputs and outputs to

the system are

Page 24: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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

A B Output

0 0 0

0 1 1

1 0 0

1 1 0

Page 25: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

Digital Circuit – Example 2suppose I rearrange my previous circuit into

the following configuration

what would the truth table of this circuit be?

Page 26: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

Digital Circuit – Example 2Answer (discussed in class):

A B Output

0 0 1

0 1 1

1 0 1

1 1 0

Page 27: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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

Page 28: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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

Page 29: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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 A B C Output

0 0

0 1

1 0

1 1

Page 30: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

Digital Circuit – Solving compute the values for column C

C A B C Output

0 0

0 1

1 0

1 1

A B C Output

0 0 1

0 1 1

1 0 0

1 1 0

Page 31: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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 A B C Output

0 0

0 1

1 0

1 1

A B C Output

0 0 1

0 1 1

1 0 0

1 1 0

A B C Output

0 0 1 0

0 1 1 1

1 0 0 0

1 1 0 0

Page 32: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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:

A B Output

0 0 0

0 1 1

1 0 1

1 1 1

Truth Table:

Page 33: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

Digital Circuit suppose we replace the AND gate in our previous

circuit with an OR gate compute the resulting truth table for the output

A B Output

0 0

0 1

1 0

1 1

Page 34: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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

A B Output

0 0

0 1

1 0

1 1

CA B C Output

0 0

0 1

1 0

1 1

Page 35: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

Digital Circuit now, let’s calculate the values for column C

CA B C Output

0 0

0 1

1 0

1 1

A B C Output

0 0 1

0 1 1

1 0 0

1 1 0

Page 36: Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar

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

CA B C Output

0 0

0 1

1 0

1 1

A B C Output

0 0 1

0 1 1

1 0 0

1 1 0

A B C Output

0 0 1 1

0 1 1 1

1 0 0 0

1 1 0 1