Lecture 1: Computer architecture
Transcript of Lecture 1: Computer architecture
Technische Universität München
Section 1: Programming on a Section 1: Programming on a Section 1: Programming on a Section 1: Programming on a ComputerComputerComputerComputer
- What is a computer- What is required for calculation- A suitable representation of numbers- A rule set for the operations
(Boolean Algebra)- A (mechanical/electrical/)electronically
implementation
Section1-Page1
implementation- John-von-Neumann architecture
Technische Universität München
What is a computer
What does WIKIPEDIA say?“A computer is a general purpose device that “A computer is a general purpose device that can be programmed to carry out a set of arithmetic or logical operations.”http://en.wikipedia.org/wiki/Computer, 2013-10-20
Or the lexicon ITWissen (= “IT Knowledge”)?“Computer are [programmable] calculation machines to process calculation operations on the basis of a mechanical, an electrical or an
Section1-Page2
the basis of a mechanical, an electrical or an electronically unit. The DIN [German Industry Norm] defines a computer as an unit to process data to perform mathematical, converting, transferring or saving operations.”http://www.itwissen.info/definition/lexikon/Computer-computer.html, 2013-10-20
Technische Universität München
Section 1: Programming on a Section 1: Programming on a Section 1: Programming on a Section 1: Programming on a ComputerComputerComputerComputer
- What is a computer- What is required for that calculation- A suitable representation of numbers- A rule set for the operations
(Boolean Algebra)- A (mechanical/electrical/)electronically
implementation
Section1-Page3
implementation- John-von-Neumann architecture
Technische Universität München
What is required for that calculation
1. Step: a suitable representation of numbers1. Step: a suitable representation of numbers
2. Step: a rule set for operations
3. Step: a mechanical/electrical/electronically implementation
Section1-Page4
Technische Universität München
Section 1: Programming on a Section 1: Programming on a Section 1: Programming on a Section 1: Programming on a ComputerComputerComputerComputer
- What is a computer- What is required for that calculation- A suitable representation of numbers- A rule set for the operations
(Boolean Algebra)- A (mechanical/electrical/)electronically
implementation
Section1-Page5
implementation- John-von-Neumann architecture
Technische Universität München
A suitable representation of numbers
e.g. the decimal system (with the base 10)
a) Positional numeral system, which represents each digit with one symbol digit with one symbol
b) Each digit represents one dedicated value in the represented number on the basis b , e.g. bp (p = 0,1,2,…)
0, 1, 2, 3, 4, 5, 6, 7, 8, 90, 1, 2, 3, 4, 5, 6, 7, 8, 90, 1, 2, 3, 4, 5, 6, 7, 8, 90, 1, 2, 3, 4, 5, 6, 7, 8, 9
Number: 2 3 0 4 5 Number: 2 3 0 4 5 Number: 2 3 0 4 5 Number: 2 3 0 4 5 ( = representation)( = representation)( = representation)( = representation)
100101102103104
Section1-Page6Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991
c) Each number representation is unique, including
the zero (= 0)
1010101010
5 * 100 = 5 * 1 = 54 * 101 = 4 * 10 = 40
0 * 102 = 0 * 100 = 03 * 103 = 3 * 1000 = 3000
2 * 104 = 2 * 10000 = 20000
= value= value= value= value
Technische Universität München
d) The representation supports mathematical (+, -,
A suitable representation of numbers
e.g. the decimal system (with the base 10)
d) The representation supports mathematical (+, -,
*, /, …) and logical (equal, <, >, …) operations
2 3 0 4 52 3 0 4 52 3 0 4 52 3 0 4 5+ 3 9 9+ 3 9 9+ 3 9 9+ 3 9 9
= 2 3 4 4 4= 2 3 4 4 4= 2 3 4 4 4= 2 3 4 4 411 Carry over
2 3 0 4 5 3 9 92 3 0 4 5 3 9 92 3 0 4 5 3 9 92 3 0 4 5 3 9 9>>>>
Section1-Page7Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991
2 3 0 4 5 3 9 92 3 0 4 5 3 9 92 3 0 4 5 3 9 92 3 0 4 5 3 9 9Value of the number Value of the number>>>>
Technische Universität München
e) Fractional parts of a number can be represented,
e.g. using a point notation
A suitable representation of numbers
e.g. the decimal system (with the base 10)
e.g. using a point notation
f) Positive and negative numbers can be represented
Number: 1 . 2 4 3 Number: 1 . 2 4 3 Number: 1 . 2 4 3 Number: 1 . 2 4 3 ( = representation)( = representation)( = representation)( = representation)
10-310-210-1100
3 * 10-3 = 5 * 0.001 = 0.0034 * 10-2 = 4 * 0.01 = 0.04 2 * 10-1 = 0 * 0.1 = 0.2
1 * 101 = 1 * 1 = 1
= value= value= value= value
Section1-Page8Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991
f) Positive and negative numbers can be represented
---- 2 3 0 4 5 2 3 0 4 5 2 3 0 4 5 2 3 0 4 5 ---- 3 9 93 9 93 9 93 9 9+ 5 0 0 1+ 5 0 0 1+ 5 0 0 1+ 5 0 0 1
= sign= sign= sign= sign
Technische Universität München
BUT:BUT:BUT:BUT: difficult to be represented in a mechanical unit,difficult to be represented in a mechanical unit,difficult to be represented in a mechanical unit,difficult to be represented in a mechanical unit,e.g. with states on a mechanical boarde.g. with states on a mechanical boarde.g. with states on a mechanical boarde.g. with states on a mechanical board
A suitable representation of numbers
e.g. the decimal system (with the base 10)
e.g. with states on a mechanical boarde.g. with states on a mechanical boarde.g. with states on a mechanical boarde.g. with states on a mechanical board
0, 1, 2, 3, 4, 5, 6, 7, 8, 90, 1, 2, 3, 4, 5, 6, 7, 8, 90, 1, 2, 3, 4, 5, 6, 7, 8, 90, 1, 2, 3, 4, 5, 6, 7, 8, 9
EASIER: EASIER: EASIER: EASIER: a representation with only two states (digits)a representation with only two states (digits)a representation with only two states (digits)a representation with only two states (digits)
Section1-Page9Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991http://en.wikipedia.org/wiki/File:Jacquard.loom.cards.jpg, 2013-10-20
EASIER: EASIER: EASIER: EASIER: a representation with only two states (digits)a representation with only two states (digits)a representation with only two states (digits)a representation with only two states (digits)
0, 10, 10, 10, 1
Punch card Electric circuit
Technische Universität München
tttthe binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)
a) Positional numeral system, which represents each digit with one symbol
A suitable representation of numbers
digit with one symbol
b) Each digit represents one dedicated value in the represented number on the basis b , e.g. bp (p = 0,1,2,…)
0, 10, 10, 10, 1
Number: 1 1 0 1 0 0 1 1 Number: 1 1 0 1 0 0 1 1 Number: 1 1 0 1 0 0 1 1 Number: 1 1 0 1 0 0 1 1 ( = representation)( = representation)( = representation)( = representation)
2021222324252627
Section1-Page10Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991
1 * 20 = 1 * 1 = 11 * 21 = 1 * 2 = 20 * 22 = 0 * 4 = 00 * 23 = 0 * 8 = 0
1 * 24 = 1 * 16 = 160 * 25 = 0 * 32 = 01 * 26 = 1 * 64 = 64
1 * 27 = 1 * 128 = 128
= value= value= value= value
ΣΣΣΣ 211211211211decdecdecdec
Technische Universität München
a) Positional numeral system, which represents each digit with one symbol
tttthe binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)
A suitable representation of numbers
digit with one symbol
b) Each digit represents one dedicated value in the represented number on the basis b , e.g. bp (p = 0,1,2,…)
0, 10, 10, 10, 1
Number: 1 1 0 1 0 0 1 1 Number: 1 1 0 1 0 0 1 1 Number: 1 1 0 1 0 0 1 1 Number: 1 1 0 1 0 0 1 1 ( = representation)( = representation)( = representation)( = representation)
2021222324252627
ByteByteByteByte
BitBitBitBit
Section1-Page11Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991
1 * 20 = 1 * 1 = 11 * 21 = 1 * 2 = 20 * 22 = 0 * 4 = 00 * 23 = 0 * 8 = 0
1 * 24 = 1 * 16 = 160 * 25 = 0 * 32 = 01 * 26 = 1 * 64 = 64
1 * 27 = 1 * 128 = 128
= value= value= value= value
ΣΣΣΣ 211211211211decdecdecdec
ByteByteByteByte
Technische Universität München
b) cont.
tttthe binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)
A suitable representation of numbers
b) cont.Maximum number, represented with one byte:
Number: 1 1 1 1 1 1 1 1 Number: 1 1 1 1 1 1 1 1 Number: 1 1 1 1 1 1 1 1 Number: 1 1 1 1 1 1 1 1 ( = representation)( = representation)( = representation)( = representation)
2021222324
1 * 20 = 1 * 1 = 11 * 21 = 1 * 2 = 21 * 22 = 1 * 4 = 41 * 23 = 1 * 8 = 8
1 * 24 = 1 * 16 = 161 * 25 = 1 * 32 = 32
= value= value= value= value
252627
ByteByteByteByte
BitBitBitBit
Section1-Page12Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991
1 * 25 = 1 * 32 = 321 * 26 = 1 * 64 = 64
1 * 27 = 1 * 128 = 128
ΣΣΣΣ 255255255255decdecdecdec
���� 0000decdecdecdec –––– 255255255255decdecdecdec
((((withoutwithoutwithoutwithout a a a a signsignsignsign))))
Technische Universität München
b) cont.
tttthe binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)
A suitable representation of numbers
b) cont.
Used representations: 1 Byte = charUsed representations: 1 Byte = charUsed representations: 1 Byte = charUsed representations: 1 Byte = char2 Bytes = short2 Bytes = short2 Bytes = short2 Bytes = short4 Bytes = 4 Bytes = 4 Bytes = 4 Bytes = intintintint, long, long, long, long8 Bytes = long 8 Bytes = long 8 Bytes = long 8 Bytes = long longlonglonglong,,,,
= type identification= type identification= type identification= type identification
Section1-Page13Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991
8 Bytes = long 8 Bytes = long 8 Bytes = long 8 Bytes = long longlonglonglong,,,,long long long long (64bit systems)(64bit systems)(64bit systems)(64bit systems)
(beside other names for the type identification)
Technische Universität München
c) Each number representation is unique, including
tttthe binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)
A suitable representation of numbers
c) Each number representation is unique, includingthe zero (= 0)
d) The representation supports mathematical (+, -, *, /, …) and logical (equal, <, >, …) operations
1 0 1 1 01 0 1 1 01 0 1 1 01 0 1 1 0+ 1 1 1+ 1 1 1+ 1 1 1+ 1 1 1
= 1 1 1 0 1= 1 1 1 0 1= 1 1 1 0 1= 1 1 1 0 111 Carry over
2 2 2 2 2 2 2 2 decdecdecdec
+ 7 + 7 + 7 + 7 decdecdecdec
= 2 9 = 2 9 = 2 9 = 2 9 decdecdecdec
Section1-Page14Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991
= 1 1 1 0 1= 1 1 1 0 1= 1 1 1 0 1= 1 1 1 0 1
1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1111 1111Value of the number Value of the number>>>>
= 2 9 = 2 9 = 2 9 = 2 9 decdecdecdec
Technische Universität München
d) cont.
tttthe binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)
A suitable representation of numbers
d) cont.But attention:
1 1 1 1 1 1 1 11 1 1 1 1 1 1 11 1 1 1 1 1 1 11 1 1 1 1 1 1 1+ 1+ 1+ 1+ 1
1 0 0 0 0 0 0 0 01 0 0 0 0 0 0 0 01 0 0 0 0 0 0 0 01 0 0 0 0 0 0 0 0Carry over11111111
2 5 5 2 5 5 2 5 5 2 5 5 decdecdecdec
+ 1 + 1 + 1 + 1 decdecdecdec
= 0 = 0 = 0 = 0
Section1-Page15Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991
1 0 0 0 0 0 0 0 01 0 0 0 0 0 0 0 01 0 0 0 0 0 0 0 01 0 0 0 0 0 0 0 0 = 0 = 0 = 0 = 0 decdecdecdec
aaaand not:nd not:nd not:nd not:2 5 6 2 5 6 2 5 6 2 5 6 decdecdecdec
(in a one byte addition)(in a one byte addition)(in a one byte addition)(in a one byte addition)
Technische Universität München
e) Fractional parts of a number can be represented, e.g. using a point notation
tttthe binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)
A suitable representation of numbers
e.g. using a point notation
Section1-Page16Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991
Technische Universität München
e) cont.
tttthe binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)
A suitable representation of numbers
Section1-Page17Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991
Technische Universität München
e) cont.
tttthe binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)
A suitable representation of numbers
e) cont.
Used representations: 4 Byte = floatUsed representations: 4 Byte = floatUsed representations: 4 Byte = floatUsed representations: 4 Byte = float8 Bytes = double8 Bytes = double8 Bytes = double8 Bytes = double
16 Bytes = long double16 Bytes = long double16 Bytes = long double16 Bytes = long double
= type identification= type identification= type identification= type identification
Section1-Page18Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991
(beside other names for the type identification)
Technische Universität München
f) Positive and negative numbers can be represented(absolute value sign)
tttthe binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)
A suitable representation of numbers
(absolute value sign)
…………1 1 1 0 0 0 1 1 = 1 1 1 0 0 0 1 1 = 1 1 1 0 0 0 1 1 = 1 1 1 0 0 0 1 1 = ----99999999decdecdecdec
1 0 0 0 0 0 0 1 = 1 0 0 0 0 0 0 1 = 1 0 0 0 0 0 0 1 = 1 0 0 0 0 0 0 1 = ---- 1111decdecdecdec
1 0 0 0 0 0 0 0 = 1 0 0 0 0 0 0 0 = 1 0 0 0 0 0 0 0 = 1 0 0 0 0 0 0 0 = ---- 0000decdecdecdec
0 0 0 0 0 0 0 0 = 00 0 0 0 0 0 0 0 = 00 0 0 0 0 0 0 0 = 00 0 0 0 0 0 0 0 = 0decdecdecdec
0 0 0 0 0 0 0 1 = 10 0 0 0 0 0 0 1 = 10 0 0 0 0 0 0 1 = 10 0 0 0 0 0 0 1 = 1decdecdecdec
Not soNot soNot soNot soidealidealidealideal
Section1-Page19Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991
0 0 0 0 0 0 0 1 = 10 0 0 0 0 0 0 1 = 10 0 0 0 0 0 0 1 = 10 0 0 0 0 0 0 1 = 1decdecdecdec
0 1 0 0 0 1 0 0 = 680 1 0 0 0 1 0 0 = 680 1 0 0 0 1 0 0 = 680 1 0 0 0 1 0 0 = 68decdecdecdec
…………
= sign= sign= sign= sign
Technische Universität München
f) cont.
tttthe binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)he binary (digital) system (with the base 2)
A suitable representation of numbers
f) cont.Two's complement
…………1 0 0 1 1 1 0 1 = 1 0 0 1 1 1 0 1 = 1 0 0 1 1 1 0 1 = 1 0 0 1 1 1 0 1 = ----99999999decdecdecdec
1 1 1 1 1 1 1 0 = 1 1 1 1 1 1 1 0 = 1 1 1 1 1 1 1 0 = 1 1 1 1 1 1 1 0 = ---- 2222decdecdecdec
1 1 1 1 1 1 1 1 = 1 1 1 1 1 1 1 1 = 1 1 1 1 1 1 1 1 = 1 1 1 1 1 1 1 1 = ---- 1111decdecdecdec
0 0 0 0 0 0 0 0 = 00 0 0 0 0 0 0 0 = 00 0 0 0 0 0 0 0 = 00 0 0 0 0 0 0 0 = 0decdecdecdec
0 0 0 0 0 0 0 1 = 10 0 0 0 0 0 0 1 = 10 0 0 0 0 0 0 1 = 10 0 0 0 0 0 0 1 = 1
256dec – numberdec
� convert to binary
Section1-Page20Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991
0 0 0 0 0 0 0 0 = 00 0 0 0 0 0 0 0 = 00 0 0 0 0 0 0 0 = 00 0 0 0 0 0 0 0 = 0decdecdecdec
0 0 0 0 0 0 0 1 = 10 0 0 0 0 0 0 1 = 10 0 0 0 0 0 0 1 = 10 0 0 0 0 0 0 1 = 1decdecdecdec
0 1 0 0 0 1 0 0 = 680 1 0 0 0 1 0 0 = 680 1 0 0 0 1 0 0 = 680 1 0 0 0 1 0 0 = 68decdecdecdec
…………���� ----128128128128decdecdecdec –––– 127127127127decdecdecdec
(with a sign)(with a sign)(with a sign)(with a sign)= sign= sign= sign= sign
Technische Universität München
Octal: 8-digits
Other numeral systems:Other numeral systems:Other numeral systems:Other numeral systems:
A suitable representation of numbers
Octal: 8-digits
Hexadecimal: 16 digits
0, 1, 2, 3, 4, 5, 6, 7, 80, 1, 2, 3, 4, 5, 6, 7, 80, 1, 2, 3, 4, 5, 6, 7, 80, 1, 2, 3, 4, 5, 6, 7, 8
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
323323323323octoctoctocte.g.e.g.e.g.e.g.
Section1-Page21Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
D3D3D3D3hexhexhexhex
ByteByteByteByte
e.g.e.g.e.g.e.g.
Technische Universität München
Questions
How many bytes are needed to represent the decimal number 1024?
Which decimal number is given by
Section1-Page22
Which decimal number is given by the binary representation 11010011 (show calculation)?
Technische Universität München
Section 1: Programming on a Section 1: Programming on a Section 1: Programming on a Section 1: Programming on a ComputerComputerComputerComputer
- What is a computer- What is required for that calculation- A suitable representation of numbers- A rule set for the operations
(Boolean Algebra)- A (mechanical/electrical/)electronically
implementation
Section1-Page23
implementation- John-von-Neumann architecture
Technische Universität München
A rule set for the operations
A Boolean algebraBoolean algebraBoolean algebraBoolean algebra is a set A, supplied with two elements 0 (called zero) and 1 (called one) and at least one binary operation (AND or OR) and an unary operation (NOT) as basic arithmetic operations, such that, for all elements a, boperation (NOT) as basic arithmetic operations, such that, for all elements a, band c of set A, the following axioms hold:
Section1-Page24http://en.wikipedia.org/wiki/Boolean_algebra, 2013-10-20http://de.wikipedia.org/wiki/Boolesche_Algebra, 2013-10-20
Technische Universität München
Section 1: Programming on a Section 1: Programming on a Section 1: Programming on a Section 1: Programming on a ComputerComputerComputerComputer
- What is a computer- What is required for that calculation- A suitable representation of numbers- A rule set for the operations
(Boolean Algebra)- A (mechanical/electrical/)electronically
implementation
Section1-Page25
implementation- John-von-Neumann architecture
Technische Universität München
A (mechanical/electronic) electronically implementation
Out QIn A
AND , In A
In BOut Q
&In A In B Out Q
0 0 0
Rectangular shape
OR , +
Out QIn A
In B
Out QIn A In B
In A
In BOut Q
>1
In A
In B
Out Q
In B &
In A
In B
Out Q
0 0 0
0 1 0
1 0 0
1 1 1
In A In B Out Q
0 0 0
0 1 1
1 0 1
1 1 1
Distinctive shape
Section1-Page26
Out QIn A In AInductor
In B
In A Out Q1
In A Out Q
Out QIn A
NOT A ,
1 1 1
In A Out Q
0 1
1 0
Technische Universität München
Design of new gate combinations
A (mechanical/electronic) electronically implementation
Building of the Disjunctive Normal Form (DNF)In A In B Out Q
0 0 1 A AND B
0 1 1 A AND B
1 0 0
1 1 1 A AND B
e.g.( ) OR
= Out
Building of the Disjunctive Normal Form (DNF)
( ) OR
( )
&>1
A B
Section1-Page27http://edascript.ims.uni-hannover.de/230b_Logikoptimierung/fla/Logikoptimierung.swf, 2013-10-20
>1
&
&
>1Out
Technische Universität München
Simplification of logic gates (= reduction of the number of gates)
A (mechanical/electronic) electronically implementation
Q = ( A AND B ) OR ( A AND B ) OR ( A AND B )Disjunctive normal form
Mathematical formal solution Graphical solution
Q = ( A AND B ) OR ( A AND B ) OR ( A AND B )
= ( A AND B ) OR ( A OR A ) AND B
= ( A AND B ) OR 1 AND B
distributivity
complements
boundedness
Quine-McClusky-Algorithm Karnaugh-Veitch-diagram
A A
B 1 1 B
A AND B A AND B
Section1-Page28
Q = ( A OR B )
= ( A AND B ) OR B
= ( B OR A ) AND ( B OR B)
= ( B OR A ) AND 1
= ( B OR A )
distributivity
complements
boundedness
http://edascript.ims.uni-hannover.de/230b_Logikoptimierung/fla/Logikoptimierung.swf, 2013-10-20
B 0 1 A
A AND B A AND B
Technische Universität München
Simplification of logic gates (= reduction of the number of gates)
A (mechanical/electronic) electronically implementation
Q = ( A AND B ) OR Q = ( A OR B )Q = ( A AND B ) OR ( A AND B ) OR ( A AND B )
Q = ( A OR B )
&>1
&>1
A B
Out>1
A B
Out
Simplification
Section1-Page29http://edascript.ims.uni-hannover.de/230b_Logikoptimierung/fla/Logikoptimierung.swf, 2013-10-20
&
>1 >1
3 AND gates2 OR gates3 NOT gates
Σ: 8 gates
0 AND gates1 OR gates1 NOT gates
Σ: 2 gates
Technische Universität München
A (mechanical/electronic) electronically implementation
- Combine groups with 16, 8, 4, 2, 1 elements
Karnaugh-Veitch-diagramGraphical solution, which results in the optimal minimum for the number of gates
- Combine groups with 16, 8, 4, 2, 1 elementsto one block
- Create always blocks with a maximumnumber of elements
- Write down all contributing elements to a block and cancel those, which contribute in a negated and not negated way
- The elements can be used multiply- The edges of the diagram continue at the
A A
B 1 1
B 0 1 A
B
A AND B
A AND B
A AND B
A AND B
Section1-Page30
1 1
http://edascript.ims.uni-hannover.de/230b_Logikoptimierung/fla/Logikoptimierung.swf, 2013-10-20
- The edges of the diagram continue at theother end, so that crossing is allowed
A AND B A AND B
Technische Universität München
A (mechanical/electronic) electronically implementation
Karnaugh-Veitch-diagram
With three inputs A, B and C With four inputs A, B, C and D
A
B 1 1
B 1 0
BA A
1 1
0 1
1 1
1 1
1 1
0 1
0 1
0 0
D
AA A
B
B
A AND D
Section1-Page31
http://edascript.ims.uni-hannover.de/230b_Logikoptimierung/fla/Logikoptimierung.swf, 2013-10-20
B 1 0
A
0 1
C C
1 1
1 1
0 0
0 0
C C
D
B
C
Technische Universität München
Cross checking for correctness
A (mechanical/electronic) electronically implementation
Source table: Karnaugh-Veitch-diagram:
Check simplification:
A B C D NOT D ((NOT A) C OUT =
A B C D OUT0 0 0 0 00 0 0 1 10 0 1 0 10 0 1 1 10 1 0 0 00 1 0 1 10 1 1 0 10 1 1 1 11 0 0 0 0
diagram: A B C D NOT A
D ((NOT A) AND D)
C OUT =C OR
((NOT A) AND D)
0 0 0 0 1 0 0 0 00 0 0 1 1 1 1 0 10 0 1 0 1 0 0 1 10 0 1 1 1 1 1 1 10 1 0 0 1 0 0 0 00 1 0 1 1 1 1 0 10 1 1 0 1 0 0 1 10 1 1 1 1 1 1 1 11 0 0 0 0 0 0 0 0
Section1-Page32http://edascript.ims.uni-hannover.de/230b_Logikoptimierung/fla/Logikoptimierung.swf, 2013-10-20
1 0 0 0 01 0 0 1 01 0 1 0 11 0 1 1 11 1 0 0 01 1 0 1 01 1 1 0 11 1 1 1 1
equal?equal?equal?equal?
1 0 0 0 0 0 0 0 01 0 0 1 0 1 0 0 01 0 1 0 0 0 0 1 11 0 1 1 0 1 0 1 11 1 0 0 0 0 0 0 01 1 0 1 0 1 0 0 01 1 1 0 0 0 0 1 11 1 1 1 0 1 0 1 1
Technische Universität München
Half-
Realization of a calculation machine (adder)
A (mechanical/electronic) electronically implementation
Building of the Half-Adder
(addition of two bits resulting in a sum and a carry-out bit)
In A In B Sum S
0 0 0
0 1 1
1 0 1
1 1 0
In A In B C out
0 0 0
0 1 0
1 0 0
A AND B( ) OR= S
= C
A AND B( )
Building of the Disjunctive Normal Form (DNF)
A AND B( )
&
&
&
>1 Sum S
Carry Cout
XOR
=1In AIn B
Section1-Page33
1 1 1 = CoutA AND B( ) &
In A
In B HA
Sum S
Carry Cout
But to add one Byte (= 8 bits) it is also necessary to add the But to add one Byte (= 8 bits) it is also necessary to add the But to add one Byte (= 8 bits) it is also necessary to add the But to add one Byte (= 8 bits) it is also necessary to add the carrycarrycarrycarry----out from the previous bit. out from the previous bit. out from the previous bit. out from the previous bit.
Technische Universität München
Full-
In A In B Sum S
0 0 0 0
Cin
Building of the Disjunctive Normal Form (DNF)
Realization of a calculation machine (adder)
A (mechanical/electronic) electronically implementation
Full-Adder
(addition of two bits and an additional carry-in bit resulting in a sum and a
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
In A In B Cout
0 0 0 0
Cin
Cin AND A AND B
Cin AND A AND B
Cin AND A AND B
Cin AND A AND B
( ) OR
( ) OR
( ) OR
( )
= S
Section1-Page34
and a carry-out bit)
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
Cin AND A AND B
Cin AND A AND B
Cin AND A AND B
Cin AND A AND B
( ) OR
( ) OR
( ) OR
( )
= Cout
Technische Universität München
&
Cin A B
Realization of a calculation machine (adder)
A (mechanical/electronic) electronically implementation
Full-Cin AND A AND B
Cin AND A AND B
Cin AND A AND B
Cin AND A AND B
( ) OR
( ) OR
( ) OR
( )
= S
>1
&
>1&
&&
&&
&&
>1S
Cin A B
Full-Adder
(addition of two bits and an additional carry-in bit resulting in a sum and a
Section1-Page35
Cin AND A AND B
Cin AND A AND B
Cin AND A AND B
Cin AND A AND B
( ) OR
( ) OR
( ) OR
( )
= Cout
>1
&
>1&
&&
&&
&&
>1Cout
and a carry-out bit)
Technische Universität München
Realization of a calculation machine (adder)
A (mechanical/electronic) electronically implementation
Full- or as realization with two half addersFull-Adder
(addition of two bits and an additional carry-in bit resulting in a sum and a
&
=1
>1HA
&
=1
HA
Sum S
CarryOut CIn A
In B
Carry In C
or as realization with two half adders
Section1-Page36
and a carry-out bit)
In A
FA
Sum S
Carry Out C Carry In C
In B
Technische Universität München
Realization of a calculation machine (adder)
A (mechanical/electronic) electronically implementation
Full- Addition of 8 bits (= 1 Byte)Full-Adder
(addition of two bits and an additional carry-in bit resulting in a sum and a
FA
S0
Cout Cin
A0 B0
FA
S1
Cout Cin
A1 B1
FA
S2
Cout Cin
A2 B2
FA
S3
Cout Cin
A3 B3
FA
S4
Cout Cin
A4 B4
FA
S5
Cout Cin
A5 B5
FA
S6
Cout Cin
A6 B6
FA
S7
Cout Cin
A7 B7
Addition of 8 bits (= 1 Byte)
Section1-Page37
and a carry-out bit)
Technische Universität München
Memory gates: flip-flops
A (mechanical/electronic) electronically implementation
Set Reset Out Qt+1RS-Flipflop &S Q
S Q1S0 0 -
0 1 0
1 0 1
1 1 Qt
RS-Flipflop
&RQ
R
S
Q
Q
1R
1S
J K Out Qt+1
0 0 Qt
0 1 0
1 0 1
1 1 Q
Triggered JK-Master-Slave-Flipflop
Q
K
J
Q
Section1-Page38
1 1 Qt
http://upload.wikimedia.org/wikipedia/commons/f/f5/ISO-JK-FF-NAND-circuit.svg, 2013-10-20
Technische Universität München
The modern logic gates: from valves to wafer circuits
A (mechanical/electronic) electronically implementation
„A transistortransistortransistortransistor is a semiconductor device, commonly used as an amplifier
„In electronics, a vacuumtube, electron tube (insideNorth America),
„In electronics, an integrated integrated integrated integrated circuitcircuitcircuitcircuit (also known as IC, microcircuit, microchip, silicon
„In microelectronics, a wafer is a thin slice of semiconducting material, such as a silicon crystal, upon which
Section1-Page39
commonly used as an amplifier or an electrically controlled switch. The transistor is the fundamental building block of the circuitry (intecrated circuits) that governs the operation of computers and all other modern electronics.“
North America), thermionic valve, or just valvevalvevalvevalve (elsewhere); is a device used to amplify, switch, otherwise modify, or create an electricalsignal by controlling themovement of electrons in a low-pressure space.“
microcircuit, microchip, silicon chip, or chip) is a miniaturized electronic circuits (consisting mainly of semiconductor device, as well as passive components) that has been manufactured in the surface of a thin substrate of semiconductor material.“
such as a silicon crystal, upon which microcircuits are constructed by doping (for example, diffusion or ion implantation), chemical edging, and deposition of various materials. Wafers are thus of key importance in the fabrication of semiconductor devices such as integrated circuits.“
http://en.wikipedia.org/wiki/Vacuum_tube, 2007.09.02http://en.wikipedia.org/wiki/Transistor, 2007.09.02http://en.wikipedia.org/wiki/Integrated_circuits, 2007.09.02http://en.wikipedia.org/wiki/Wafer_%28electronics%29, 2007.09.02
Technische Universität München
Questions
Simplify the following truth table (define your used signs/ pictograms for AND, OR, NOT and use disjunctive normal form; advice for final test: task type could be similar with changed truth table values)test: task type could be similar with changed truth table values)
A B C D OUT0 0 0 0 00 0 0 1 10 0 1 0 00 0 1 1 00 1 0 0 00 1 0 1 00 1 1 0 10 1 1 1 1
Use a Karnaugh-Veitch-diagram
Use the mathematical method given by the axioms of Boolean algebra
Section1-Page40
0 1 1 1 11 0 0 0 01 0 0 1 11 0 1 0 01 0 1 1 01 1 0 0 01 1 0 1 01 1 1 0 11 1 1 1 1
Draw the logic gate map for simplified table (define the used graphical symbols in a short caption)
Technische Universität München
Section 1: Programming on a Section 1: Programming on a Section 1: Programming on a Section 1: Programming on a ComputerComputerComputerComputer
- What is a computer- What is required for that calculation- A suitable representation of numbers- A rule set for the operations
(Boolean Algebra)- A (mechanical/electrical/)electronically
implementation
Section1-Page41
implementation- John-von-Neumann architecture
Technische Universität München
A (mechanical/electronic) electronically implementation
The heart of a computer: the central processing unit (CPU) or processor
Input Output
Main memory
ArithmeticLogic
ControlUnit
CPU
Section1-Page42Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991
John von Neumann –Architecture (1945)
LogicUnit
Unit
Technische Universität München
A (mechanical/electronic) electronically implementation
The heart of a computer: the central processing unit (CPU) or processor
Input/output: used to commit data and programs to the memory
Main memory:stores data and programs, to offer them to the CPU
Control unit:stores the current instruction (in registers), counts them,
Section1-Page43Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991
stores the current instruction (in registers), counts them, and decodes them to control the ALU
Arithmetic Logic Unit (ALU):processes mathematical and logical operations, controlled by the control unit