3. 3
5
Due Thursday, 9/5 (by 11:59 PM)
Focuses on computing environment:
o UNIX tutorial
o Using the "vim" editor
o Using the "handin" system
Computer Project #1
6
The Information Revolution
Computers have led to a third revolution for
civilization, with the information revolution taking its
place alongside the agricultural and industrial
revolutions.
This race to innovate has led to unprecedented
progress since the inception of electronic computing
in the late 1940s. Had the transportation industry
kept pace with the computer industry, for example,
today we could travel from New York to London in
a second for a penny. (Patterson and Hennessy)
4. 4
7
The Information Revolution
Driven by rapid innovation in technology
Complex applications now feasible
• World Wide Web
• Cell phones
• Computers in automobiles
• Human genome project
8
Computer architecture focuses on the functional
behavior of a computing system as viewed by
the programmer (such as the size of an integer
data object in bytes).
Computer organization focuses on the structural
relationships which are not visible to the
programmer (such as the clock frequency or the
total size of RAM).
Architecture and Organization
5. 5
9
We can view a computing
system at several levels,
from the highest level (users
running programs) to the
lowest level (transistors
operating according to the
laws of physics).
Levels of Abstraction
10
The von Neumann
model consists of five
major components:
1) input unit
2) output unit
3) arithmetic logic unit
4) memory unit
5) control unit
The von Neumann Model
6. 6
11
Refinement of the von Neumann model
Communication between components handled by the
system bus
The System Bus Model
12
Fetch Phase:
o RAM[ PC ] ==> IR
Execute Phase:
o decode IR
o take appropriate action
o update PC
The Fetch-Execute Cycle
7. 7
13
Assume each instruction is 4 bytes long
Assume PC: 00010700
Fetch phase:
o access RAM[ 00010700 ]
o copy 4 bytes (E0827003) to IR
IR now contains: E0827003
Example
14
Assume IR: E0827003
Execute phase:
o decode IR
ADD instruction on ARM
o take appropriate action
R[2] + R[3] ==> R[7]
o update PC
PC + 4 ==> PC
Example (continued)
9. 9
17
Must be able to convert between bases:
Machines use base 2 (binary)
Humans use base 10 (decimal)
Humans abbreviate base 2 using base 16
(hexadecimal) or base 8 (octal)
Number Systems
18
Decimal Hexadecimal Octal Binary
0 0 0 0000
1 1 1 0001
2 2 2 0010
3 3 3 0011
4 4 4 0100
5 5 5 0101
6 6 6 0110
7 7 7 0111
8 8 10 1000
9 9 11 1001
10 A 12 1010
11 B 13 1011
12 C 14 1100
13 D 15 1101
14 E 16 1110
15 F 17 1111
10. 10
19
Powers of Two
• 20 = 1
• 21 = 2
• 22 = 4
• 23 = 8
• 24 = 16
• 25 = 32
• 26 = 64
• 27 = 128
• 28 = 256
• 29 = 512
• 210 = 1024
• 211 = 2048
• 212 = 4096
• 213 = 8192
• 214 = 16384
• 215 = 32768
20
Base 16 often used instead of base 2
Example:
0100101101111100 = 4b7c
Groups of four bits (from right):
0100 1011 0111 1100 = 4b7c
Shorthand for Binary
11. 11
21
Base 8 sometimes used instead of base 2
Example:
010010110111110 = 22676
Groups of three bits (from right):
010 010 110 111 110 = 22676
Shorthand for Binary
22
Example: ASCII characters
A 1000001 100 0001 41
B 1000010 100 0010 42
C 1000011 100 0011 43
.
.
.
X 1011000 101 1000 58
Y 1011001 101 1001 59
Z 1011010 101 1010 5a
12. 12
23
Example: UNIX file permissions
Permissions for each file:
rwx rwx rwx (owner, group, world)
Make directory public:
chmod 755 my_directory
Make file private:
chmod 600 my_file
24
Example: 2756 base 8 ==> base 10
2756 base 8 = 2 * 83 + 7 * 82 + 5 * 81 + 6 * 80
= 1518 base 10
Nested form:
2756 base 8 = (((((((2) * 8) + 7) * 8) + 5) * 8) + 6)
= 1518 base 10
Convert Other Base to Decimal
13. 13
25
Algorithm:
answer = 0
iterate over digits in original number
answer = answer * base + current digit
Convert Other Base to Decimal
26
2756 base 8 ==> base 10
answer = 0
= (0 * 8) + 2 = 2
= (2 * 8) + 7 = 23
= (23 * 8) + 5 = 189
= (189 * 8) + 6 = 1518
2756 base 8 = 1518 base 10
Convert Other Base to Decimal
14. 14
27
Example: 44 base 10 ==> base 2
44 / 2 = 22 R 0
22 / 2 = 11 R 0
11 / 2 = 5 R 1
5 / 2 = 2 R 1
2 / 2 = 1 R 0
1 / 2 = 0 R 1
44 base 10 = 101100 base 2
Convert Decimal to Other Base
28
Example: 44 base 10 ==> base 8
44 / 8 = 5 R 4
5 / 8 = 0 R 5
44 base 10 = 54 base 8
Convert Decimal to Other Base
15. 15
29
Algorithm:
value = original number
loop until value == 0
current digit = value % base
value = value / base
Convert Decimal to Other Base
30
Base 2 ==> Base 16: group digits
ex: 1100011 base 2 ==> 63 base 16
Base 16 ==> Base 2: decompose digits
ex: 5C base 16 ==> 1011100 base 2
Other Base ==> Base 10: multiply and add
Base 10 ==> Other Base: repeated division
Summary: base conversions
16. 1
1
Today: Combinational Circuits
(H&H 2.1-2.9)
Next: continued
Handouts
Syllabus (old)
Lecture Topics
2
Self-study module #1 (this week)
Consulting hours posted
Project #1 (due no later than 9/5)
Reminder: check account password
Reminder: use Pi array
Announcements
17. 2
3
Due Thursday, 9/5 (by 11:59 PM)
Focuses on computing environment:
o UNIX tutorial
o Using the "vim" editor
o Using the "handin" system
Computer Project #1
4
Circuit design based on Boolean algebra
Three equivalent representations
o algebraic expressions
o truth tables
o circuit diagram
Combinational Circuits
18. 3
5
Expression in Boolean algebra:
F(A,B) = A'B + AB'
Truth table:
Example: Exclusive OR
A B F(A,B)
0 0 0
0 1 1
1 0 1
1 1 0
6
Circuit diagram:
A B
F(A,B)
21. 6
11
Any circuit can be defined using only:
{ NOT, AND, OR }
Other complete gate sets:
{ NAND }
{ NOR }
Complete Gate Sets
12
Useful to define gates which have more
than 2 inputs.
AND: output is 1 if all inputs are 1
OR: output is 1 if any input is 1
Not meaningful for NOT
More Than Two Inputs
22. 7
13
Can be implemented using cascading:
Can also be implemented directly
(more efficient)
More Than Two Inputs
14
Canonical Sum-of-Products Form:
F(A,B) = A'B + AB'
The expression is the sum of a series of
products, where each product is a minterm
A minterm is a product where each
variable is present (complemented or
uncomplemented)
Standard Forms
23. 8
15
For a function with two inputs, there are
four possible minterms:
m0: A'B'
m1: A'B
m2: AB'
m3: AB
Canonical SOP form has a subset of all
possible minterms
Minterms
16
For a function with three inputs, there are
eight possible minterms:
m0: A'B'C' m4: AB'C'
m1: A'B'C m5: AB'C
m2: A'BC' m6: ABC'
m3: A'BC m7: ABC
For a function with four inputs, there are
sixteen possible minterms
Minterms
24. 9
17
The following are in canonical SOP form:
F(A,B) = A'B' + A'B + AB'
G(A,B,C) = A'BC + AB'C + ABC' + ABC
H(A,B,C,D) = A'B'C'D' + A'B'CD + ABCD'
Examples
18
The following are equivalent:
F(A,B) = A'B' + A'B + AB'
F(A,B) = m0 + m1 + m2
F(A,B) = minterms( 0, 1, 2 )
Alternate notation (minterm lists)
26. 11
21
Canonical Sum-of-Products form makes it
easy to convert between representations:
Given: G(A,B,C) = minterms( 3, 5, 6, 7 )
G(A,B,C) = A'BC + AB'C + ABC' + ABC
truth table has 1's in rows m3, m5, m6, m7
circuit diagram has four AND gates (one
for each minterm) and one OR gate
22
Ideally, a Boolean expression will be as simple as
possible and still generate the correct values
Note that there are an infinite number of Boolean
expressions that represent the same function:
F(A,B) = A'B + AB'
= A'B + AB' + AB'
= A'B + AB' + AB' + AB'
Minimization
27. 12
23
The minimized (optimal, simplified) Boolean
expression is the one which has:
the fewest number of gates
the fewest number of inputs to gates
Reminder: we’re working with the complete
gate set { NOT, AND, OR }
Minimization Criteria
24
Three techniques:
Algebraic manipulation
Karnaugh map
Quine-McCluskey algorithm
Minimization Techniques
28. 13
25
Apply the postulates and theorems of
Boolean algebra:
AB' + AB = A(B' + B) (distributive law)
= A(1) (complement law)
= A (identity law)
Algebraic Manipulation
26
F(A,B,C) = A'BC' + A'BC + ABC' + ABC
= A'B(C' + C) + ABC' + ABC
= A'B(1) + ABC' + ABC
= A'B + ABC' + ABC
= A'B + AB(C' + C)
= A'B + AB(1)
= A'B + AB
= (A' + A)B
= (1)B
= B
29. 14
27
Fill in the entries in a K-map, then inspect it
to identify the optimal expression
Karnaugh map is rectangular and has one
entry for each minterm – adjacent minterms
can be combined (same rules as algebraic
manipulation)
Karnaugh Map
28
K-map for function with 2 inputs
A' A
B' m0 m2
B m1 m3
A
0 1
B
0 m0 m2
1 m1 m3
30. 15
29
Minimized function: F(A,B) = A
Example: F(A,B) = AB' + AB
A' A
B' 0 1
B 0 1
A
0 1
B
0 0 1
1 0 1
30
Minimized function: F(A,B) = AB' + A'B
Example: F(A,B) = AB' + A'B
A' A
B' 0 1
B 1 0
A
0 1
B
0 0 1
1 1 0
31. 16
31
K-map for function with 3 inputs
A'B' A'B AB AB'
C' m0 m2 m6 m4
C m1 m3 m7 m5
32
K-map for function with 3 inputs
AB
00 01 11 10
C
0 m0 m2 m6 m4
1 m1 m3 m7 m5
32. 17
33
F(A,B,C) = minterms( 2, 3, 6, 7 )
= A'BC' + A'BC + ABC' + ABC
= A'B(C' + C) + ABC' + ABC
= A'B + ABC' + ABC
= A'B + AB(C' + C)
= A'B + AB
= (A' + A)B
= B
Ex: Algebraic Manipulation
34
F(A,B,C) = B
Ex: Karnaugh Map
A'B' A'B AB AB'
C' 0 1 1 0
C 0 1 1 0
33. 18
35
F(A,B,C) = B
Ex: Karnaugh Map
AB
00 01 11 10
C
0 0 1 1 0
1 0 1 1 0
36
The majority function is true when more than half
of the inputs are true.
Majority function
on 3 inputs:
Application: Majority Function
39. 24
47
Start with 1’s which are isolated
Find 1’s that can only be included in 2-cover
Find 1’s that can only be included in 4-cover
Find 1’s that can only be included in 8-cover
Continue until all 1’s covered at least once
Order is important!
48
K-maps are "circular":