Title: Thursday June 28th
1Thursday June 28th
- Finite state machine Computability Theory
- Real Numbers
2Finite state machine
- Set of states
- Strictly defined cases for state transition
- Start state and accept state, accept state has
double circles
3FSM Examples
- Text processing
- Protocols
- Natural Language processing
4Protocol Example
- Stateful protocol processing
- Example SSH
Success
User Exit
Auth.
Shell
Exit
Connection Reset
Fail
Error
5Text Example
- Extracting numbers from text
Non-Number
Number
!
Number
Non-Number
Number
Scan
!
On the 28 day of July I will eat 12 doughnuts.
1
2
8
2
6Turing Machine
- Theoretical Basis for computers
- Developed before electronic computers
- Implements a FSM with external memory
A nutshell formal description of a "Turing
machine" "A Turing machine is a finite-state
machine associated with an external storage or
memory medium." (Minsky (1967), p. 117) "A
Turing machine is essentially a finite-state
sequential machine that has the ability to
communicate with an external store of
information." (Booth (1967), p. 354)
Marvin Minsky, Computation Finite and Infinite
Machines, Prentice-Hall, Inc., N.J., 1967. See
Chapter 8, Section 8.2 "Unsolvability of the
Halting Problem." Excellent, i.e. relatively
readable, sometimes funny. Taylor L. Booth
(1967), Sequential Machines and Automata Theory,
John Wiley and Sons, Inc., New York. Graduate
level engineering text ranges over a wide
variety of topics, Chapter IX Turing Machines
includes some recursion theory.
7What is a Turing Machine?
- Think about an Audio-Cassette Player
- Read/Write Head on a strip of tape
- Current State in the Finite State Machine
8Turing-Church Hypothesis
- The Turing Machine is a powerful as any computer
- Powerful in this case means that it can perform
exactly the same operations - May not (probably wont) be as efficient, fast,
or convenient. - If you design a computer to implement at least
the abilities of the Turing Machine it is general
purpose - All current computers are a special case of an
abstract machine called the Random Access Stored
Program machine (RASP)
9Connections with Assembler and Architecture
- Like the FSM and the Turing machine assembler
language is (at least for humans) the lowest
common denominator. - All programs become assembler (or its one-to-one
cousin machine code) before execution - Any computer or language that implements the
Finite State Machine, or the Turing Machine is
general purpose
10Real Numbers
- While it is possible to represent real numbers
with arbitrary precision, it is subject to the
same constraints as integers - Computers are built with a fixed and finite
number of gates and bits, thus the precision and
range of expressible values is fixed - Real numbers are represented a floating point,
a system similar to scientific notation - Due to numerous complications the implementation
is very complicated
11Floating point Numbers
- 32 bit Single Precision is made up of
- 23 bit Mantissa, or Significand
- 8 bit Exponent
- 1 bit Sign
S Exponent Mantissa
IEEE Standard 32 bit Floating Point (single
precision)
- Compare to 6.0231023
- 6.023 mantissa, 23 exponent, Positive
12How do you relate scientific notation to Floating
point?
- Scientific notation uses a normalized form,
there is exactly one number to the left of the
decimal point. - All numbers are multiplied by 10 raised to a
power. - The sign is carried in the mantessa
- BASE TEN!
13Representing Negative Numbers
- Several methods for representing negative numbers
exist each with advantages and disadvantages. - Signed Magnitude
- Left-most bit for sign, remaining bits absolute
value - 1s complement
- invert every bit
- 2s complement
- invert every bit, then add 1
- excess 2m-1
- add 2m-1 to each code
- ignore overflow
14Base-2 Representation
- Same use of the Sign Bit as before
- Signed Magnitude for the whole number
- Biased exponent
- Uses the Excess 2n-1-1 signing convention
- Normalized Mantissa
15Signed Magnitude
- There exists a /- everything, 0, 8, etc.
- Complicated hardware for a (more) simple
representation.
16Normalized Mantissa
0011
0.065 2 0.13
0.130 2 0.26
0.260 2 0.52
0.520 2 1.04
0.040 2 0.08
0011.00010000101
0.080 2 0.16
0.160 2 0.32
0.320 2 0.64
0.640 2 1.28
Normalized
0.280 2 0.56
0.560 2 1.12
1.100010000101
00010000101...
(Normalization affects the exponent)
00010000101...
17Biased Exponent
- Exponent value e Exponent - (2e-1-1)
- Many reserved and special meanings
- Represents the exponent value 2e
- Combines with the Mantissa as follows
18Example
124 - 127 -3
1.01 binary 1.25 decimal
Value 1 2-3 1.25
Value 0.125 1.25
Value 0.15625
19Border Conditions
Chart courtesy of Wikipedias IEEE754 page.