SUBDESIGN moore1
(
	clk	: INPUT;
	reset	: INPUT;
	y		: INPUT;
	z		: OUTPUT;
)
VARIABLE
					%	current	current %
					%	state		output  %
	ss:	MACHINE OF BITS			(z)
			WITH STATES	(s0 =	 	0,
						 	 s1 =		1,
						 	 s2 =	 	1,
							 s3 =		0);
BEGIN
	ss.clk   = clk;
	ss.reset = reset;

	TABLE
	%	current	current		next  %
	%	state		input		state %
		ss,		y		=>	ss;

		s0,		0		=>	s0;
		s0,		1		=>	s2;
		s1,		0		=>	s0;
		s1,		1		=>	s2;
		s2,		0		=>	s2;
		s2,		1		=>	s3;
		s3,		0		=>	s3;
		s3,		1		=>	s1;
	END TABLE;
END;
