Output of Mealy Machine for 2's Complement

Thread Starter


Joined Jun 7, 2012

I am trying to understand the Mealy Machine's output provided at the following link:


There is no final state. Initially if '1' is the input the the output is '1' which is fine. But in state q2 if the input is '0' output is '1' and if input is '1' output is '0'.

This is clear to me in the context of a single bit. But I can't understand this machine in the context of a string. For example if the string is "010". Then we would take '1' complement: 101 and then add '1' to it so the string would be 110. How we can generate this type of output from the machine?

In case of string '101', the LSB = 1 & MSB =1. So if give LSB =1, output =1, Then we give '0', so output =1. Then we give '1', so output = 0. Now the output is: 011 instead of 110. Some body please guide me.