FSM - ENGR110 flashcards

5.0(1)
studied byStudied by 2 people
5.0(1)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/21

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

22 Terms

1
New cards

What is a Finite State Machine (FSM) in simple terms?

A model for a program or system that can be in only one of a finite number of states at a time. It changes states based on inputs according to a set of rules called transitions.

2
New cards

What are the three core components of an FSM?

  1. States: The possible situations (e.g., Open, Closed).

  2. Inputs: The signals that trigger change (e.g., push, pull).

  3. Transitions: The rules that define how inputs change the state.

3
New cards

What is the main purpose of an Acceptor FSM?

To decide whether to "accept" or "reject" an input string. If the FSM ends in a special accepting state (often marked with a double circle), the input is valid.

4
New cards

What is the main purpose of a Transducer FSM?

To generate an output based on the current state and the input. It's used for systems that need to do something, like a vending machine dispensing a drink.

5
New cards

What is the difference between a Moore Machine and a Mealy Machine?

  • Moore: Output depends only on the current state.

  • Mealy: Output depends on the current state AND the input.

6
New cards

What is a common, simple way to code an FSM in a language like C++ or Java?

Using a variable to track the current_state and a series of if-else or switch statements to check the state and input to decide the next state.

7
New cards

What is the "alphabet" (Σ) in an FSM?

The set of all possible, valid input symbols. For example, for a door, the alphabet could be Σ = {push, pull}.

8
New cards

What is one major limitation of a "pure" FSM (without enhancements)?

It has no memory or variables. All information must be stored in the states themselves, which can lead to a "state explosion" (needing thousands of states) for complex problems like counting.

9
New cards

What is an "Extended FSM"?

An FSM that is enhanced with variables. This allows the transitions to have guards (conditions), making the FSM much more powerful without needing an infinite number of states.

10
New cards

What is a "State Diagram"?

A visual way to represent an FSM, where circles are states and arrows between them are transitions, labeled with the input that causes that transition.

11
New cards

what are the benefits of using an FSM as a basis for writing code?

  1. It provides a clear outline for the code's structure.

  2. It helps create well-organized and less error-prone programs.

  3. It forces you to think about the design before jumping into coding.

12
New cards

What is "FSM explosion"?

It's when a "pure" FSM (without variables) requires a huge number of states to represent a simple concept, making the design unmanageable. (Example: A microwave timer FSM needing a separate state for every possible second).

13
New cards

What is the core difference between an "acceptor" and a "transducer" FSM?

  • Acceptor: Decides if an input string is valid. It has accepting states and answers "yes" or "no".

  • Transducer: Converts an input sequence into an output sequence. Its purpose is to generate output, not just accept/reject.

14
New cards

How do you represent an "accepting state" in a state diagram?

With a double circle.

15
New cards

What does it mean for a transducer FSM to "squeeze" substrings? (e.g., 000100110 -> 01010)

It means it outputs a symbol only when the input changes from one type to the other. It ignores consecutive repeated symbols.

16
New cards

How do you read an FSM state transition table/matrix?

The rows are the Inputs. The columns are the Current States. The cell where a row and column meet tells you the Next State.

17
New cards
<p><span>Given this transition table and starting state </span><code>State0</code><span>, what is the state sequence for inputs </span><code>Input0?</code></p>

Given this transition table and starting state State0, what is the state sequence for inputs Input0?

  1. State0 + Input0 -> State1

  2. State1 + Input2 -> State2

  3. State2 + Input0 -> State3

  4. State3 + Input0 -> State2

  5. State2 + Input1 -> State1

Sequence: State0 -> State1 -> State2 -> State3 -> State2 -> State1

18
New cards

What is Q?

Q is the set of all states

19
New cards

What is Σ (sigma)?

Sigma is the inputs

20
New cards

What is q0?

q0 is the starting state (initial state)

21
New cards

What is F?

F is the set of final states (it is a set because there can be more than one final state)

22
New cards

What is ∂?

It is a transition function that maps Q x Σ —> Q

Explore top flashcards