洗衣机时控电路EDA课设正确程序_第1页
洗衣机时控电路EDA课设正确程序_第2页
洗衣机时控电路EDA课设正确程序_第3页
洗衣机时控电路EDA课设正确程序_第4页
洗衣机时控电路EDA课设正确程序_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、洗衣机时控电路1 设计目的科技的进步多少体现在了日常生活必需品的进步,本次课设目的是设计一个 与现实生活屮很多家庭使用的洗衣机具冇相同功能的时序控制的洗衣机。熟练掌 握quartus ii软件,编写程序,绘制原理图,可进行编译及功能仿真,实现软 件上的洗衣机功能。2.设计要求和任务设计要求和任务:任务:设计一个洗衣机时控电路。要求:能过通过时间控制洗衣机的工作状态,通过指示灯显示三种洗衣机状态, 即正转,暂停,反转。并能循环控制电动机运行规律为正转20s.停10s.反转20s. 停10s再正传20s,以后反复运行。3总体设计思路与原理描述洗衣机时控电路,主要思想就是时间控制洗衣机的工作状态,设

2、计该电路得冇如 下功能,时间预置,时间显示,状态控制,减法计数等,所以电路大概分一下5 部分:(1) 时间设置(2) 数码管显示电路(3) 时序控制电路(4) 预置时间和编码电路(5) 译码器电路顶层文件用原理图来实现,通过创建各个子模块的原件,在顶层文件中按照底层 文件实现的功能进行连线就可以得到完整的顶层原理图。层次图:停止图3. 1设计层次图4.分层次方案设计及代码描述4. 1设置时间library ieee;use ieeestd_logic_1164. all;entity settime isport(load:in stdlogic;k:in std_logic_vector(7

3、 downto 0);c:buffer std logic vector(7 downto 0);end settime;architecture ggh of settime isbeginprocess (load)beginif (load=,1') thencase k(3 downto 0) iswhen 0000二cuoooooooo"when0001二c二00000001when,0010,=>c<=,00000010/,when0011二c=00000011when0100二c二00000100when,010r,=>c<=,00000

4、10r,when0110 二cuoooool 10when0111二c二00000111when,1000,=>c<=,00001000/,when1001二c=00001001when1010二c二00010000when" 1011 =>c v00010001 when1100=>cu00010010when1101二c二00010011when'll 10,=>c<=,00010100/, pu-(o-s)oiip4s 4nouq.po.qco-(0 opunop z) joro >oibjcotp 户 s uh e j) pj

5、oci sh 三ipnoqs apipu 二-p p u.sunooip)s .2 sn 二 ie寸 91 iioop4s .2 bn£.2auq 二-ss31a pu厂二二二 ms- seopu lxxxxxxxx、hohsmno uqqm l1012000、“。丿、二二、uqqm厂二二o二、lld 畐xjsoru 电 l s s i、lldw xu、oo2、u qm -、二 i0000、hduiqxjiis、u£m ls二二 llld 畐xjo二 0、u 电 li2i2i、lldwqxu、i20、u£m l0ii00irhdwqxj00i0、u£m

6、l 二二 00 llld 畐xj 二 00、u 电 lii2i2、lldwqxu、oioo、ufm -、o二 oooo、hd畐xjsoo、u£m l二二二o、lld 畐xj0000、uqqm sh (0 oumop g)lui)utelu ,1 seo.sbo q (eiruielu .1) ssqoojdulm q -(0 orusop 9) jo4o a.2mopvdui 4 leumls sh ££oqs jo 二 j jrnoqlpjewhen others二temp二0000000;end case;end process;a<=temp(6) ;

7、b<=temp(5) ;c<=temp(4) ;d<=temp(3) ;e<=temp(2) ;f<=temp(l); g<=temp (0);end rtl;4. 3时序控制电路library ieee;use ieee. std_logic_1164.all;use ieee. std_logic_unsigned.all;entity shixu isport(cp, en, rd:in std logic;ql, q2:out std_logic);end shixu;architecture rtl of shixu isbeginprocess

8、(cp)variable wash_time:integer range 0 to 19;variable wait_time:integer range 0 to 9;variable state:std_logic;variable wash_time2:integer:=21;variable wait_time2:integer:=9;beginif (en二'0) then wash_time:=19;wait_time:=9;state:=state;end if;if (en 二'o') then wash_time2:=21 ;ql<=,;q2二&

9、#39;o'else if (cp event and cp二t)then if (rd=,t)then if(wash_time>0)thenwash_time2:=20;state:二not state;end if;end if;end if;if (wash_time=o) thenql<=,o' ;q2<=,o'elsif(state二'o')thenql<= r ;q2<= o'elsif(wait_time>0)thenql<= o' ;q2<= 1'else ql&l

10、t;=,o' ;q2<=,o'end if;end if;end process;end rtl;4. 4预置时间和编码电路library ieee;use ieee. std_logic_1164.all;use ieee. std_logic_unsigned.all;entity counterl isport(elk, start:in std logic;k:in std_logic_vector(7 downto 0);time_remain:buffer std_logic_vector(7 downto 0); time_is_up:out stdlogi

11、c);end counterl;architecture ttl of counterl isbeginprocess (elk)variable time_second:integer:=60;variable time_secondl:integer:=0;beginif (elk" event and elk二i) then if (start二'r ) thentime remain<=k;time second:=60;time secondl:=0;if(time secondl=0)thenif (time remain (3 downto 0)>0

12、)thentime remain(3downto0)<=time remain (3downto0)-1;time_second:=59;time_is_up<=,1 ;elseif(time_remain(7 downto 4)>0)thentime_remain(7 downto 4)<=time_remain(7 downto 4)-1;time_remain(3 downto 0) <=,z1001z,; time_second:=59; time_is_up<=" t ; end if;end if;else if(time_second

13、=0)thenif (time_remain=0)then time_is_up<=" 0"end if;end if;end if;end if;end if;end process;end ttl;library ieee;use ieee. std_logic_1164.all;entity decoder isport(ql, q2:in std_logic;rev, run, pause:out std logic);end decoder;architecture rtl of decoder issignal choose:std_logic_vector(1 downto 0); beginchoose (1)<=ql;choose(0)二q2;process(choose)begincase choose iswhen ,00/,=>rev<=,0" ;run<=,o' ; pause v 1' when ,10,=>rev<=,0? ; run<=,1' ;pause&l

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论