+ if state(3) = '1' then
+ direction := '1';
+ end if;
+
+ if state(0) = '1' then
+ direction := '0';
+ end if;
+
+ if direction = '0' then
+ state(3 downto 1) := state(2 downto 0);
+ state(0) := '0';
+ else
+ state(2 downto 0) := state(3 downto 1);
+ state(3) := '0';
+ end if;