Finite-state machine problem

  • Thread starter livcon
  • Start date
  • #1
6
0

Homework Statement


Construct a finite-state machine that changes every other bit, starting with the second bit, of an input string, and leaves the other bits unchanged.


Homework Equations


-

The Attempt at a Solution


Say I have the string 1001101, then I am supposed to make a finite-state machine that turns it into 1100111 (every other bit changed, starting from the 2nd). I know how to change the bits in a machine, what I need help for is how to determine the index of the input, that is how to let the finite-state machine know i.e. that 0 which happens to be the second bit of the string, is in fact the second.
Thanks.
 

Answers and Replies

  • #2
6
0
I realized that this problem is quite easy and requires only two states, [tex]s_{0}[/tex] and [tex]s_{1}[/tex], using the first one as initial state. When the machine recieves either 0 or 1 in the initial state, the output function simply returns the same bit as the input as it changes state from [tex]s_{0}[/tex] to [tex]s_{1}[/tex]. From this state the bit changes on its way back to state [tex]s_{0}[/tex].
 

Related Threads on Finite-state machine problem

  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
9
Views
2K
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
2
Views
3K
  • Last Post
Replies
3
Views
1K
  • Last Post
Replies
5
Views
1K
  • Last Post
Replies
1
Views
4K
Replies
8
Views
710
Replies
0
Views
2K
Top