본문내용
HEN \"0100\" =>Segs2 <= \"1001100\";
WHEN \"0101\" =>Segs2 <= \"0100100\";
WHEN \"0110\" =>Segs2 <= \"0100000\";
WHEN \"0111\" =>Segs2 <= \"0001111\";
WHEN \"1000\" =>Segs2 <= \"0000000\";
WHEN \"1001\" =>Segs2 <= \"0001100\";
WHEN OTHERS => Segs2 <= \"1111111\";
END CASE;
CASE x3 IS
WHEN \"0000\" =>Segs3 <= \"0000001\";
WHEN \"0001\" =>Segs3 <= \"1001111\";
WHEN \"0010\" =>Segs3 <= \"0010010\";
WHEN \"0011\" =>Segs3 <= \"0000110\";
WHEN \"0100\" =>Segs3 <= \"1001100\";
WHEN \"0101\" =>Segs3 <= \"0100100\";
WHEN \"0110\" =>Segs3 <= \"0100000\";
WHEN \"0111\" =>Segs3 <= \"0001111\";
WHEN \"1000\" =>Segs3 <= \"0000000\";
WHEN \"1001\" =>Segs3 <= \"0001100\";
WHEN OTHERS => Segs3 <= \"1111111\";
END CASE;
CASE x4 IS
WHEN \"0000\" =>Segs4 <= \"0000001\";
WHEN \"0001\" =>Segs4 <= \"1001111\";
WHEN \"0010\" =>Segs4 <= \"0010010\";
WHEN \"0011\" =>Segs4 <= \"0000110\";
WHEN \"0100\" =>Segs4 <= \"1001100\";
WHEN \"0101\" =>Segs4 <= \"0100100\";
WHEN \"0110\" =>Segs4 <= \"0100000\";
WHEN \"0111\" =>Segs4 <= \"0001111\";
WHEN \"1000\" =>Segs4 <= \"0000000\";
WHEN \"1001\" =>Segs4 <= \"0001100\";
WHEN OTHERS => Segs4 <= \"1111111\";
END CASE;
end process seg;
output_logic : process(state)
begin
case state is
when s0 =>
led1 <= \'1\';
led2 <= \'0\';
led3 <= \'0\';
led4 <= \'0\';
when s1 =>
led1 <= \'0\';
led2 <= \'1\';
led3 <= \'0\';
led4 <= \'0\';
when s2 =>
led1 <= \'0\';
led2 <= \'0\';
led3 <= \'1\';
led4 <= \'0\';
when s3 =>
led1 <= \'0\';
led2 <= \'0\';
led3 <= \'0\';
led4 <= \'1\';
when ss0 =>
led1 <= \'1\';
led2 <= \'0\';
led3 <= \'0\';
led4 <= \'0\';
when ss1 =>
led1 <= \'0\';
led2 <= \'1\';
led3 <= \'0\';
led4 <= \'0\';
when ss2 =>
led1 <= \'0\';
led2 <= \'0\';
led3 <= \'1\';
led4 <= \'0\';
when ss3 =>
led1 <= \'0\';
led2 <= \'0\';
led3 <= \'0\';
led4 <= \'1\';
when result =>
led1 <= \'1\';
led2 <= \'1\';
led3 <= \'1\';
led4 <= \'1\';
when others =>
led1 <= \'0\';
led2 <= \'0\';
led3 <= \'0\';
led4 <= \'0\';
end case;
end process output_logic;
end t_1;
WHEN \"0101\" =>Segs2 <= \"0100100\";
WHEN \"0110\" =>Segs2 <= \"0100000\";
WHEN \"0111\" =>Segs2 <= \"0001111\";
WHEN \"1000\" =>Segs2 <= \"0000000\";
WHEN \"1001\" =>Segs2 <= \"0001100\";
WHEN OTHERS => Segs2 <= \"1111111\";
END CASE;
CASE x3 IS
WHEN \"0000\" =>Segs3 <= \"0000001\";
WHEN \"0001\" =>Segs3 <= \"1001111\";
WHEN \"0010\" =>Segs3 <= \"0010010\";
WHEN \"0011\" =>Segs3 <= \"0000110\";
WHEN \"0100\" =>Segs3 <= \"1001100\";
WHEN \"0101\" =>Segs3 <= \"0100100\";
WHEN \"0110\" =>Segs3 <= \"0100000\";
WHEN \"0111\" =>Segs3 <= \"0001111\";
WHEN \"1000\" =>Segs3 <= \"0000000\";
WHEN \"1001\" =>Segs3 <= \"0001100\";
WHEN OTHERS => Segs3 <= \"1111111\";
END CASE;
CASE x4 IS
WHEN \"0000\" =>Segs4 <= \"0000001\";
WHEN \"0001\" =>Segs4 <= \"1001111\";
WHEN \"0010\" =>Segs4 <= \"0010010\";
WHEN \"0011\" =>Segs4 <= \"0000110\";
WHEN \"0100\" =>Segs4 <= \"1001100\";
WHEN \"0101\" =>Segs4 <= \"0100100\";
WHEN \"0110\" =>Segs4 <= \"0100000\";
WHEN \"0111\" =>Segs4 <= \"0001111\";
WHEN \"1000\" =>Segs4 <= \"0000000\";
WHEN \"1001\" =>Segs4 <= \"0001100\";
WHEN OTHERS => Segs4 <= \"1111111\";
END CASE;
end process seg;
output_logic : process(state)
begin
case state is
when s0 =>
led1 <= \'1\';
led2 <= \'0\';
led3 <= \'0\';
led4 <= \'0\';
when s1 =>
led1 <= \'0\';
led2 <= \'1\';
led3 <= \'0\';
led4 <= \'0\';
when s2 =>
led1 <= \'0\';
led2 <= \'0\';
led3 <= \'1\';
led4 <= \'0\';
when s3 =>
led1 <= \'0\';
led2 <= \'0\';
led3 <= \'0\';
led4 <= \'1\';
when ss0 =>
led1 <= \'1\';
led2 <= \'0\';
led3 <= \'0\';
led4 <= \'0\';
when ss1 =>
led1 <= \'0\';
led2 <= \'1\';
led3 <= \'0\';
led4 <= \'0\';
when ss2 =>
led1 <= \'0\';
led2 <= \'0\';
led3 <= \'1\';
led4 <= \'0\';
when ss3 =>
led1 <= \'0\';
led2 <= \'0\';
led3 <= \'0\';
led4 <= \'1\';
when result =>
led1 <= \'1\';
led2 <= \'1\';
led3 <= \'1\';
led4 <= \'1\';
when others =>
led1 <= \'0\';
led2 <= \'0\';
led3 <= \'0\';
led4 <= \'0\';
end case;
end process output_logic;
end t_1;
소개글