数字系统设计(洗衣机控制器)(12页).doc

上传人:1595****071 文档编号:38578490 上传时间:2022-09-04 格式:DOC 页数:12 大小:168.50KB
返回 下载 相关 举报
数字系统设计(洗衣机控制器)(12页).doc_第1页
第1页 / 共12页
数字系统设计(洗衣机控制器)(12页).doc_第2页
第2页 / 共12页
点击查看更多>>
资源描述

《数字系统设计(洗衣机控制器)(12页).doc》由会员分享,可在线阅读,更多相关《数字系统设计(洗衣机控制器)(12页).doc(12页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、-数字系统设计(洗衣机控制器)-第 12 页实验报告 COURSE PAPER数字系统设计(洗衣机控制器)学院 :机电工程与自动化学院 学号: 学生姓名: 打印日期: 评分: 评语:一、实验目的: (1)学习系统电路设计; (2)巩固软件环境下的编程设计; 二、实验内容: (1) 实现以下系统功能:洗衣机控制器。 l 设计一个电子定时器,控制洗衣机作如下运转:定时启动正转20秒暂停10秒反转20秒暂停10秒定时未到回到“正转20秒暂停10秒”,定时到则停止; l 若定时到,则停机发出音响信号; l 用两个数码管显示洗涤的预置时间(分钟数),按倒计时方式对洗涤过程作计时显示,直到时间到停机;洗涤

2、过程由“开始”信号开始; l 三只LED灯表示“正转”、“反转”、“暂停”三个状态。 三、实验要求; l 在PC机上完成相应的设计输入,编译,仿真,对结果进行分析; l 完成下载,在实验板上对程序进行验证。 四、 实验步骤;(1) 实验分析 a.预设时间和编码电路(settime):接受用户通过按钮预置的时间信息,编码 成八位之后转给减法计数器。 b.减法计数器电路(counter):接收编码之后的预置时间信息,向电机运转控制电路传递运行信号,并将预置时间信息和剩余时间信息发给数码管显示电路进行实时显示。 c.数码管显示电路(showtime):接收减法计数器电路传来的时间信息,进行实时译码显

3、示。 e.电机运转时序控制电路(analyse):接收运行起止信号,安排电机运行状态并编码输出。 f.译码器(move):接收电机运行状态信号,译码后实时控制电机的正传、反转和暂停。程序框图如下:(2) 程序编写a.预设时间和编码电路(settime):library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity timeset is port load:in std_logic; time_input:in std_logic_vector(3 downto 0); time_set:out s

4、td_logic_vector(7 downto 0)end timeset;architecture timeset of timeset is signal p1:std_logic_vector(7 downto 0); begin process(load) begin if(loadevent and load=1) then case time_input is when 0000=p1p1p1p1p1p1p1p1p1p1p1=00000000; end case; end if; end process; time_set=p1;end timeset;b.减法计数器电路(cou

5、nter):library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity sub is port clk,start:in std_logic; time_set:in std_logic_vector(7 downto 0); time_remain:buffer std_logic_vector(7 downto 0); time_over:buffer std_logicend sub;architecture sub of sub is begin process(clk) variabl

6、e time_second:integer range 0 to 59 ; begin if(clkevent and clk=1) then if(start=0) then if(time_remain(7 downto 0)=0) then time_remain=time_set; else time_remain(7 downto 4)=time_remain(3 downto 0); time_remain(3 downto 0)=time_set(3 downto 0); end if; time_second:=59; time_over=1; else if(time_ove

7、r=1) then if(time_second=0 and time_remain(7 downto 0)=0) then time_over=0; else if(time_second=0) then if(time_remain(3 downto 0)=0) then time_remain(7 downto 4)=time_remain(7 downto 4)-1; time_remain(3 downto 0)=1001; time_second:=59; else time_remain(7 downto 4)=time_remain(7 downto 4); time_rema

8、in(3 downto 0)=time_remain(3 downto 0)-1; time_second:=59; end if; else time_second:=time_second-1; end if; end if; end if; end if; end if; end process;end sub;c.数码管显示电路(showtime):library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity showtime is port time_remain:in std_logi

9、c_vector(7 downto 0); clk:in std_logic; minuteshi,minutege:out std_logic; a,b,c,d,e,f,g:out std_logicend showtime;architecture showtime of showtime is signal temp:std_logic_vector(6 downto 0); signal bcd:std_logic_vector(3 downto 0); signal choose:std_logic; begin process(clk) begin if(clkevent and

10、clk=1) then choose=not choose; if(choose=1) then minuteshi=0;minutege=1; bcd= time_remain(7 downto 4); else minuteshi=1;minutege=0; bcdtemptemptemptemptemptemptemptemptemptemptemp=1111011; end case;a=temp(6);b=temp(5);c=temp(4);d=temp(3);e=temp(2);f=temp(1);g=temp(0); end process;end showtime;e.电机运转

11、时序控制电路(analyse):library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity analyse is port clk,start,time_over:in std_logic; out_1,out_2:out std_logicend analyse;architecture analyse of analyse is begin process(clk) variable state:std_logic; variable wash_time:integer range 0 to

12、 20; variable wait_time:integer range 0 to 10; begin if(clkevent and clk=1) then if(start=0) then wash_time:=0; wait_time:=0; state:=0; out_1=0;out_2=0; else if(time_over=1) then if(wash_time=20) then if(wait_time=10) then wash_time:=0; state:=not state; else wait_time:=wait_time+1; end if; else was

13、h_time:=wash_time+1; wait_time:=0; end if; end if; if (wash_time=20) then out_1=0;out_2=0; else if(state=0) then out_1=1;out_2=0; else out_1=0;out_2=1; end if; end if; end if; end if; end process; end analyse;f.译码器(move):library ieee;use ieee.std_logic_1164.all;entity threeyimaqi is port out_1,out_2

14、:in std_logic; REV,RUN,PAUSE:buffer std_logicend threeyimaqi;architecture move of threeyimaqi is signal choose:std_logic_vector(1 downto 0); begin choose(1)=out_1;choose(0)REV=0;RUN=0;PAUSEREV=0;RUN=1;PAUSEREV=1;RUN=0;PAUSEREV=0;RUN=0;PAUSE=0; end case; end process;end move;器件总电路图如下:仿真波形如下:实物图:五、 实验

15、心得 通过这次的VHDL设计,我真的是受益匪浅。看到洗衣机控制器的题目,对于初次接触vhdl语言的我来说,头脑里几乎是没有任何概念的,根本就不知道该从何处下手。不过我并没有气馁,在老师的悉心指导以及同学们的热心帮助下,通过网上查阅相关资料,我渐渐有了眉目。 这次设计,让我初步掌握了VHDL的设计方法与一些技巧,让我对FPGA的编程、定时器和计数器的设计更加熟悉,也更加明白时序组合门电路设计思路和方法。在设计中也参了和查阅了很多资料,从中学到不少课本上没有的东西,这些对我的学习有很大的帮助。同时,我没那个明白了这次课程设计是一个理论与实际结合的过程,理论知识往往是不够的,只有把所学的理论与实际行动相结合,才能提高自己的综合实际能力和独立思考的能力。在设计过程中我们都会遇到很多的问题,但往往是一个小问题都会导致设计的失败,这就要我们花大量的时间区思索和改正,这是一个很艰辛的过程,但同时也是我收获最大的过程。考察我们的就是恒心与毅力。设计往往是一个苦中有乐的过程,如果从兴趣出发,则就会释然很多,通过这次设计,是我对数字电路实验产生了浓厚的兴趣,我希望在以后的学习中继续加深对这一个方面的学习。

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 小学资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com