Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 101 – Sept. 18 Adder circuit example (handout) How computers think –Concept of “state” –Turing machine model –Finite state machine model a.k.a. “Finite.

Similar presentations


Presentation on theme: "CS 101 – Sept. 18 Adder circuit example (handout) How computers think –Concept of “state” –Turing machine model –Finite state machine model a.k.a. “Finite."— Presentation transcript:

1 CS 101 – Sept. 18 Adder circuit example (handout) How computers think –Concept of “state” –Turing machine model –Finite state machine model a.k.a. “Finite automaton”

2 State Fundamental concept for any computation –Machine keeps track of where it is, what it needs –a.k.a. Status, mode –state may be stored in some memory cell Many examples –Logging in –Using a dialog box, or other user-interface –Fax machine, photocopier, telephone –Car transmission

3 Examples In a Tic-Tac-Toe game, the “state” of the game would include: –Whose turn it is –Is the game over? Who won, or was it a tie? State is determined by looking at the board. Backgammon (roll dice, move pieces…) –Depending on your situation in the game, some moves are illegal. Another way to think about states is to consider all possible board configurations!

4 Turing machine Alan Turing, 1936 Any general purpose machine must: –Work automatically –Be aware of what state it’s in –Have sufficient memory –Be able to do I/O, and be able to read the input many times if necessary Powerful model, but tedious to work with

5 Adder example 4 possible states, depending on the inputs –For example, (S = 0 and C = 0) would be one outcome. Programming the details make working with real TMs a headache. x y z S C

6 Finite Automata singular: finite automaton Simple model for machine behavior. Purpose is to accept or reject some input –Examples: logging in, using a wizard, game At any given time, machine is in some “state” –Start state –Final (or accept, “happy”) states –Dead states Transitions between states

7 Example Vending machine for 25¢ item. 0510 1520 25 +5 +10 +25

8 Binary example We want a “word” starting with “101…” need 101 need 01 need 1  101 0 1 0 0,1

9 Binary Example (2) We want a word with at least two 0’s. need two need one 0 0 11 0,1 What if we wanted exactly two 0’s?

10 What does this FA do? A B 1 1 0 0


Download ppt "CS 101 – Sept. 18 Adder circuit example (handout) How computers think –Concept of “state” –Turing machine model –Finite state machine model a.k.a. “Finite."

Similar presentations


Ads by Google