












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













L15 – Programmable Machines
10/22/
L15 – Programmable Machines
10/22/
DEN Q
DEN Q
DEN Q
DEN Q
DEN Q
EN
L15 – Programmable Machines
10/22/
Multiple read ports by simply adding more output MUXs
EN^
EN^
EN
0 1
N 2 -
0 1^ …^
N 2 -
0 1
N 2 -
Din[B:0] WA[N:0]RA[N:0]WE DA[B:0] DB[B:0] RB[N:0]
L15 – Programmable Machines
10/22/
0 1
L15 – Programmable Machines
10/22/
A^ ←^
1 A^ ←^
A * B B ← B - 1
B^ ←^
N
A^ ←^
A * B
SSN^
AN+1 sel BA sel^
Ble le
0 1 1 2 2 3 3 4 4 4 S0 S1 S2 S3 S
Once more,writing a controlprogram is nothing more thanfilling in a table
L15 – Programmable Machines
10/22/
A^ ←^
1 A^ ←^
A * B B ← B - 1
B^ ←^
N
A^ ←^
A * B
SSN^
AN+1 sel BA sel^
Ble le
0 1 1 2 2 3 3 3 S0 S1 S2 S
Some parts of the programcan be computed simultaneously.
L15 – Programmable Machines
10/22/
A^ ← B^ ←^ N A^ ←^1 A * BB ←^ B - 1
Z= Z=1 DONE
S0 S1 S
Z^ SN
S N+
A sel^ BAsel^
Ble le
Programmability, allows us to reusedata paths to solve new problems.What we need is a general purposedata path, that can be used to efficientlysolve most problems, aswell as a easier way to control it.^ -^00 11 1 -^2
L15 – Programmable Machines
10/22/
Z S^ |^ S’
Asel^ Bsel
Ale^ Ble ----+--------------------- -^0 | 1
1
0 1
1 A=1,
B=N
0 1^ |^1
0
1 1
1 A=A*B,
B=B-
1 1^ |^2
0
1 1
1
0 done EN^
EN A^ *
B 1
N^01 - (^01) ControlFSM^
ASEL BSELALE BLE ASEL^
BSEL BLE ALE ANSWER
N?^ i ∑∑∑∑====i^1 A + B?^2 A?
L15 – Programmable Machines
10/22/
Recall Church’s thesis (from last lecture)“Any discrete function computable byANY realizable machine is computable bysome Turing Machine”An Thusly, we’ve defined what it means toCOMPUTE (whatever a TM can compute)A Turing machine is nothing more that anFSM that receives inputs from, andoutputs onto, an infinite tape.Thus far, we’ve been designing a new Turingmachine FSM for each new function thatwe encounter.Wouldn’t it be nice if we could design a moregeneral purpose computing machine?
Alan Turing
0,(1,R)^ 1,(1,L)^ S^2 0,(1,L)^ 1,Halt
L15 – Programmable Machines
10/22/
(^0 1 1 0) FSM 0 0 1 0
0 Multiplication^0 1 1 0 FSM 0 0 1 0
0 Sorting
(^0 1 1 0) FSM 0 0 1 0
0 Factorization
(^0 1 1 0) FSM 0 0 1 0
0 Primality Test^ Is there analternative toad-hocTuring Machines?
L15 – Programmable Machines
10/22/
(y) for every x, y …X
Surprise!
U(x,y) IS COMPUTABLE
,
hence U(x,y) = T
(<x,y>) for some U.U
Universal Turing Machine (UTM):
"data" "program" "interpreter"
PARADIGM
INFINITELY many UTMs
...
Any one of them canevaluate any computablefunction by simulating/emulating/interpretingthe actions of Turingmachine given to itas an input.UNIVERSALITY:Basic requirementfor a general purposecomputer
L15 – Programmable Machines
10/22/
Suppose you've designed Turing Machine T
and want to show that its universal.K
APPROACH:1. Find some
known
universal machine, say T
.U
simulate
Ton TU^
:K
T[<P,x>] = TK
[x] for all x.U
[<y,z>] = TU
[z], it follows that, for all y and z.Y
[<P,<y,z>>]K
=^ T
[<y,z>]U
=^ T
[z]Y
L15 – Programmable Machines
10/22/
BIG IDEA: Manipulate
coded representations
of computing
machines, rather than the machines themselves.• PROGRAM as a behavioral description• SOFTWARE vs. HARDWARE• INTERPRETER as machine which takes program andmimics behavior it describes• LANGUAGE as interface between interpreter andprogram• COMPILER as translator between languages:INTELLECTUAL BENEFITS:• Programs as data -- mathematical objects• Combination, composition, generation,parameterization, etc.
L15 – Programmable Machines
10/22/
ControlUnit
DataPaths Internal storage
controlstatus MEMORY
dest
asel fn
bsel Cc’s ALU
PC^
1101000111011
R1^ ←←←←R2+R