Upload
andrea-neal
View
221
Download
1
Tags:
Embed Size (px)
Citation preview
Test #1 rescheduled to Test #1 rescheduled to next Tuesday, 09/20/05next Tuesday, 09/20/05
The contents will cover chapter 1, 2, The contents will cover chapter 1, 2, and part of Chapter 4.and part of Chapter 4.
Read the related chapters and do the Read the related chapters and do the exercises in the text book.exercises in the text book.
I will give you a brief review on I will give you a brief review on Thursday. Thursday.
"Computers in the future may "Computers in the future may weigh no more weigh no more
than 1.5 tons." than 1.5 tons." Popular Mechanics, forecasting Popular Mechanics, forecasting
the relentlessthe relentless march of science, 1949 march of science, 1949
"I think there is a world market for may be five computers."
Thomas Watson, chairman of IBM, 1943
"There is no reason anyone would want a computer in their home."
Ken Olson, president, chairman and founder of Digital Equipment Corp., 1977
Chapter 4: ObjectivesChapter 4: Objectives
Understand purpose of binary numbersUnderstand purpose of binary numbers Be able to work with binary numbers.Be able to work with binary numbers. Know conditions of bistable Know conditions of bistable
environment and how they are met.environment and how they are met. Determine truth value of Booleans.Determine truth value of Booleans. Identify transistor diagrams for AND, Identify transistor diagrams for AND,
OR, and NOT gates.OR, and NOT gates. Construct & interpret circuit diagrams. Construct & interpret circuit diagrams.
Chapter 4, Sections 1 & 2Chapter 4, Sections 1 & 2
Introduction; Binary Numbering Introduction; Binary Numbering SystemSystem
Objectives:Objectives: Understand the reason binary numbers are used.Understand the reason binary numbers are used. Translate binary and other bases to decimal.Translate binary and other bases to decimal. Do simple binary calculations.Do simple binary calculations. Know conditions of bistable environment and the Know conditions of bistable environment and the
way in which light switches, magnetic cores and way in which light switches, magnetic cores and transistors meet them.transistors meet them.
4.1 Introduction4.1 Introduction
Our computing agent: Electronic Our computing agent: Electronic Digital Computer, from the bottom up.Digital Computer, from the bottom up.
Ch. 4: At the bottom: digital logic Ch. 4: At the bottom: digital logic components (transistors, gates, components (transistors, gates, circuits)circuits)
Ch. 5: Four basic subsystems Ch. 5: Four basic subsystems (memory, ALU, CU, I/O) built from (memory, ALU, CU, I/O) built from digital logic components, and digital logic components, and organized into a complete computer organized into a complete computer system. system.
4.2 Binary Numbering 4.2 Binary Numbering SystemSystem
What is it?What is it? What are the digits in decimal What are the digits in decimal system?system? In the binary system? In the binary system?
Why we use binary in computers:Why we use binary in computers: More reliable More reliable Can be built from bi-stable Can be built from bi-stable devicesdevices
Bases commonly used in Bases commonly used in Computer ScienceComputer Science
DecimalDecimal (base 10) Digits: 0, 1, 2, ..., 9 (base 10) Digits: 0, 1, 2, ..., 9 Place Value: 10 Place Value: 10n n ... 10... 103 3 10 1022 10 1011 10 1000
BinaryBinary (base 2) Digits: 0, 1 (base 2) Digits: 0, 1 Place Value: 2 Place Value: 2n n ... 2... 23 3 2 222 2 211 2 200
OctalOctal (base 8) Digits: 0, 1, 2, ..., 7 (base 8) Digits: 0, 1, 2, ..., 7 Place Value: 8 Place Value: 8n n ... 8... 83 3 8 822 8 811 8 800
HexidecimalHexidecimal (base 16) (base 16) Digits: 0, 1, ..., 9, A, B, C, D, E, F Digits: 0, 1, ..., 9, A, B, C, D, E, F Place Value: 16 Place Value: 16n n ... 16... 163 3 16 1622 16 1611 16 1600
Converting from other Converting from other bases to Decimalbases to Decimal
Binary to decimal: 0101 1011Binary to decimal: 0101 10110*20*277 + 1*2 + 1*266 + 0*2 + 0*25 5 + 1* 2+ 1* 244
+ 1*2+ 1*233 + 0*2 + 0*222 + 1*2 + 1*21 1 + 1* 2+ 1* 200 = 91= 91 Octal to decimal: 2537Octal to decimal: 2537
2*82*833 + 5*8 + 5*822 + 3*8 + 3*81 1 + 7* 8+ 7* 800 = 1375= 1375 Hexadecimal to decimal: A3FHexadecimal to decimal: A3F
10*1610*1622 + 3*16 + 3*161 1 + 15* 16+ 15* 1600 = 2623= 2623
Representing Data in Representing Data in BinaryBinary
using 8 bits (one byte)using 8 bits (one byte) unsigned numbers:unsigned numbers:
(same as previous slide) (same as previous slide) signed numbers:signed numbers:
Use leftmost bit for sign: Use leftmost bit for sign: 1 for - 0 for + 1 for - 0 for + Represent: -56 +56 Represent: -56 +56
characters:characters: ASCII code for each. (See figure ASCII code for each. (See figure 4.3) 4.3)
Bistable DevicesBistable Devices
Two stable energy statesTwo stable energy states Two states widely separatedTwo states widely separated Can sense which state without Can sense which state without
destroying itdestroying it Can switch from one state to Can switch from one state to
anotheranother
ExamplesExamples
Two balls at different potential Two balls at different potential energy stateenergy state
. .
. .
ExamplesExamples
A capacitor in charged state and A capacitor in charged state and discharged state.discharged state.
+ + + +
_ _ _ _
It is similar to the a charged battery and discharged battery.
ExamplesExamples
Different magnetized state.Different magnetized state.
N
S
S
N
Binary Storage DevicesBinary Storage Devices
Devices which have been used for Devices which have been used for
primary computer memory--primary computer memory-- vacuum tubes vacuum tubes magnetic coremagnetic core transistortransistor integrated circuitintegrated circuit
4.1, 4.2 Homework4.1, 4.2 Homework
Read Sections 4.1 and 4.2.Read Sections 4.1 and 4.2. Count to 32 in binary (Use 6 bits)Count to 32 in binary (Use 6 bits) Exercises, p. 179 # 1, 3, 5, 8Exercises, p. 179 # 1, 3, 5, 8
4.3.1 Boolean 4.3.1 Boolean LogicLogic
A branch of mathematics A branch of mathematics which deals with two logical which deals with two logical
values:values:
True and FalseTrue and False
Boolean ExpressionsBoolean Expressions
A mathematical expression that has a A mathematical expression that has a value of True or False.value of True or False.
e.g. For which integer values of A is e.g. For which integer values of A is each of the following true?each of the following true?
A < 0A < 0 A + 5 A + 5 >> 7 7
Boolean OperationsBoolean Operations
Operations on real numbers: Operations on real numbers: + - * /+ - * /
Operations on Booleans: Operations on Booleans: NOT AND NOT AND OROR
NOT OperationNOT Operation
Similar to unary minus for numbers -- Similar to unary minus for numbers -- for an integer A. for an integer A.
-A gives the opposite of A-A gives the opposite of A e.g. if A = -3, -A = ? e.g. if A = -3, -A = ?
for a Boolean P, for a Boolean P, NOT P gives the opposite of PNOT P gives the opposite of P e.g. if P = False, NOT P = ? e.g. if P = False, NOT P = ?
Either a zero “0” or a “1”Either a zero “0” or a “1”
In Boolean Algebra, there are only In Boolean Algebra, there are only two values can be taken by any two values can be taken by any variables:variables:
““00” or “” or “11””
AND OperationAND OperationBinary operation like integer Binary operation like integer
multiplication multiplication
Partial Partial multiplication multiplication
table for A * Btable for A * B
Complete truth table Complete truth table for Boolean ANDfor Boolean AND
A B A*B-1 -1 10 -1 01 -1 -1
P Q P & QF F FF T FT F FT T T
OR OperationOR Operation
P OR Q is True P OR Q is True when either one is when either one is true or both are true or both are true.true.
Complete the truthComplete the truth
table for Boolean table for Boolean OROR
P Q P O R Q F FF TT FT T
Evaluating Boolean Evaluating Boolean ExpressionsExpressions
Evaluate each to True or False for the Evaluate each to True or False for the given values. given values.
For A = -1, B = 5, and C = 0For A = -1, B = 5, and C = 0 (A < 0) AND (B > 10)(A < 0) AND (B > 10) (A * C = C) OR NOT(C = 0) (A * C = C) OR NOT(C = 0) NOT [ (A < C) AND (B >= C) ]NOT [ (A < C) AND (B >= C) ] (B = 5) OR ([A + C] = A) AND ([A + B] = (B = 5) OR ([A + C] = A) AND ([A + B] =
3) (Precedence rule: Do AND before OR)3) (Precedence rule: Do AND before OR)
4.3.2 Electronic Gates 4.3.2 Electronic Gates for for
AND, OR, NOTAND, OR, NOTBuilt from transistors, the gates Built from transistors, the gates
produce the correct output for any produce the correct output for any given inputs.given inputs.
Symbols for the gates: Figure 4.15Symbols for the gates: Figure 4.15
How gates are built from transistors:How gates are built from transistors:
Figures 4.16, 4.17, 4.18Figures 4.16, 4.17, 4.18
Homework for 4.3Homework for 4.3
Read Section 4.3Read Section 4.3 Exercises pp. 179-180 #17, and #18Exercises pp. 179-180 #17, and #18
4.4 Circuits4.4 Circuits
CircuitCircuit: a set of logic gates that take : a set of logic gates that take binary inputs and transform them binary inputs and transform them into binary outputs.into binary outputs.
Some things computer circuits do:Some things computer circuits do: Math operations like additionMath operations like addition Comparisons (e.g. Are two inputs Comparisons (e.g. Are two inputs
equal?) equal?)
Three Ways to Represent Three Ways to Represent a Circuita Circuit
Circuit diagramCircuit diagram
Boolean expressionBoolean expression
Truth tableTruth table
Circuit Diagram: Circuit Diagram: Building BlockBuilding Block
AND, OR, and NOT gatesAND, OR, and NOT gates
+
A
B
C
C = A AND BC = A B.
A
B
C
C = A OR BC = A + B
A C
C = A NOTC = A
Construct a Circuit from Construct a Circuit from aa
Boolean ExpressionBoolean ExpressionConstruct a circuit diagram from the Construct a circuit diagram from the
following Boolean expression:following Boolean expression:
(a or b) and (c or d)(a or b) and (c or d)
Construct a Boolean Construct a Boolean Expression from a Truth Expression from a Truth
TableTable Example: to write the Example: to write the
Boolean expression forBoolean expression for
the following truth the following truth table table
a b a b c(output)c(output)
0 0 00 0 0
0 1 10 1 1
1 0 11 0 1
1 1 01 1 0
Sum of products Sum of products methodmethod
for each 1 outputfor each 1 output construct an construct an and and
sub-expressionsub-expressionusing using notnot for 0 for 0 inputsinputs
construct an construct an oror expression from expression from the the and and sub-sub-expressionsexpressions
Circuit DesignCircuit Design
Design a circuit to compare two bits. Design a circuit to compare two bits. The output should be 1 if the bits are The output should be 1 if the bits are equal and 0 otherwise.equal and 0 otherwise.
To design the circuit:To design the circuit: Construct the truth tableConstruct the truth table Write the Boolean expressionWrite the Boolean expression Construct the circuit diagramConstruct the circuit diagram
(Check on simulator.) (Check on simulator.)
Circuit to do AdditionCircuit to do Addition
A full adder circuit must be able to do A full adder circuit must be able to do additions such as the following:additions such as the following:
1 0 1 11 0 1 1
+ 0 1 1 1+ 0 1 1 1
What is the correct answer?What is the correct answer?
Diagram of a Full 4-bit Diagram of a Full 4-bit AdderAdder
a4 b4 c4=0c3
b3a3
s4s3s2s1
c1 c2b1 b2a1 a2
c0
one-bitadder
Construct a One-Bit Construct a One-Bit AdderAdder
Once we construct a one-bit adder, Once we construct a one-bit adder, we may connect as many together we may connect as many together as we like, as shown on the as we like, as shown on the previous slide.previous slide.
Construct the truth tableConstruct the truth table Write the Boolean expressionWrite the Boolean expression Construct the circuit diagramConstruct the circuit diagram
HomeworkHomework
Read Section 4.4Read Section 4.4 Do #19, p.180 and give:Do #19, p.180 and give:
truth tabletruth table boolean expressionboolean expression circuitcircuit