大作业实验报告题目: L ED 滚动屏姓名: 学院: 专业: 批次: 2学号: 一、实验要求在实验环境下,设计一个多功能的滚动屏。(1) 设置 7 种模式控制 LED 滚动屏的变化。( 2)用 LED 的是否点亮来代表所含有的信息。(3) 通过按键来实现对滚动速度的控制。二、实验步骤步骤一:打开操作软件 diamond , 单击 file->new->project->next , 出现对话框 NEW PROJECT , 在对话框中选择相应的芯片 lattice XP2 , LFXP2-5E 。步骤二: 点击 file->new->file 在对话框 New File 中,选择 verilog ,建立源文件。在 TextEditer 中编辑输入 Verilog 语言源程序并保存。步骤三:在主界面 Process 窗口中双击 Translate Design ,对所编辑的代码进行综合。步骤四:在 Diamond 主界面中,点击 Tools->Spreadsheet view ,打开 Spreadsheet view 框。在 pin 一栏中填入各输入输出映射的管脚。分配完管脚之后点击保存,在主界面 Process 框中, 对 Map Design , Place&Route Design , Export Files 选中所有的选项, 然后右键选中 JEDEC File ,单击其下拉菜单中的 Rerun All 。设置引脚分配图下表所示: 步骤五:在 Diamond 主界面中, 进入 Tools->Programmer 烧写程序。在 State 栏出现 PASS ,即说明烧写成功。三、实验程序 library IEEE; use ; use ; use ; entity circle_led is Port(clk,reset,speed: in std_logic; led: out std_logic_vector(6 downto 0)); end circle_led; architecture BEHAVIORAL of circle_led is signal f_counter: std_logic_vector(27 downto 0); signal t_counter: std_logic_vector(2 downto 0); signal t_speed: std_logic_vector(2 downto 0); signal clk0: std_logic; signal light:std_logic_vector(6 downto 0); begin process(clk,speed) begin if reset='0' then t_speed<="001"; light<="1000101"; elsif speed='0' then if t_speed="111" then t_speed<="001"; else t_speed<=t_speed+1; end if; elsif clk'event and clk='1' then if f_counte
LED滚动屏VHDL 来自淘豆网www.taodocs.com转载请标明出处.