基于VHDL語言的FPGA簡易數(shù)字鐘設(shè)計(jì)
when 4 => shi = 1001100;
when 3 => shi = 0000110;
when 2 => shi = 0010010;
when 1 => shi = 1001111;
when 0 => shi = 0000001;
end case;
case feng_t is
when 9 => feng = 0000100;
when 8 => feng = 0000000;
when 7 => feng = 0001111;
when 6 => feng = 0100000;
when 5 => feng = 0100100;
when 4 => feng = 1001100;
when 3 => feng = 0000110;
when 2 => feng = 0010010;
when 1 => feng = 1001111;
when 0 => feng = 0000001;
end case;
case fens_t is
when 5 => fens = 0100100;
when 4 => fens = 1001100;
when 3 => fens = 0000110;
when 2 => fens = 0010010;
when 1 => fens = 1001111;
when 0 => fens = 0000001;
end case;
case shig_t is
when 9 => shig = 0000100;
when 8 => shig = 0000000;
when 7 => shig = 0001111;
when 6 => shig = 0100000;
when 5 => shig = 0100100;
when 4 => shig = 1001100;
when 3 => shig = 0000110;
when 2 => shig = 0010010;
when 1 => shig = 1001111;
when 0 => shig = 0000001;
end case;
case shis_t is
when 2 => shis = 0010010;
when 1 => shis = 1001111;
when 0 => shis = 0000001;
end case;
end process c;
end first;
和匯編有的一拼啊,呵呵,由于是新手,所以很多程序都帶有單片機(jī)的想法,其實(shí)VHDL和C、FPGA和單片機(jī)是兩種不同的語言、芯片,主要是要有并行思想和狀態(tài)機(jī)的概念,很遺憾我現(xiàn)在好像都沒有。
設(shè)置模式開關(guān)是sw01.、分鐘設(shè)置按鈕key01、key02 。
評論