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 Computer Computer Computer Computer - 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
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
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,…)
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
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,…)
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,…)
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:
((((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)
= 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
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)
(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)
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)
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)
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:
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
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.“
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