农业工程学院课程设计说明书
next_state<=s15; else
next_state<=s16; end if; when
s14=>disp<=\
if a='0' then
next_state<=s16; else
next_state<=s15; end if; when s15=>
if odd_eve='0' then
success<='1'; disp<=\ else
disp<=\
end if; when s16=>
if odd_eve='0' then disp<=\ else
success<='1'; disp<=\
end if; end case;
else if odd_eve='0' then ---进入奇校验模式 success<='0';
case present_state is when
s0=>disp<=\
if a='0' then
next_state<=st; else
next_state<=st; end if; when
st=>disp<=\
if a='0' then
next_state<=s1; else next_state<=s2; end if; when
s1=>disp<=\
- 21 -
农业工程学院课程设计说明书
if a='0' then
next_state<=s3; else
next_state<=s4; end if; when
s2=>disp<=\
if a='0' then
next_state<=s4; else
next_state<=s3; end if; when
s3=>disp<=\
if a='0' then
next_state<=s5; else
next_state<=s6; end if; when
s4=>disp<=\
if a='0' then
next_state<=s6; else
next_state<=s5; end if; when
s5=>disp<=\
if a='0' then
next_state<=s7; else
next_state<=s8; end if; when
s6=>disp<=\
if a='0' then
next_state<=s8; else
next_state<=s7; end if; when
s7=>disp<=\
if a='0' then
next_state<=s9;
- 22 -
农业工程学院课程设计说明书
else
next_state<=s10; end if; when
s8=>disp<=\
if a='0' then
next_state<=s10; else
next_state<=s9; end if; when
s9=>disp<=\
if a='0' then
next_state<=s11; else
next_state<=s12; end if; when
s10=>disp<=\
if a='0' then
next_state<=s12; else
next_state<=s11; end if; when
s11=>disp<=\
if a='0' then
next_state<=s13; else
next_state<=s14; end if; when
s12=>disp<=\
if a='0' then
next_state<=s14; else
next_state<=s13; end if; when
s13=>disp<=\
if a='0' then
next_state<=s15; else
next_state<=s16;
- 23 -
农业工程学院课程设计说明书
end if; when
s14=>disp<=\
if a='0' then
next_state<=s16; else
next_state<=s15; end if; when s15=>
if odd_eve='1' then success<='1';
disp<=\
else
disp<=\
end if; when s16=>
if odd_eve='1' then
disp<=\
else
success<='1';
disp<=\
end if; end case; end if; end if; end process; end;
- 24 -