today’s topics digital logic design digital logic design boolean logic boolean logic digital logic...

39
Today’s Topics Today’s Topics Digital Logic Design Digital Logic Design Boolean Logic Boolean Logic Digital Logic Circuits Digital Logic Circuits

Upload: marjory-greene

Post on 24-Dec-2015

281 views

Category:

Documents


5 download

TRANSCRIPT

Today’s TopicsToday’s Topics

Digital Logic DesignDigital Logic Design Boolean LogicBoolean Logic Digital Logic CircuitsDigital Logic Circuits

What is Digital Logic?What is Digital Logic?

Discrete circuitry, where the only Discrete circuitry, where the only valid values are a 1 or 0.valid values are a 1 or 0.

Represented by building blocks of Represented by building blocks of defined functionality.defined functionality.

An application of boolean logic.An application of boolean logic.

VariablesVariables (e.g.: A, B, …)(e.g.: A, B, …) can have value of 0 or 1 (false or true)can have value of 0 or 1 (false or true)

FunctionalFunctional LogicalLogical BooleanBoolean

NOTNOT(A)(A) ~~AA AA

ANDAND(A, B)(A, B) A A ANDAND B B ABAB

OROR(A, B)(A, B) A A OROR B B AA++BB

XORXOR(A, B)(A, B) A A XORXOR B B A BA B

NANDNAND(A, B)(A, B) A A NANDNAND B B ABAB

NORNOR(A, B)(A, B) A A NORNOR B B A A ++ B B

XNORXNOR(A, B)(A, B) A A XNORXNOR B B A BA B

Boolean notationBoolean notation

+

+

Truth tables: 0 = false, 1 = Truth tables: 0 = false, 1 = truetrue

XX YY RR

00 00 00

00 11 00

11 00 11

11 11 00

XX YY ZZ RR

00 00 00 00

00 00 11 00

00 11 00 00

00 11 11 11

11 00 00 11

11 00 11 11

11 11 00 11

11 11 11 11

2 input, 1 output

R = XY

3 input, 1 output

R = X+(YZ)

Using truth tablesUsing truth tables

Define a Boolean functionDefine a Boolean function Specify an output for each possible Specify an output for each possible

combination of inputscombination of inputs Prove that two functions are Prove that two functions are

equivalentequivalent Make a truth table for each functionMake a truth table for each function Identical outputs implies equivalent Identical outputs implies equivalent

functionsfunctions

Internal (electric) Internal (electric) representationrepresentationof binary codesof binary codes

Power sourcePower source GatesGates

Made of one or more transistorsMade of one or more transistors Only 2 voltages are permittedOnly 2 voltages are permitted

Low (e.g., 0.5v) represents binary 0Low (e.g., 0.5v) represents binary 0 High (e.g., 1.0v) represents binary 1High (e.g., 1.0v) represents binary 1

Can "convert" low Can "convert" low high using gates high using gates For any given set of inputs For any given set of inputs (0s and (0s and

1s)1s), gates can be combined to , gates can be combined to produce either output produce either output (0 or 1)(0 or 1)..

These combinations of gates are calledThese combinations of gates are called digitaldigital circuitscircuits

Gates are used to implement Gates are used to implement Boolean algebraBoolean algebra

"inverter"

AnyAny desired output can be desired output can be produced by combining these produced by combining these three "functions" to create a three "functions" to create a

circuit.circuit.

These additional gates can These additional gates can simplify and/or reduce simplify and/or reduce costcost of a of a

circuitcircuit

Boolean functionsBoolean functions

A function of A function of nn binary binary variables has 2variables has 2nn possible combinations possible combinations of values for the of values for the variables.variables. e.g., f(A,B,C) has 2e.g., f(A,B,C) has 233 = 8 = 8

combinations of values combinations of values for A, B, and C.for A, B, and C.

So … a So … a functionfunction can be can be completely described by completely described by its its truth tabletruth table..

AA BB CC

00 00 00

00 00 11

00 11 00

00 11 11

11 00 00

11 00 11

11 11 00

11 11 11

Example:Example: Let Let f f (A,B,C) be (A,B,C) be

defined by the truth defined by the truth table at the right.table at the right.

To write this in To write this in Boolean notationBoolean notationn select all rows with R = select all rows with R =

11n ANDAND the values in each the values in each

row, using X for 1, X for row, using X for 1, X for 00

n OROR the resulting terms the resulting termsn Set R = resulting Set R = resulting

expressionexpression

AA BB CC RR

00 00 00 00

00 00 11 11

00 11 00 11

00 11 11 00

11 00 00 11

11 00 11 00

11 11 00 00

11 11 11 11

ABCCBACBACBAR

Connection! We have Connection! We have gatesgates that that can implement this function as a can implement this function as a circuitcircuit..

In its most primitive form:In its most primitive form:

ABCCBACBACBAR

VerificationVerification

Test all possible Test all possible combinations of combinations of input to verify that input to verify that the circuit the circuit implements the implements the functionfunction

AA BB CC RR

00 00 00 00

00 00 11 11

00 11 00 11

00 11 11 00

11 00 00 11

11 00 11 00

11 11 00 00

11 11 11 11

ABCCBACBACBAR

Simplifications:Simplifications:

Multiple-input gatesMultiple-input gates Equivalent gatesEquivalent gates Use Boolean algebra to simplify the Use Boolean algebra to simplify the

function before implementing the function before implementing the circuit.circuit.

Boolean identitiesBoolean identities

Definition: A B = AB + AB+

SimplifySimplify

ABCCBACBACBAR )BCCB(A)CBCB(AR

)CB(A)CB(AR

CBAR

Distributive

Definition, distributiveDefinition

Representation of Representation of arithmetic / algebra arithmetic / algebra

circuitscircuits

TruthTruth

tabletable

Boolean Boolean CircuitCircuit function function diagramdiagram

ConversionsConversions Circuit diagram to Boolean functionCircuit diagram to Boolean function Circuit diagram to truth tableCircuit diagram to truth table Truth table to diagramTruth table to diagram

Simplification by eliminating the "don't Simplification by eliminating the "don't cares"cares"

Truth table to Boolean functionTruth table to Boolean function Simplification by eliminating the "don't Simplification by eliminating the "don't

cares"cares" Boolean function to truth tableBoolean function to truth table

Simplification by Boolean identitiesSimplification by Boolean identities Boolean function to circuit diagramBoolean function to circuit diagram

Simplification by Boolean identitiesSimplification by Boolean identities

CMOS Inverter at the CMOS Inverter at the transistor leveltransistor level

Integrated circuitsIntegrated circuits

ScaleScale SSI: 1956-1960’s (10’s of transistors)SSI: 1956-1960’s (10’s of transistors) MSI: 1960’s -1970’s (100’s of transistors)MSI: 1960’s -1970’s (100’s of transistors) LSI: 1970’s – 1980’s (10,000’s of LSI: 1970’s – 1980’s (10,000’s of

transistors)transistors) VLSI: 1980’s – present (100k – billions)VLSI: 1980’s – present (100k – billions)

Gate to I/O ratioGate to I/O ratio I/O take much more space than gatesI/O take much more space than gates

VLSI: Pentium 3 VLSI: Pentium 3

MultiplexersMultiplexers

Decoder (demultiplxer)Decoder (demultiplxer) – – select one output lineselect one output line

MultiplexersMultiplexers ““All-purpose” implementation of a All-purpose” implementation of a

truth table.truth table. 22nn combinations of data inputs, combinations of data inputs, nn

control inputs, one outputcontrol inputs, one output

1

0In B

In A

Select

Output

Show the truth table for this Show the truth table for this multiplexermultiplexer

(“Homework” #3, problem #1)(“Homework” #3, problem #1)4 data bits, 2 control bits4 data bits, 2 control bits

D3

D0

Output

D1

D2

S0 S1

S0 S1 Output

0 0 D0

0 1 D1

1 0 D2

1 1 D3

What does this circuit do?What does this circuit do?(“Homework” #3, problem (“Homework” #3, problem

#2)#2)

A B S C

0 0 0 0

0 1 1 0

1 0 1 0

1 1 0 1

What does this circuit do?What does this circuit do?(“Homework” #3, problem (“Homework” #3, problem

#3)#3)

ComparatorsComparators

Shifters (right/left) controlled Shifters (right/left) controlled by by CC

AddersAdders

Bitwise addition implements “sum Bitwise addition implements “sum bit” and “carry bit”bit” and “carry bit”

Carry digits “ripple” to next adderCarry digits “ripple” to next adder Half adder: 2 inputs (corresponding Half adder: 2 inputs (corresponding

bits of two numbers), 2 outputs (sum bits of two numbers), 2 outputs (sum bit and carry-out bit)bit and carry-out bit)

Full adder: 3 inputs (same as above, Full adder: 3 inputs (same as above, plus carry-in bit), 2 outputs (same as plus carry-in bit), 2 outputs (same as above)above)

Half adderHalf adder

Full adderFull adder

Ripple carry adderRipple carry adder

Questions on gates, circuits, etc.?Questions on gates, circuits, etc.?

Quiz #4 Tuesday in class Calculator and one 4x6 two-sided notecard

permitted No sharing

Short answer, multiple-choice 40 minutes, 25 points Can be dropped as lowest quiz

Coverage: A few repeat questions from Quiz #3 Lectures #15,16,17,18 Program #4 Homeworks #2, 3

Quiz #4 Topics Two of the problems will be very similar to

problems #2 and #4 on Quiz #3 Solutions are posted

System stack How procedure call/return works

call, ret, ret n Stack frame Parameters

Value/Reference Accessing

Arrays Declaration Accessing elements (address calculation) Passing as parameters (reference) Array processing loops Array addressing modes

Quiz #4 Topics

Data-related operators OFFSET, PTR, TYPE, LENGTHOF, SIZEOF

Address calculation (2-D arrays) String operations

lodsb, stosb, std, cld Macros

Parameters Local labels Compared to procedures

NOTE: local variables will NOT be covered

Quiz #4 Topics

Reverse Polish Notation (RPN) Convert in-fix post-fix

Post-fix expression evaluation Boolean logic

Truth tables Gates and circuits

Tracing only

Questions?Questions?

Hand in “Homework” #3Hand in “Homework” #3

Quiz #4 TuesdayQuiz #4 Tuesday

Get moving on Program #5Get moving on Program #5