What is a Finite-State Machine for Changing Every Other Bit in an Input String?

  • Thread starter Thread starter livcon
  • Start date Start date
  • Tags Tags
    Machine
livcon
Messages
6
Reaction score
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.
 
Physics news on Phys.org
I realized that this problem is quite easy and requires only two states, s_{0} and s_{1}, using the first one as initial state. When the machine receives either 0 or 1 in the initial state, the output function simply returns the same bit as the input as it changes state from s_{0} to s_{1}. From this state the bit changes on its way back to state s_{0}.
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top