2

Design a Mealy machine to add two integer(binary number).

I can not determine how to deal with the carry.And what to do with the last carry generated.

Hailey
  • 1,020
  • 1
    I don't know much about these things, but maybe these notes will be helpful: http://rutherglen.science.mq.edu.au/~maths/notes/Cooper/Languages%20and%20Machines/CHAP04%20Introduction%20to%20FSAs.pdf – Gerry Myerson Jun 23 '16 at 06:21
  • Have you had a look at those notes? – Gerry Myerson Jun 24 '16 at 07:18
  • Yes I've checked those notes and can solve other problem related to mealy m/c..but in this problem I deal with the indermediate carry but can't figure out the last generated carry bit – Hailey Jun 24 '16 at 08:44

1 Answers1

4

Something like this: A mealy machine for binary addition

Edit. The two numbers are written in inverse binary notation and you may need to add an extra zero in the front. For instance, suppose you want to add $22$ and $13$. In binary notation, $22$ is $10110$ and $13$ is $1101$. In inverse binary notation, $22$ is $01101$ and $13$ is $1011$. Add $0$ at the end of $01101$ and $00$ at the end of $1011$ and then write the two numbers as follows $$ \begin{matrix} 0&1&1&0&1&0 \\ 1&0&1&1&0&0 \end{matrix} $$ Starting from the initial state, you now have the following path $$ 0 \xrightarrow{(0,1)\mid 1} 0 \xrightarrow{(1,0)\mid 1} 0 \xrightarrow{(1,1)\mid 0} 1 \xrightarrow{(0,1)\mid 0} 1 \xrightarrow{(1,0)\mid 0} 1 \xrightarrow{(0,0)\mid 1} 0 $$ Giving the output $110001$ which is $35$ in reverse binary notation.

J.-E. Pin
  • 40,163
  • suppose 1111+1010=(1)1001 when the MSB is not generated,then it is in state 1 then o/p is 1001.then it also left a 1(MSB).how to print that 1.Am I clear? – Hailey Jun 27 '16 at 11:37
  • This is why I said that you may need to add an extra zero in the front. – J.-E. Pin Jun 27 '16 at 12:32