EDA大作业实验报告
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
一、选题目的
大二学过数电之后大三接触EDA数电逻辑设计,老师上课主讲EDA中的VHDL 语言设计部分,上课听讲感觉认真编写程序,借助程序调试,功能/时序的波形仿真,结果应该不会有太偏的问题,个人感觉关键是在FPGA板上下载运行最好是现象明显直观,涉及的运算单元少的实验,所以我选择做流水灯,感觉老师布置的流水灯的题目要求太多了,我就算自定义一个流水灯吧,希望徐老师不要怪我能力有限。
二、设计目标
设计能让一排灯(8只)自动改变显示花样的控制系统。可将实验板上的一排发光二极管作为彩灯用。八个彩灯的变化方式有8种,分别实现1:从右向左灭灯2:从左向右灭灯
3:从右向左亮灯4:从左向右亮灯
5:从两侧向中间灭灯(两侧各一个)
6:从两侧向中间灭灯(两侧各两个)
7:从右侧向左侧亮灯(一侧两个)
8:交叉闪烁
按照实际生活中常见的流水灯变化,设计的这8种花形变化实现自动循环变化。
三、实现方案(包括原理框图和VHDL设计流程图)
四、设计过程(包括关键模块的仿真结果)VHDL
library IEEE;
use IEEE.STD_LOGIC_1164.all;
useIEEE.STD_LOGIC_unsigned.all;
entity led1 is
port(
sysclk: in std_logic;
dout: out std_logic_vector(7downto 0) );
end led1;
architecturejgt of led1 is
signalcnt : std_logic_vector ( 7 downto 0);
--variable count:integer RANGE 0 TO 7;
signal count : std_logic_vector(5 DOWNTO 0);
begin
process(sysclk)
begin
if ( sysclk'event and sysclk = '1') then
cnt<= cnt + 1;
if (cnt = "11110111") then
cnt<= "00000000" ;
count<=count+1;
end if ;
end if;
end process;
process (count)
begin
case count is
when "000000" =>dout<= "11111110";
when "000001" =>dout<= "11111101";
when "000010" =>dout<= "11111011";
when "000011" =>dout<= "11110111";
when "000100" =>dout<= "11101111";
when "000101" =>dout<= "11011111";
when "000110" =>dout<= "10111111";
when "000111" =>dout<= "01111111";
when "001000" =>dout<= "10111111";
when "001001" =>dout<= "11011111";
when "001010" =>dout<= "11101111";
when "001011" =>dout<= "11110111";
when "001100" =>dout<= "11111011";
when "001110" =>dout<= "11111110";
when "001111" =>dout<= "00000001";
when "010000" =>dout<= "00000010";
when "010001" =>dout<= "00000100";
when "010010" =>dout<= "00001000";
when "010011" =>dout<= "00010000";
when "010100" =>dout<= "00100000";
when "010101" =>dout<= "01000000";
when "010110" =>dout<= "10000000";
when "010111" =>dout<= "01000000";
when "011000" =>dout<= "00100000";
when "011001" =>dout<= "00010000";
when "011010" =>dout<= "00001000";
when "011011" =>dout<= "00000100";
when "011100" =>dout<= "00000010";
when "011101" =>dout<= "00000001";
when "011110" =>dout<= "01111110";
when "011111" =>dout<= "10111101";
when "100000" =>dout<= "11011011";
when "100001" =>dout<= "11100111";
when "100010" =>dout<= "11011011";
when "100011" =>dout<= "10111101";
when "100100" =>dout<= "01111110";
when "100101" =>dout<= "00111100";
when "100110" =>dout<= "10011001";
when "100111" =>dout<= "11000011";
when "101000" =>dout<= "10011001";
when "101001" =>dout<= "00111100";
when "101010" =>dout<= "00000011";
when "101011" =>dout<= "00000110";
when "101100" =>dout<= "00001100";
when "101101" =>dout<= "00011000";
when "101110" =>dout<= "00110000";
when "101111" =>dout<= "01100000"; when "110000" =>dout<= "11000000"; when "110001" =>dout<= "10101010"; when "110010" =>dout<= "01010101"; when "110011" =>dout<= "10101010"; when "110100" =>dout<= "01010101"; when "110101" =>dout<= "10101010"; when "110110" =>dout<= "01010101"; when "110111" =>dout<= "10101010"; when "111000" =>dout<= "01010101";