begin
lock <=lock1;
process(current_state,eoc)
begin
case current_state IS
when st0=>ale<=‘0’;start<=‘0’;oe<=‘0’;lock1<=‘0’;
next_state <=st1;
when st1=>ale<=‘1’;start<=‘0’;oe<=‘0’;lock1<=‘0’;
next_state <=st2;
when st2=>ale<=‘0’;start<=‘1’;oe<=‘0’;lock1<=‘0’;
next_state <=st3;
when st3=>ale<=‘0’;start<=‘0’;oe<=‘0’;lock1<=‘0’;
if (eoc=‘1’) then next_state <=st3;
else next_state <=st4;
end if;
when st4=> ale <=‘0’;start <=‘0’;OE<=‘0’;lock1<=‘0’;
if (eoc =‘0’) then next_state <=st4;
else next_state <=st5;
end if;
when st5=> ale <=‘0’; start <=‘0’;oe<=‘1’;lock1<=‘0’;
next_state <=st6;
when st6=> ale <=‘0’; start <=‘0’; oe <=‘1’;lock1<=‘1’;
next_state <=st0;
when others=> ale <=‘0’; start <=‘0’;oe <=‘0’;lock1<=‘0’;
next_state <=st0;
end case;
end process;
process (clk)
begin
if (clk’event and clk =‘1”) then
current_state <=next_state;
end if;
end process;
process(lock1)
begin
if lock1=‘1’ and lock1’event then
regl<=d;
end if;
end process;
q<=regl;
……
begin
lock<=lock1;
process(current_state,eoc)
begin
case current_state IS
when st0 => next_state <=st1;
when st1 => next_state <=st2;
when st2 => next_state <=st3;
when st3 => if (eoc =‘1’)then next_state <=st3; else next_state <=st4;end if;
when st4 => if (eoc =’0’)then next_state<=st4;else next_state <=st5; end if;
when st5 => next_state <=st6;
when st6 => next_state <=st0;
when others=> next_state <=st0;
end case;
out4<=current_state(5 downto 2);
ale<=current_state(5); start <=current_state(4);
oe<=current_state(3); lock1<=current_state(2);
end process;
process(clk)
begin
if (clk’event and clk =‘1’) then
current_state <=next_state;
end if ;
end process ;
process (lock1)
if lock1=‘1’ and lock1’event then
regl<=d ;
end if ;
end process ;
q<=regl;
……