I am currently studying for my exam, and I got few exercises left. I came across this exercises that I really don't know how to solve neither I found the solution anywhere.

"A sequential circuit has one input (

*X*) and one output (

*Z*). Design a digital system that makes the output

*Z*= 1 if and only if the total number of 1's received is divisible by 3 (for example, 0, 3, 6, ) or total number of 0's received is an even number greater than zero (nine states are sufficient)."

I have no idea how to solve this. Does anyone know something about it?

Any help will be much appreciated, thanks in advance.