1 votes 1 votes The number of states in 2’s complements Moore machine is ? a. 2 b. 3 c. 4 d. 1 garg div asked Nov 27, 2017 garg div 7.7k views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Namit Dhupar commented Nov 27, 2017 reply Follow Share I guess 3 0 votes 0 votes garg div commented Nov 27, 2017 reply Follow Share Please explain how 0 votes 0 votes Please log in or register to add a comment.
Best answer 1 votes 1 votes I made this Moore State diagram for better understanding! Hope that helps! Namit Dhupar answered Nov 27, 2017 selected Nov 27, 2017 by garg div Namit Dhupar comment Share Follow See all 9 Comments See all 9 9 Comments reply garg div commented Nov 27, 2017 reply Follow Share thanx 1 votes 1 votes Red_devil commented Nov 27, 2017 reply Follow Share @Namit Dhupar how will you deal with the extra number generated by moore machine which is the start symbol in A 0 votes 0 votes Namit Dhupar commented Nov 27, 2017 reply Follow Share If I understand your question right @Red_devil, the question here is asking for 2's complement of any binary number... Well, to do that, I learnt a little trick from somewhere, where given a binary number instead of finding a 1's complement and adding a 1 to LSB and then find the answer, what I do is- 1.) Take the given binary number and look at It's LSB 2.) while going from LSB to MSB all the 0's on the LSB as well as the last 1 from the LSB must be kept as it is and rest of the remaining digits should be complemented... Here, let me show an example say given binary is 11100 ----> So 2' compliment will be (00100) Highlighted digits are unchanged and rest complemented. or 1111 -----> 0001 (Even if there are no 0's the 1 at the LSB should remain as it is and rest 1's complemented) And no matter what and how long number you throw at it, this machine will accept it! 0 votes 0 votes Red_devil commented Nov 27, 2017 reply Follow Share @ Namit Dhupar thanks for replying but my question is that when you are start in state you are already generating 0 in your moore machine so your number will have an extra 0 in LSB , please correct me if i am wrong, 0 votes 0 votes Namit Dhupar commented Nov 27, 2017 reply Follow Share Oh, I forgot to mention, You have to feed the given binary number from LSB into the automata. 0 votes 0 votes Red_devil commented Nov 27, 2017 reply Follow Share @Namit Dhupar i am just asking what will your machine generate if no string is supplied to it.. i.e. epsilon. 0 votes 0 votes Namit Dhupar commented Nov 27, 2017 reply Follow Share Output of the initial state,0 0 votes 0 votes Red_devil commented Nov 27, 2017 reply Follow Share @ Namit Dhupar yes!! that is what i am asking.. so every thing you generate will have a 0 at LSB how will you overcome this problem please explain. 0 votes 0 votes Namit Dhupar commented Nov 27, 2017 i edited by Namit Dhupar Nov 27, 2017 reply Follow Share I gotta be honest buddy, what I did was I originally derived the question in it's Mealy form and then converted it to Moore. And the asker asked about the number of states which I immediately responded to, though you are right about Prefixes being always printed.... Can I have an (A,$\epsilon$) in the initial state with no transitions and make another state with say (X,0) with 0 as output, and then continue with rest of the automata, but this would make number of states as 4! and general rule says, for K states in Mealy, there are K+1 states in Moore... Other than that,What approach do you have in mind? 1 votes 1 votes Please log in or register to add a comment.