When s5=>
clr_nc<=‘0’;
MMA<=‘0’;
ED<=‘1’;
EA<=‘1’;
EB<=‘1’;
alarma<=‘0’;
unen_keya<=‘0’;
if NC=4 and keyout_fun="1011" then
if REGS=ACC or PW=ACC then
states<=s1;
clr_nc<=‘1’;
else
clr_nc<=‘1’;
end if;
elsif NC=4 and keyout_fun="1010" then
--transfer to the state of changing PW-
if REGS=ACC or REGS<=PW then
--after entering the right previous PW.
states<=s6;
clr_nc<=‘1’;
else
clr_nc<=‘1’;
end if;
end if;