重EDA技术课程设计报告.doc
- 文档编号:169806
- 上传时间:2022-10-05
- 格式:DOC
- 页数:20
- 大小:2MB
重EDA技术课程设计报告.doc
《重EDA技术课程设计报告.doc》由会员分享,可在线阅读,更多相关《重EDA技术课程设计报告.doc(20页珍藏版)》请在冰豆网上搜索。
仅供个人参考
贵州大学
EDA技术课程设计报告
题目:
洗衣机控制器
院系计算机科学与技术学院
专业计算机科学与技术类
学号22
学生姓名李兴
指导教师夏玉勤
洗衣机控制器
一、设计任务及要求(四号宋字,粗体)
1、设计一个电子定时器,控制洗衣机作如下运转:
定时启动→正转20秒→暂停10秒→反转20秒→暂停10秒→定时未到回到“正转20秒→暂停10秒→……”,定时到则停止;
2、若定时到,则停机发出音响信号;
3、用两个数码管显示洗涤的预置时间(分钟数)按倒计时方式对洗涤过程作计时显示,直到时间到停机;洗涤过程由“开始”信号开始;
4、三只LED灯表示“正转”、“反转”、“暂停”三个状态。
二、基于Verilog语言的电路设计、仿真、综合(四号宋字,粗体)
1.基本原理
洗衣机控制器的设计主要是定时器的设计。
由一片FPGA和外围电路构成了电器控制部分。
FPGA接收键盘的控制命令,控制洗衣机的进水、排水、水位和洗衣机的工作状态、并控制显示工作状态以及设定直流电机速度、正反转控制、制动控制、起停控制和运动状态控制。
对芯片的编程采用模块化的VHDL(硬件描述语言)进行设计,设计分为三层实现,顶层实现整个芯片的功能。
顶层和中间层多数是由VHDL的元件例化语句实现。
中间层由无刷直流电机控制、运行模式选择、洗涤模式选择、定时器、显示控制、键盘扫描、水位控制以及对直流电机控制板进行速度设定、正反转控制、启停控制等模块组成,它们分别调用底层模块。
定时到
2.设计框图
停止
暂停10s
反转20s
暂停10s
正转20s
定时启动
定时没到
图1设计框图
用两位数码管预置洗涤时间(分钟数),洗涤过程在送入预置时间后开始运转,洗涤中按倒计时方式对洗涤过程作计时显示,用LED表示电动机的正、反转,如果定时时间到,则停机并发出音响信号。
3、模块设计和相应模块代码
洗衣机控制器电路主要有五大部分组成,包括:
减法计数器、时序控制电路、预置时间和编码电路、数码管显示、译码器组成。
(1)预设时间和编码电路:
本模块将输入的四位时间信号编码成八位二进制数输出到减法计数器电路。
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity settime is port (
load:
in std_logic;
time_input:
in std_logic_vector(3 downto 0);
time_set:
out std_logic_vector(7 downto 0)
);
end settime;
architecture settime of settime is
signal p1:
std_logic_vector(7 downto 0);
begin
process(load)
begin
if(load'event and load='1')
then
case time_input is
when "0000"=>p1<="00000000";
when "0001"=>p1<="00000001";
when "0010"=>p1<="00000010";
when "0011"=>p1<="00000011";
when "0100"=>p1<="00000100";
when "0101"=>p1<="00000101";
when "0110"=>p1<="00000110";
when "0111"=>p1<="00000111";
when "1000"=>p1<="00001000";
when "1001"=>p1<="00001001";
when others=>p1<="00000000";
end case;
end if;
end process;
time_set<=p1;
end settime;
图2
图3预设时间和编码仿真
用K1、K2、K3、K4给time_input输入一个二进制数0111,让load有效,输出time_set为00000111。
(2)减法计数器模块:
由于洗衣机有工作时间,必须要一模块来控制它的工作时间范围,当洗衣机开始工作后,减法计数器即会实现减数功能,直到时间减到零,洗衣机便停止工作。
当出现系统运行结束信号time_over时,蜂鸣器报警洗衣机工作结束。
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity counter 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_logic
);
end counter;
architecture counter of counter is
begin
process(clk)
variable time_second:
integer range 0 to 59 :
=59;
begin
if(clk'event 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_over='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_remain(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 counter;
图4
图5减法计数器模块源仿真
(3)数码管显示模块:
根据课程设计要求,必须将洗衣机的工作状态及工作时间在数码管和指示灯上显示出来,此模块是用来控制洗衣机的工作状态及工作的频率,并把工作状态及工作时间显示出来。
a,b,c,d,e,f,g分别对应数码管的七段,minute和second分别位选两个数码管,显示十位和个位。
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all; entity showtime is
port (
time_remain:
in std_logic_vector(7 downto 0);
clk:
in std_logic;
minute,second:
out std_logic;
a,b,c,d,e,f,g:
out std_logic
);
end 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(clk'event and clk='1')
then
choose<=not choose;
if(choose='1')
then
minute<='0';second<='1';
bcd<= time_remain(7 downto 4);
else
minute<='1';second<='0';
bcd<= time_rem
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- EDA 技术 课程设计 报告
![提示](https://static.bdocx.com/images/bang_tan.gif)