EDA课程设计八路彩灯控制器.docx

上传人:b****0 文档编号:17079190 上传时间:2023-07-21 格式:DOCX 页数:12 大小:143.89KB
下载 相关 举报
EDA课程设计八路彩灯控制器.docx_第1页
第1页 / 共12页
EDA课程设计八路彩灯控制器.docx_第2页
第2页 / 共12页
EDA课程设计八路彩灯控制器.docx_第3页
第3页 / 共12页
EDA课程设计八路彩灯控制器.docx_第4页
第4页 / 共12页
EDA课程设计八路彩灯控制器.docx_第5页
第5页 / 共12页
EDA课程设计八路彩灯控制器.docx_第6页
第6页 / 共12页
EDA课程设计八路彩灯控制器.docx_第7页
第7页 / 共12页
EDA课程设计八路彩灯控制器.docx_第8页
第8页 / 共12页
EDA课程设计八路彩灯控制器.docx_第9页
第9页 / 共12页
EDA课程设计八路彩灯控制器.docx_第10页
第10页 / 共12页
EDA课程设计八路彩灯控制器.docx_第11页
第11页 / 共12页
EDA课程设计八路彩灯控制器.docx_第12页
第12页 / 共12页
亲,该文档总共12页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

EDA课程设计八路彩灯控制器.docx

《EDA课程设计八路彩灯控制器.docx》由会员分享,可在线阅读,更多相关《EDA课程设计八路彩灯控制器.docx(12页珍藏版)》请在冰点文库上搜索。

EDA课程设计八路彩灯控制器.docx

EDA课程设计八路彩灯控制器

EDA课程设计

设计题目:

基于VHDL的8路彩灯控制器设计

一、课程设计的目的

1.熟悉QuartusⅡ软件的使用方法,使用VHDL文本输入设计法进行任务设计。

2.增强自己实际动手能力,独立解决问题的能力。

3.通过课程设计对所学的知识进行更新及巩固.

二、课程设计的基本要求

本次课程设计是设计一个8路彩灯控制器,能够控制8路彩灯按照两种节拍,三种花型循环变化。

设计完成后,通过仿真验证与设计要求进行对比,检验设计是否正确。

三、课程设计的内容

编写硬件描述语言VHDL程序,设计一个两种节拍、三种花型循环变化的8路彩灯控制器,两种节拍分别为0.25s和0.5s。

三种花型分别是:

(1)8路彩灯分成两半,从左至右顺次渐渐点亮,全亮后则全灭。

(2)从中间到两边对称地渐渐点亮,全亮后仍由中间向两边逐次熄灭。

(3)8路彩灯从左至右按次序依次点亮,全亮后逆次序依次熄灭。

四、实验环境

PC机一台;软件QuartusⅡ6.0

五、课程设计具体步骤及仿真结果

1、系统总体设计框架结构

分频模块:

把时钟脉冲二分频,得到另一个时钟脉冲,让这两种时钟脉冲来交替控制花型的速度。

二选一模块:

选择两种频率中的一个控制彩灯的花型。

8路彩灯的三种花型控制模块:

整个系统的枢纽,显示彩灯亮的情况。

2、系统硬件单元电路设计

1.分频模块设计

实验程序:

libraryieee;

useieee.std_logic_1164.all;

entityfenpin2is

port(clk:

instd_logic;

clkk:

outstd_logic);

endfenpin2;

architecturebehavoffenpin2is

begin

process(clk)

variableclkk1:

std_logic:

='0';

begin

ifclk'eventandclk='1'thenclkk1:

=notclkk1;

endif;

clkk<=clkk1;

endprocess;

endbehav;

RTL电路图:

波形图:

2.二选一模块设计

实验程序:

libraryieee;

useieee.std_logic_1164.all;

entitymux21is

port(a,b,s:

instd_logic;

y:

outstd_logic);

endmux21;

architecturebehaveofmux21is

begin

process(a,b,s)

begin

ifs='0'theny<=a;

elsey<=b;

endif;

endprocess;

endbehave;

RTL电路图:

波形图:

3.8路彩灯的三种花型控制模块设计

程序:

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_unsigned.all;

entitycolor8is

port(clk,rst:

instd_logic;

q:

outstd_logic_vector(7downto0));

end;

architectureaofcolor8is

signals:

std_logic_vector(4downto0);

begin

process(s,clk)

begin

ifrst='1'thens<="00000";

elsifclk'eventandclk='1'then

ifs="11111"then

s<="00000";

elses<=s+1;

endif;

casesis

when"00000"=>q<="00000000";

when"00001"=>q<="10001000";

when"00010"=>q<="11001100";

when"00011"=>q<="11101110";

when"00100"=>q<="11111111";

when"00101"=>q<="00000000";

when"00110"=>q<="00011000";

when"00111"=>q<="00111100";

when"01000"=>q<="01111110";

when"01001"=>q<="11111111";

when"01010"=>q<="11100111";

when"01011"=>q<="11000011";

when"01100"=>q<="10000001";

when"01101"=>q<="00000000";

when"01110"=>q<="10000000";

when"01111"=>q<="11000000";

when"10000"=>q<="11100000";

when"10001"=>q<="11110000";

when"10010"=>q<="11111000";

when"10011"=>q<="11111100";

when"10100"=>q<="11111110";

when"10101"=>q<="11111111";

when"10110"=>q<="11111110";

when"10111"=>q<="11111100";

when"11000"=>q<="11111000";

when"11001"=>q<="11110000";

when"11010"=>q<="11100000";

when"11011"=>q<="11000000";

when"11100"=>q<="10000000";

when"11101"=>q<="00000000";

whenothers=>null;

endcase;

endif;

endprocess;end;

RTL电路图:

波形图:

4.综合程序

libraryieee;

useieee.std_logic_1164.all;

entityfenpin2is

port(clk:

instd_logic;

clkk:

outstd_logic);

endfenpin2;

architecturebehavoffenpin2is

begin

process(clk)

variableclkk1:

std_logic:

='0';

begin

ifclk'eventandclk='1'thenclkk1:

=notclkk1;

endif;

clkk<=clkk1;

endprocess;

endbehav;

libraryieee;

useieee.std_logic_1164.all;

entitymux21is

port(a,b,s:

instd_logic;

y:

outstd_logic);

endmux21;

architecturebehaveofmux21is

begin

process(a,b,s)

begin

ifs='0'theny<=a;

elsey<=b;

endif;

endprocess;

endbehave;

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_unsigned.all;

entitycolor8is

port(clk,rst:

instd_logic;

q:

outstd_logic_vector(7downto0));

end;

architectureaofcolor8is

signals:

std_logic_vector(4downto0);

begin

process(s,clk)

begin

ifrst='1'thens<="00000";

elsifclk'eventandclk='1'then

ifs="11111"then

s<="00000";

elses<=s+1;

endif;

casesis

when"00000"=>q<="00000000";

when"00001"=>q<="10001000";

when"00010"=>q<="11001100";

when"00011"=>q<="11101110";

when"00100"=>q<="11111111";

when"00101"=>q<="00000000";

when"00110"=>q<="00011000";

when"00111"=>q<="00111100";

when"01000"=>q<="01111110";

when"01001"=>q<="11111111";

when"01010"=>q<="11100111";

when"01011"=>q<="11000011";

when"01100"=>q<="10000001";

when"01101"=>q<="00000000";

when"01110"=>q<="10000000";

when"01111"=>q<="11000000";

when"10000"=>q<="11100000";

when"10001"=>q<="11110000";

when"10010"=>q<="11111000";

when"10011"=>q<="11111100";

when"10100"=>q<="11111110";

when"10101"=>q<="11111111";

when"10110"=>q<="11111110";

when"10111"=>q<="11111100";

when"11000"=>q<="11111000";

when"11001"=>q<="11110000";

when"11010"=>q<="11100000";

when"11011"=>q<="11000000";

when"11100"=>q<="10000000";

when"11101"=>q<="00000000";

whenothers=>null;

endcase;

endif;

endprocess;end;

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_unsigned.all;

entitybalucaidengis

port(clk,s,rst:

instd_logic;

q:

outstd_logic_vector(7downto0));

end;

architectureoneofbalucaidengis

signalh0,h1:

std_logic;

componentfenpin2

port(clk:

instd_logic;

clkk:

outstd_logic);

endcomponent;

componentmux21

port(a,b,s:

instd_logic;

y:

outstd_logic);

endcomponent;

componentcolor8

port(clk,rst:

instd_logic;

q:

outstd_logic_vector(7downto0));

endcomponent;

begin

u1:

fenpin2portmap(clk=>clk,clkk=>h0);

u2:

mux21portmap(a=>h0,b=>clk,s=>s;y=>h1);

u3:

color8portmap(clk=>h1,rst=>rst,q=>q);

end;

波形图:

六、实验总结

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 考试认证 > 公务员考试

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2