digital logic. 4 why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 difference...

27
Digital Logic

Upload: shon-hoover

Post on 31-Dec-2015

215 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Digital Logic

Page 2: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Why is 32-bit or 64-bit significant in terms of speed, efficiency?

Difference between OR and XOR What is a mux for? PLA Two kinds ever combined? Largest number of circuits a gate could have? What is the makeup of the CPU in terms of basic

circuit types?

Page 3: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Introduction

This topic – reviews the Boolean algebra you have studied

previously

– relates the Boolean logic to hardware

Why– so we understand how the abstractions of Boolean logic

are related to what a real machine can actually do

– This will reveal both the power and the limitations of these machines

Page 4: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

A few definitions from http://webopedia.internet.com/TERM/t/transistor.html

Transistor– A device composed of semiconductor material that amplifies a signal or opens or closes a

circuit. Invented in 1947 at Bell Labs, transistors have become the key ingredient of all digital circuits, including computers. Today's microprocessors contains tens of millions of microscopic transistors.

Semiconductor– A material that is neither a good conductor of electricity (like copper) nor a good insulator

(like rubber). The most common semiconductor materials are silicon and germanium. These materials are then doped to create an excess or lack of electrons.

– Semiconductors make it possible to miniaturize electronic components, such as transistors. Not only does miniaturization mean that the components take up less space, it also means that they are faster and require less energy.

Doping– To add elements into a semiconductor material during the manufacturing process to increase

its conductivity. The impurities added are called dopants. Common dopants include arsenic, antimony, bismuth and phosphorous.

– The type and level of doping determines whether the semiconductor is N-type (current is conducted by excess free electrons) or P-type (current is conducted by electron vacancies).

Page 5: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Transistor operation When the voltage provided to a transistor is too low, the transistor

turns off and acts like an infinite resistance.– Plumbing analogy: closed tap

When the voltage provided to a transistor is high enough, the transistor turns on and acts like a wire.– Plumbing analogy: open tap

P-type transistor acts exactly opposite from (complementary to) N-type.

Circuits that combine the two types are called CMOS (Complementary metal oxide semiconductor)

Page 6: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Inverters If the top transistor is open, the voltage

flows through it. If the bottom transistor is closed at the same time, the voltage can only flow out through OUT.

When the IN is low, the P-type transistor acts like a wire, allowing in the 2.9 volts. At the same time, the N-type transistor is closed and so the voltage has to go to OUT.

Similarly, when IN is high, P-type acts like a plug and N-type is open, so OUT gets its value from ground (0 volts).

Vout = NOT Vin.

P-type

N-type

Page 7: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

NOR gates

In order for the high voltage to get to C, both P-type transistors must be letting the voltage through. That means that both A and B must be 0 (P-type acts as a wire when its input is 0)

At the same time, the N-type transistors provide the opposite connection to ground.

C will always receive its value from either the voltage source or from groundC = NOT (A OR B) = A NOR B

Voltage source

Page 8: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

OR gates

Take the output of the NOR gate and put it through an inverter (a NOT gate) to get an OR gate

Page 9: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

NAND and AND

Similarly, we can construct NAND and then put that through an inverter to produce AND

Page 10: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Basic Gates

Now that we know we can construct the basic logic gates, we will not concern ourselves with transistors anymore. We will use symbols to abstract the operation of these gates. (Note the bubble means invert. It makes AND into NAND and can be used on inputs to mean invert the input signal.)

Inverter AND gate

OR gate NAND gateNOR gate

Page 11: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Implementing a Boolean Function

Five steps that always work:1. Write down the truth table for the function2. Provide an input line for each variable and an

inverter for each variable 3. Draw an AND gate for each term with a 1 in

the result column4. Wire the AND gates to the appropriate inputs5. Feed the output of all the AND gates into an

OR gate

Page 12: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Example – Boolean to Gates

F = A (B + C’) + A’C Step 1: Truth table

A B C F

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

Page 13: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Example – Boolean to Gates

F = A (B + C’) + A’C Step 1: Truth table

A B C F

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 1

1 0 0 1

1 0 1 0

1 1 0 1

1 1 1 1

Page 14: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Example – Boolean to Gates

Step 2 Provide the input lines, and the negation of each input

A B C

A B C F

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 1

1 0 0 1

1 0 1 0

1 1 0 1

1 1 1 1

Page 15: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Example – Boolean to Gates

Step 3: Provide an AND gate for each 1 in the function

A B C F

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 1

1 0 0 1

1 0 1 0

1 1 0 1

1 1 1 1

A B C

Page 16: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Example – Boolean to Gates

Step 4: Wire the AND gates to the appropriate inputsA B C

A B C F

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 1

1 0 0 1

1 0 1 0

1 1 0 1

1 1 1 1

Page 17: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Example – Boolean to Gates

Step 5: Feed the output of all the AND gates into an OR gate

A B C

A B C F

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 1

1 0 0 1

1 0 1 0

1 1 0 1

1 1 1 1

F

Page 18: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Simplifying Boolean Functions

Recall the properties of Boolean algebra:– Identity: 1A = A 0 + A = A

– Null: 0A = 0 1 + A = 1

– Idempotent AA=A A + A = A

– Inverse AA’=0 A + A’ = 1

– Commutative AB = BA A + B = B+A

– Associative (AB)C = A(BC) (A+B)+C = A+(B+C)

– Distributive A + BC=(A+B)(A+C) A(B+C)=AB + AC

– Absorption A(A+B)=A A+AB = A

– DeMorgan (AB)’=A’+B’ (A+B)’=A’B’

Page 19: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Algebraic equivalence

M = A’B’C’ + A’B’C + A’BC + ABC What can we do to simplify this? A’B’C’ + A’B’C = A’B’(C’ + C) = A’B’ A’BC + ABC = (A’+A)BC= BC SO, M = A’B’ + BCSome practice: Show each of the following is true:X + WX’ = X + WXY’ + Y’Z +ZX’ = XY’ +ZX’

Page 20: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Functions to Gates Again

Once we have a sum of products form for a Boolean function, making the logic diagram is even easier:– Make an AND gate for each term

– Route the outputs of all the AND gates to an OR gate.

– M = A’B’ + BC

A A’ B B’ C C’

Page 21: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Exercise

Write a function that is 1 if the majority of the inputs are 1 and is 0 otherwise. The function has three inputs.

Show the truth table for that function Draw the logic diagram.

Page 22: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

A decoder

A decoder takes inputs and interprets them as the ID of the output line to be asserted.

Two inputs can encode four values (00, 01, 10 11)

A

B

0 1 2 3

Overview

Details of the logic by MMLogic

Page 23: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Multiplexor

A multiplexor (MUX) involves input, control line(s), and output.

One input is routed to the output, depending on the control state.

A

B

S

In this simplest MUX, one control line (S) is used to

select either A or B to attach to the output.

Page 24: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Full Adder

Add bits– Input: Three parts -- the two values plus a possible

carry in– Output: the result of the addition plus a possible carry

out– Do the truth table– Make the gate level description (logic diagram)

• Be sure to produce both the sum and the carry out

Full Adder -- includes the carry

Page 25: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Programmable Logic Array (PLA)

Like a template, or a kit from which other things can be built. All the pieces are there, but they have to be combined correctly.

The AND array gives us every possible row of the truth table.

Each OR gives us one possible output. We connect any set of ANDed inputs to an OR gate to produce an output function.

Page 26: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

Logical Completeness

The set {AND, OR, NOT} is obviously a logically complete set. That is, we can implement any logic function if we combine inputs using some combination of AND, OR, NOT.

Interestingly, that is not the only logically complete set. Another such set is this: {NOR}

Page 27: Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds

NOR as logically complete

How can that be? How would we show that?

Since we know that the set {AND, OR, NOT} is logically complete, we could try to show that we can build each of those functions using only NOR gates.