WEBVTT
00:00:00.580 --> 00:00:05.660
An interesting question for computer architects
is what capabilities must be included in the
00:00:05.660 --> 00:00:07.189
ISA?
00:00:07.189 --> 00:00:12.880
When we studied Boolean gates in Part 1 of
the course, we were able to prove that NAND
00:00:12.880 --> 00:00:17.940
gates were universal, i.e., that we could
implement any Boolean function using only
00:00:17.940 --> 00:00:21.150
circuits constructed from NAND gates.
00:00:21.150 --> 00:00:24.369
We can ask the corresponding question of our
ISA:
00:00:24.369 --> 00:00:30.039
is it universal, i.e., can it be used to perform
any computation?
00:00:30.039 --> 00:00:33.790
What problems can we solve with a von Neumann
computer?
00:00:33.790 --> 00:00:37.810
Can the Beta solve any problem FSMs can solve?
00:00:37.810 --> 00:00:40.650
Are there problems FSMs can't solve?
00:00:40.650 --> 00:00:43.250
If so, can the Beta solve those problems?
00:00:43.250 --> 00:00:48.760
Do the answers to these questions depend on
the particular ISA?
00:00:48.760 --> 00:00:53.440
To provide some answers, we need a mathematical
model of computation.
00:00:53.440 --> 00:00:58.870
Reasoning about the model, we should be able
to prove what can be computed and what can't.
00:00:58.870 --> 00:01:03.800
And hopefully we can ensure that the Beta
ISA has the functionality needed to perform
00:01:03.800 --> 00:01:06.760
any computation.
00:01:06.760 --> 00:01:11.940
The roots of computer science stem from the
evaluation of many alternative mathematical
00:01:11.940 --> 00:01:17.850
models of computation to determine the classes
of computation each could represent.
00:01:17.850 --> 00:01:26.000
An elusive goal was to find a universal model,
capable of representing *all* realizable computations.
00:01:26.000 --> 00:01:30.610
In other words if a computation could be described
using some other well-formed model, we should
00:01:30.610 --> 00:01:36.840
also be able to describe the same computation
using the universal model.
00:01:36.840 --> 00:01:42.090
One candidate model might be finite state
machines (FSMs), which can be built using
00:01:42.090 --> 00:01:44.140
sequential logic.
00:01:44.140 --> 00:01:50.500
Using Boolean logic and state transition diagrams
we can reason about how an FSM will operate
00:01:50.500 --> 00:01:56.140
on any given input, predicting the output
with 100% certainty.
00:01:56.140 --> 00:01:59.990
Are FSMs the universal digital computing device?
00:01:59.990 --> 00:02:06.460
In other words, can we come up with FSM implementations
that implement all computations that can be
00:02:06.460 --> 00:02:10.060
solved by any digital device?
00:02:10.060 --> 00:02:15.090
Despite their usefulness and flexibility,
there are common problems that cannot be solved
00:02:15.090 --> 00:02:17.130
by any FSM.
00:02:17.130 --> 00:02:23.370
For example, can we build an FSM to determine
if a string of parentheses (properly encoded
00:02:23.370 --> 00:02:26.770
into a binary sequence) is well-formed?
00:02:26.770 --> 00:02:32.840
A parenthesis string is well-formed if the
parentheses balance, i.e., for every open
00:02:32.840 --> 00:02:38.130
parenthesis there is a matching close parenthesis
later in the string.
00:02:38.130 --> 00:02:44.160
In the example shown here, the input string
on the top is well-formed, but the input string
00:02:44.160 --> 00:02:46.990
on the bottom is not.
00:02:46.990 --> 00:02:52.430
After processing the input string, the FSM
would output a 1 if the string is well-formed,
00:02:52.430 --> 00:02:53.950
0 otherwise.
00:02:53.950 --> 00:02:57.630
Can this problem be solved using an FSM?
00:02:57.630 --> 00:02:59.569
No, it can't.
00:02:59.569 --> 00:03:05.090
The difficulty is that the FSM uses its internal
state to encode what it knows about the history
00:03:05.090 --> 00:03:07.010
of the inputs.
00:03:07.010 --> 00:03:11.720
In the paren checker, the FSM would need to
count the number of unbalanced open parens
00:03:11.720 --> 00:03:17.329
seen so far, so it can determine if future
input contains the required number of close
00:03:17.329 --> 00:03:19.090
parens.
00:03:19.090 --> 00:03:23.790
But in a finite state machine there are only
a fixed number of states, so a particular
00:03:23.790 --> 00:03:28.610
FSM has a maximum count it can reach.
00:03:28.610 --> 00:03:34.379
If we feed the FSM an input with more open
parens than it has the states to count, it
00:03:34.379 --> 00:03:38.349
won't be able to check if the input string
is well-formed.
00:03:38.349 --> 00:03:46.160
The "finite-ness" of FSMs limits their ability
to solve problems that require unbounded counting.
00:03:46.160 --> 00:03:50.670
Hmm, what other models of computation might
we consider?
00:03:50.670 --> 00:03:56.660
Mathematics to the rescue, in this case in
the form of a British mathematician named
00:03:56.660 --> 00:03:59.540
Alan Turing.
00:03:59.540 --> 00:04:04.980
In the early 1930's Alan Turing was one of
many mathematicians studying the limits of
00:04:04.980 --> 00:04:07.629
proof and computation.
00:04:07.629 --> 00:04:13.709
He proposed a conceptual model consisting
of an FSM combined with a infinite digital
00:04:13.709 --> 00:04:18.918
tape that could read and written under the
control of the FSM.
00:04:18.918 --> 00:04:24.180
The inputs to some computation would be encoded
as symbols on the tape, then the FSM would
00:04:24.180 --> 00:04:30.259
read the tape, changing its state as it performed
the computation, then write the answer onto
00:04:30.259 --> 00:04:32.860
the tape and finally halting.
00:04:32.860 --> 00:04:37.229
Nowadays, this model is called a Turing Machine
(TM).
00:04:37.229 --> 00:04:44.760
Turing Machines, like other models of the
time, solved the "finite" problem of FSMs.
00:04:44.760 --> 00:04:47.990
So how does all this relate to computation?
00:04:47.990 --> 00:04:54.308
Assuming the non-blank input on the tape occupies
a finite number of adjacent cells, it can
00:04:54.308 --> 00:04:57.240
be expressed as a large integer.
00:04:57.240 --> 00:05:02.979
Just construct a binary number using the bit
encoding of the symbols from the tape, alternating
00:05:02.979 --> 00:05:08.059
between symbols to the left of the tape head
and symbols to the right of the tape head.
00:05:08.059 --> 00:05:14.990
Eventually all the symbols will be incorporated
into the (very large) integer representation.
00:05:14.990 --> 00:05:21.379
So both the input and output of the TM can
be thought of as large integers, and the TM
00:05:21.379 --> 00:05:28.860
itself as implementing an integer function
that maps input integers to output integers.
00:05:28.860 --> 00:05:33.879
The FSM brain of the Turing Machine can be
characterized by its truth table.
00:05:33.879 --> 00:05:39.490
And we can systematically enumerate all the
possible FSM truth tables, assigning an index
00:05:39.490 --> 00:05:43.979
to each truth table as it appears in the enumeration.
00:05:43.979 --> 00:05:49.909
Note that indices get very large very quickly
since they essentially incorporate all the
00:05:49.909 --> 00:05:52.159
information in the truth table.
00:05:52.159 --> 00:05:56.870
Fortunately we have a very large supply of
integers!
00:05:56.870 --> 00:06:03.240
We'll use the index for a TM's FSM to identify
the TM as well.
00:06:03.240 --> 00:06:10.449
So we can talk about TM 347 running on input
51, producing the answer 42.