Can we construct a transducer to do the above computation? If yes show it. Otherwise explain why?

We can't because its infinite sized machine. However if the string is finite we can construct a Moore machine attached. :

Some body please guide me if the above Moore Machine/transducer correct or not?

Zulfi.