10 10 votes Give a minimal DFA that performs as a $\mod - 3,\;$ $1$'s counter, i.e. outputs a $1$ each time the number of $1$'s in the input sequence is a multiple of $3$. Digital Logic gate1987 digital-logic digital-counter descriptive + – Misbah Ghaya 4.9k views answer comment Share Follow Print See all 5 Comments 5 5 Comments reply Show 2 previous comments Shaik Masthan commented Aug 27, 2018 reply Follow flag @Swapnil Naik i am also thinking that in the same way... and one more doubt about alphabet, is it binary or decimal. for confirmation i asked sample input. 0 0 replyShare Satbir commented Jun 15, 2019 reply Follow flag Whatever be in the input whether it is decimal or binary we don't have to care. we just have to count number of 1's in the given sequence and if it is multiple of 3 then we have to print 1. for eg : - input is 1011 in decimal then also print 1. input is 1101 in binary then also print 1. 1 1 replyShare Shaik Masthan commented Aug 18, 2024 reply Follow flag @Satbir,yes, input alphabet (should include 1 always) is not significant here due to our focus is on only number of 1's.However, while drawing DFA/Melay/Moorey, input alphabet have significance to draw the transitions. 0 0 replyShare Please log in or register to add a comment.
Best answer 18 18 votes Since it is given that the minimal DFA outputs $1$ $\implies$ we have to make a minimal DFA and then convert it into mealy/ moore machine by associating output with each input or state. the minimal DFA will be as shown below :- I am associating output with each input i.e. creating a mealy machine. It will print 1 each time the number of 1's in the input sequence is a multiple of 3. Satbir answered Jun 15, 2019 • selected Aug 13, 2019 by Arjun Satbir comment Share Follow See all 6 Comments 6 6 Comments reply Show 3 previous comments ash_khola commented Aug 18, 2024 reply Follow flag There is no final state in case of mealy / moore machine why did you put it ? 0 0 replyShare Prakash_ commented Jul 17, 2025 reply Follow flag @ash_kholai think they have made, to count if number of 1's is 0 . 0 0 replyShare https_guru commented Jan 2 reply Follow flag @Prakash_ No use of final state in mealy/moore machine. 0 0 replyShare Please log in or register to add a comment.