Upload
others
View
10
Download
1
Embed Size (px)
Citation preview
Chapter 1Welcome Aboard
Abstraction
1-2Source: http://static.usnews.rankingsandreviews.com/images/Auto/izmo/365609/2014_hyundai_elantra_gt_dashboard.jpghttp://www.ridelust.com/wp-content/uploads/2012/12/Engine2.jpghttp://www.plugincars.com/sites/default/files/Volkswagen-Golf-Variant-twinDRIVE-under-the-hood.jpghttp://wpmedia.driving.ca/2015/02/img_4777.jpg?quality=70&strip=all&w=960&h=480&crop=1
Interface
Levels of Abstraction (Biological System)
1-3Source: https://media.studyisland.com/pics/40040_bio_organization.gif
Levels of Abstraction (Automotive System)
1-4Source: https://media.studyisland.com/pics/40040_bio_organization.gif
…part
system
sub-system
component
whole automobile
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Levels of Abstraction (Computer)
1-5
Problems
Language
Instruction Set Architecture
Microarchitecture
Circuits
Devices
Algorithms
Hardware/Software Interface
1-6
Universal Computing DeviceAll computers, given enough time and memory,are capable of computing exactly the same things.
1-7
= =EmbeddedProcessor Supercomputer
Source: http://images.anandtech.com/reviews/storage/Samsung/SSD830/_DSC2164.jpghttp://www.miscw.com/wp-content/uploads/2016/09/Samsung-Smartphone.jpghttp://koreatechblog.com/wp-content/uploads/2015/02/lg-ultrapc-gram-14zd950-gx58k-1157540_2.jpghttps://4.imimg.com/data4/CO/YS/MY-29352968/samsung-desktop-computer-500x500.jpghttp://oiger.de/wp-content/uploads/Bull-Supercomputer.jpg
Then what is the simplest possible computing device?
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1-8
Turing Machine
Mathematical model of a device that can performany computation – Alan Turing (1937)
Every computation can be performed by some Turing machine. (Turing’s thesis)
(그럼이세상에계산하지못하는것도있나? Yes…Halting Problem…We’ll discuss it later)
For more info about Turing machines, see
http://www.wikipedia.org/wiki/Turing_machine/
For more about Alan Turing, see
http://www.turing.org.uk/turing/
1-9
A Turing Machine
............Tape
Read-Write headControl Unit
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
The Tape
............
Read-Write head
No boundaries -- infinite length
The head moves Left or Right
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
............
Read-Write head
At each transition (time step):1. Reads the symbol under
the Read-Write head2. Writes a symbol3. Moves Left or Right
(All the transitions are specified in the control unit)Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
............
Example:Time 0
a a cb
............Time 1
a b k c
1. Reads2. Writes
ak
3. Moves LeftSource: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
Computation Example
The function yxyxf +=),( is computable
Turing Machine:
Input string: yx0 unary
Output string: 0xy unary
yx, are integers
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
à 0
0q
1 1 à1 1
x y
1! !Start
initial state
The 0 is the delimiter that separates the two numbers
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
à 0
0q
1 1 à1 1
x y
1! !
à 0
fq
1 à1
yx +
! 11
Start
Finish
accept state
initial state
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
Execution Example:
11=x
11=yà 0
0q
1 1 à1 1
Time 0x y
Final Result
à 0
4q
1 1 à1 1yx +
(=2)
(=2)
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
0q
Turing machine for function
1q 2q 3qL,à®à L,01®
L,11®
R,à®à
R,10®
R,11®
4q
R,11®
yxyxf +=),(
Control Unit
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
Initial state
accept state
à 0
0q
1 1Time 0 à
0q 1q 2q 3qL,à®à L,01®
L,11®
R,à®à
R,10®
R,11®
4q
R,11®
1 1
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
Initial state
à
0q
à
0q 1q 2q 3qL,à®à L,01®
L,11®
R,à®à
R,10®
R,11®
4q
R,11®
01 11 1Time 1
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
0q 1q 2q 3qL,à®à L,01®
L,11®
R,à®à
R,10®
R,11®
4q
R,11®
à 0
0q
1 1 à1 1Time 2
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
0q 1q 2q 3qL,à®à L,01®
L,11®
R,à®à
R,10®
R,11®
4q
R,11®
à
1q
à1 11 11Time 3
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
0q 1q 2q 3qL,à®à L,01®
L,11®
R,à®à
R,10®
R,11®
4q
R,11®
à
1q
1 1 à1 11Time 4
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
0q 1q 2q 3qL,à®à L,01®
L,11®
R,à®à
R,10®
R,11®
4q
R,11®
à
1q
1 1 à1 11Time 4
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
0q 1q 2q 3qL,à®à L,01®
L,11®
R,à®à
R,10®
R,11®
4q
R,11®
à
1q
à1 11 11Time 5
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
0q 1q 2q 3qL,à®à L,01®
L,11®
R,à®à
R,10®
R,11®
4q
R,11®
à
2q
1 1 à1 11Time 6
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
0q 1q 2q 3qL,à®à L,01®
L,11®
R,à®à
R,10®
R,11®
4q
R,11®
à
3q
à1 11 01Time 7
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
0q 1q 2q 3qL,à®à L,01®
L,11®
R,à®à
R,10®
R,11®
4q
R,11®
à
3q
1 1 à1 01Time 8
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
0q 1q 2q 3qL,à®à L,01®
L,11®
R,à®à
R,10®
R,11®
4q
R,11®
à
3q
1 1 à1 01Time 8
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
0q 1q 2q 3qL,à®à L,01®
L,11®
R,à®à
R,10®
R,11®
4q
R,11®
à
3q
à1 11 01Time 9
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
0q 1q 2q 3qL,à®à L,01®
L,11®
R,à®à
R,10®
R,11®
4q
R,11®
à
3q
1 1 à1 01Time 10
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
0q 1q 2q 3qL,à®à L,01®
L,11®
R,à®à
R,10®
R,11®
4q
R,11®
à
3q
à1 11 01Time 11
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/
0q 1q 2q 3qL,à®à L,01®
L,11®
R,à®à
R,10®
R,11®
4q
R,11®
à
4q
1 1 à1 01
HALT & accept
Time 12
Source: Prof. Costas Busch’s Lecture Slides http://www.cs.rpi.edu/~moorthy/Courses/modcomp/accept state
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1-33
Universal Turing MachineA machine that can implement all Turing machines-- this is also a Turing machine!
• inputs: data, plus a description of computation (other TMs)
Ua,b,c c(a+b)
Universal Turing Machine
Tadd, Tmul
U is programmable – so is a computer!• Program is part of the input data• a computer can emulate a Universal Turing Machine and vice
versa
A computer is a universal computing device.
Halting Problem
• Halting ProblemØThe problem of determining, from a description of an
arbitrary computer program (i.e., Turing machine) and an input, whether the program will finish running (i.e., halts) or continue to run forever
• Halting problem is undecidable (not Turing machine solvable)(Proof by an application of Cantor’s diagonal argument)오토마타교과목에서더깊게다루어짐.
1-34
1-35
오토마타이론
Turing machine (T)
Pushdown machine (P)
Finite state machine (F)
L = {(0+1)* | 1의개수는짝수}(F, P, T로 accept 가능)
L = {1 0 | n ≥ 0}(P 또는 T로만 accept 가능)
n n
L = {1 0 1 | n ≥ 0}(T로만 accept 가능)
n n n
1-36
꼭 기억해야 할 것
• (Levels of) Abstraction
• Turing Equivalence
• Undecidable Problem (not Turing machine computable)