欢迎来到三一文库! | 帮助中心 三一文库31doc.com 一个上传文档投稿赚钱的网站
三一文库
全部分类
  • 研究报告>
  • 工作总结>
  • 合同范本>
  • 心得体会>
  • 工作报告>
  • 党团相关>
  • 幼儿/小学教育>
  • 高等教育>
  • 经济/贸易/财会>
  • 建筑/环境>
  • 金融/证券>
  • 医学/心理学>
  • ImageVerifierCode 换一换
    首页 三一文库 > 资源分类 > DOC文档下载
     

    《电子设计自动化技术》EDA实训指导书 .doc

    • 资源ID:5091989       资源大小:192.50KB        全文页数:28页
    • 资源格式: DOC        下载积分:6
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录   微博登录  
    二维码
    微信扫一扫登录
    下载资源需要6
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    《电子设计自动化技术》EDA实训指导书 .doc

    28电子设计自动化技术实训 CSH CSH 前 言EDA是电子设计自动化(Electronic Design Automation)的缩写,在20世纪90年代初从计算机辅助 设计(CAD)、计算机辅助制造(CAM)、计算机辅助测试(CAT)和计算机辅助工程(CAE)的概念发展而来的。EDA技术就是以计算机为工具,设计者在EDA软件平台上,用硬件描述语言HDL完成设计文件,然后由计算机自动地完成逻辑编译、化简、分割、综合、优化、布局、布线和仿真,直至对于特定目标芯片的适配编译、逻辑映射和编程下载等工作。EDA技术的出现,极大地提高了电路设计的效率和可靠性,减轻了设计者的劳动强度。VHDL是一门非常重要的、是目前标准化程度最高的硬件描述语言。它在1987年就被IEEE采纳为IEEE#1076标准。用其书写的源文件既是程序又是文档,既是工程技术员之间交换信息的文件,以可作为合同签约者之间的文件。 在电子设计自动化技术课程的理论学习中,我们已仔细地介绍了基本数字电路的VHDL描述,为进一步掌握VHDL的综合应用,通过专门实训周以加强实践操作能力。本次实训现提供以上几个数字系统综合课题供大家进行分析 练习 修改与矿。为了提高分析 实践效果,在此只提供简单的课题框图与注释作为提示。同时将VHDL源代码给出以便对照调试之用。 课题1 带数字显示的秒表一、 设计任务及要求1、 设计一块用数码管显示的秒表。2、 能够准确的计时并显示。3、 开机显示00.00.00。4、 用户可随时清零、暂停、计时。5、 最大计时59分钟,最小精确到0.01秒。二、 可选器件EPM130208-2、共阴极七段数码管、发光二极管、按键开关、电阻、电容。三、 设计总体框图 数字显示器的秒表总体框图如图1所示。译码显示时分复用分频电路时钟输入计时模块 图1带数字显示的秒表总体框图四、 源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity watch isport (sel:out std_logic_vector(6downto1); 信号。seg:out std_logic_vector(7downto 0); 管的输出信号。beginstop:in std_logic;、停止计数。reset:in std_logic; 复位 cp2:in std_logic);end watch; architecture behave of watch is signal numl:std_logic_vector(3downto0); signal num2:std_logic_vector(3downto 0); signal num3:std_logic_vector (3 downto 0); signal num4:std_logic_vector (3 downto 0); signal num5:std_logic_vector(3 downto 0); signal num6:std_logic_vector(3 downto 0); signal num: std_logic_vector(3 downto 0); signal numlet:std_logic_vector(2 downto 0); signal count:std_logic_vector( 17 downto 1); signal selsig:std_logic_vector(6 downto 1); signal segsig:std_logic_vector(7 downto 0);signal cp1:std_logic;signal cp3:std_logic;beginprocess(cp2)分频。BeginIf(cp2event and cp2=1)thenIf(count=”11000011010011111”)then count<=”00000000000000000”;cp1<=not cp1; else count<=count+1;end if;end if; cp3<=count(10);end process;process(cp1)计数控制。BeginIf reset=1 then num1(3downto 0)<=”0000”; Num2(3downto 0)<=”0000”; Num3(3downto 0)<=”0000”; Num4(3downto 0)<=”0000”; Num5(3downto 0)<=”0000”; Num6(3downto 0)<=”0000”; Else if cp1event and cp1=1 thenIf biginstop=1 then num1<=num1+1;If num1(3downto 0)=”1001” thenNum1 (3downto 0)<=”0000”;num2<=num2+1;If num2(3downto 0)=”1001” thenNum2(3 downto 0)<=”0000”;num3=num3+1;If num3(3downto 0)=”1001” thenNum3(3downto 0)<=”0000”;unm4<=num4+1;If num4(3downto 0)=”0101”thenNum4(3downto0)<=”0000”;num5<=num5+1;If num5(3downto 0)=”1001” thenNum5(3downto 0)<=”0000” ;num6=num6+1;If num6(3downto 0)=”0101”thenNum6(3downto0)<=”0000”;End if ;end if; end if; end if; end if;end if;end if;End if;end if;End process;Process(cp3)显示控制。Begin If(cp3event and cp3=1)thenIf(numlet(2downto0)=”000”)thenNum<=numl;selsig(6downto1)<=”111110”;end if;If(numlet(2downto0)=”001”)thenNum<=num2;selsig(6downto1)<=”111101”;end if;If(numlet(2downto0)=”010”thenNum<=num3;selsig(6downto1)<=”111011”;end if;If(numlet(2downto 0)=”100”;thenNum<=num4;selsig(6downto1)<=”110111”;end if;If(numlet(2downto0)=”100” thenNum<=num5;selsig(6downto1)<=”101111”;end if;Numlet(2downto 0)<=numlet(2downto 0)+1;If(numlet(2downto0)=”101”thenNumlet(2downto 0)<=”000”;num<=num6;Selsig(6downto1)<=”011111”;end if;End if;If(num(3downto0)=”0000”)thenSegsig(7downto 0)<=”01111111”;end if;End if;If(num(3downto0)=”0001”)thenSegsig(7downto0)<=”00001101”;end if;If(num(3downto0)=”0010”)thenSegsig(7downto 0)<=”10011111”;end if;If(num(3downto0)=”0100”)thenSegsig(7downto0)<=”10011111”;end if;If(num(3downto0)=”0100”)thenSegsig(7downto0)<=”11001101”;end if;If(num(3downto)=”0101”)then Segsig(7downto0)<=”11011011”;end if;If(num(3downto0)=”0110”)thenSegsig(7downto0)<=”11111011”;end if;If(num(3downto0)=”0111”;)thenSegsig(7downto0)<=”00001111”;end if;If(num(3downto0)=”1000”)thenSegsig(7downto0)<=”11111111”;end if;If(num(3downto0)=”1001”)thenSegsig(7downto0)<=”11011111”;end if;End process;Sel<=selsig;Seg(7downto0)<=segsig(7downto0);End behave;五、 程序说明1、 此程序包括分频、计数控制、显示控制部分。2、 开机显示00.00.00,用户可随时计时、暂停、清零,最大计时可到59分59.99秒。3、 计数时钟为100HZ。4、 采用时分复用的方法控制4个数码管的显示,可节约资源。 课题2 8×8光点阵逐点扫描显示装置一、 设计任务要求1. 使用8×8矩阵显示屏设计一个扫描控制电路。2. 光点从屏左上角像素点开始逐点扫描,终止与右下角像素点,然后周而复始的运行下去。3. 扫描一桢所需时间为13S。二、 可选器件EPM130208-2、8X8矩阵显示屏、电阻。三、 设计总体框图8X8发光点阵逐点扫描显示装置总体框图如图2所示。时钟输 入列控制电 路分频电 路行控制电 路8X8矩阵显示屏图2 8X8发光点阵逐点扫描显示装置总体框图四、 参考源程序 library ieee; use ieee.std_logic_1164.all;use ieee.std_logicsigned.all;entity zlx2 isport( clk:in std_logic;q:out std_logic_vector(21 downto0);路输出。T:out std_logic_vector(0to7); 列选通。Y:out std_logic_vector(0to7); 行选通。 Ebd zkx2lArchitecture a of zlx2 is Signal b:std_logic_vector(21downto 0):=”0000000000000000000000”; Signal a:std_logic_vector(0to 2); Signal e:std_logic_vector(0to2); Signal c:std_logic_vector(0to7); Signal d:std_logic_vector(0to7);BeginProcess (clk) 分频电路。Begin If(clkevent and clk =1)then B(21downto 0)<=b(21downto)+1;End if;Q<=b; 输出扫描频率。End process;Process 以下两个进程控制行、列选通线实现点扫描。BeginA(0)<=b(16);A(1)<=b(17);A(2)<=b(18);If a=”000”then c<=”10000000”;Elsif a=”001”then c<=”01000000”;Elsif a=”010”then c<=”00100000”;Elsif a=”011”then c<=”00010000”;Elsif a=”100”then c<=”00001000”;Elseif a=”101”then c<=”00000100”;Elseif a=”110”then c<=”00000010”;Elseif a=”111”then c<=00000001”;End if;Y<=c;End process;ProcessBeginE(0)<=b(19);E(1)<=b(20);E(2)<=b(21);If e=”000”then d<=”01111111”;Elsif e=”001”then d<=”10111111”;Elsif e=”010”then d<=”11011111”;Elsif e=”011”then d<=”11101111”;Elsif e=”100”then d<=”11110111”;Elsif e=”101”then d<=”11111011”;Elsif e=”110”then d<=”11111101”;Elsif e=”111”then d<=”11111110”;End if;T<=d;End process;End a;五、 说明1. 程序主要由分频电路和扫描控制电路组成。2. 扫描控制电路可用3线-8线译码器的设计思路来实现。课题3 彩灯闪烁装置一、 设计任务及要求1. 使用8X8矩阵显示屏设计一个彩灯闪烁装置。2. 第一侦以1个光点为1个像素点从屏左上角开始逐点扫描,终止于右下角。3. 第二侦以2个光点为1个像素从左上角开始逐点扫描,终止于右下角。4. 第三侦重复第一侦,第四侦重复第二侦,周而复始的运行下去。二、 可选器件EPM130208-2、8X8矩阵显示屏、电阻。控制 奇 偶 侦8X8矩阵显示屏三、 设计总体框图时钟输入分频电路列控制电路行控制电路彩灯闪烁装置总体框图如图3所示。图3 彩灯闪烁装置总体框图四、 源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_signed.all;-for+operation.Entity scan2 isPort(cp1:in std_logic;输入时钟20MHZ。 Ho:out std_logic_vector(7downto0);行控制信号。 Vo:out std_logic_vector(7downto0);列控制信号。End scan2;Architecture scanpixel of scan2 isSignal count1:std_logic_vector(2downto0):=”000”;扫描哪一个点的计数器。Signal cuont2:std_logic_vector(3downto0):=”0000”;扫描哪一个行的计数器。Signal v:std_logic_vector(7downto0):=”10000000”;Signal h:std_logic_vector(7downto0):=”10000000”;输出信号.Signal cp2:std_logic;Signal cp:std_logic;Signal cnt:std_logic_vector(15downto0):=”0000000000000000”Signal cnt2:std_logic_vector(5downto0):=”000000”;分频用的计数器。BeginProcess(cp1)Begin If (cp1eventand cp1=1)thenCnt<=cnt+1;End if;Cp2<=cnt(15);End process;Process(cp2)BeginIf(cp2event and cp2=1)thenCnt2<=cnt2+1;End if;Cp<=cnt2+1;End if;Cp<=cnt2(5);End process;Process(cp)Begin If(cpevent and cp=1)thenCase count2(2downto0) is根据count2输出行控制信号。 When”000”=>h<=”10000000”;When”001”=>h<=”01000000”;When”010”=>h<=”00100000”;When”011”=>h<=”00010000”;When”100”=>h<=”00001000”;When”101”=>h<=”00000100”;When”110”=>h<=”00000010”;When”111”=>h<=”00000001”;When others =>h<=”00000000”;End case;If count2<=”0111”then 如果扫描的是前8行,则逐行扫描。 Count1<=count1+1;扫描下一点。 Case count1(2downto0)is 根据count2输出列控制信号。 When “000”=>v<=”01111111”; When ”001”=>v<=”10111111”; When “010”=>v<=”11011111”; When “011”=>v<=”11101111”; When “100”=>v<=”11110111”; When “101”=>v<=”11111011”; When “110”=>v<=”11111101”; When “111”=>v<=”11111110”; When “others =>v<=”11111111”; End case;If count2=”111”then count2<=count2+1;end if;扫描完一行行计数器加1。Else 若扫描的是后8行,则2点到扫描。 If count1=”010”then count1<=”111”;else count1<=count1+1;end if; 使count1清零,准备下次循环。 Case count1(1downto0)is根据count1输出列控制信号。When”00”=>v<=”00111111”;When”01”=>v<=”11001111”;When”10”=>v<=”11110011”;When”11”=>v<=”11111100”;When others =>v<=”11111111”;End case;If count1(1downto0)=”11”then count2<=count2+1;end if;扫描完一行,行计数器加1。End if;End if;Ho<=h;Vo<=v;End process;End scanpixel;五、 程序说明 此程序主要由分频电路,行,列控制电路组成。 课题4 抢答器一、 设计任务及要求 设计2人抢答器。要求如下:1. 两人抢答,先抢为有效,用发光二极管显示是否抢到优先答题权。2. 每人2为计分显示,答错了不加分,答对了可加10、20、30分。3. 每题结束后,裁判按复位,可重新抢答下一题。4. 累计加分可由裁判随时清零。二、 可选器件EPM130208-2、共阴极七段数码管,按键开关、电阻、电容。三、 设计总体框图抢答器总体框图如图4所示。显示抢答指示灯加分电路抢答者1输入抢答者2输入显示加分结 果裁判复位重新抢答裁判加 分抢 答判 断裁判清 零 图4 抢答器总体框四、 源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_signed.all;entity qb isport(i1,i2:in bit;抢答器两输入端。 Reset: in bit;抢答器复位端。G10,g10,g30:in bit;加分输入端10分、20分、30分。Light1,light2:out bit:=0;抢答标志灯。Tll:out std_logic_vector(6downto0):=”0111111”;“tl1、tl2”,显示第一个人得分。Tl2:out std_logic_vector(6downto0):=”0111111”;T21:out std_logic_vector(6downto0):=”0111111”;“t21t22”显示第二个人得分。Clk:in bit;时钟输入端。Cong:in bit 清零控制端。); end qb;architecture stru of qb issignal cs1:integer range0to9;sitgnal cs2:integer range 0to9:signal a,b:bit:=0;signall1,l2:bit:=0;begin process(clk)beginif clkevent and clk =1 thenif(cong=1)thenif(reset=1)thenif(i1=0and a=0)then l1<=1;a<=1;抢答。Elsif (i2=”0and a=0) then l2<=1; a<=1;End if; If(g10=0and l1=1and b=0)then cs1<=cs1+1;b<=1;Elsif(g20=0and l1=1and b=0)then cs1<=cs1+2;b<=1;Elsif(g30=0and l1=1and b=0)then cs1<=cs1+2;b<=1; End if 完成第一人的加分。 If(cs1=0)then tl1<=”0111111”;显示。 Elsif (cs1=1)then t11<=”0000110”; Elsif (cs1=2)then t11<=”1011011”; Elsif (cs1=3)then t11<=”100111”;Elsif (cs1=4)then t11<=”1100110”;Elsif (cs1=5)then t11<=”1101101”;Elsif(cs1=6)then t11<=”1111101”;Elsif (cs1=7)then t11<=”0000111”;Elsif (cs1=8)then t11<=”1111111”;Elsif (cs1=9)then t11<=”1101111”;End if;If (cs20)then t21<=”0111111”;Elsif (cs2=1)then t21<=”0000110”;Elsif(cs2=2)then t21<=”1011011”;Elsif(cs2=3)then t21<=”1001111”;Elsif(cs2=4)then t21<=”1100110”;Elsif(cs2=5)then t21<=”1101101”;Elsif(cs2=6)then t21<=”1111101”;Elsif(cs2=7)then t21<=”0000111”;Elsif(cs2=8)then t21<=”1111111”;Elsif(cs2=9)then t21<=”1101111”;end if;Else l1<=0;l2<=0;a<=0;b<=0;End if;Elde cs1<=0;cs2<=0;l1<=0;l2<=0;end if;end process;end stru;五、 程序说明1. 此程序由3部分组成,即抢答、加分、显示。2. 当一人抢到优先答题权,发光二极管亮,另一人再按按键无效。答题结束后,裁判按复位键,可再次抢答。3. 每人有两个数码管显示累加计分情况,分数分为3档,用按键来区别。课题5 密码锁一、 设计任务及要求设计一个两位的密码锁,要求如下:1. 开锁代码为2位十进制并行码。2. 当输入的密码与锁内的密码一致时,绿灯亮,开锁;当输入的密码与锁内的密码不一致时,红灯亮,不能开锁。3. 密码可由用户自行设置。二、 可选器件EPM130208-2、共阴极七段数码管、发光二极管、按键开关、电阻、电容。三、 设计总体框图密码锁总体框图如图5所示CCN密 码检 测数 据输 入译 码显 示数 据寄 存密 码存储仪判 断开 锁指 示 灯指 示 灯 图5 密码锁总体框图四、 源程序 library ieee; use ieee.std_logic_signed.all;entity lock isport(a:in std_logic_vector(9downto0);十位输入端。 B:in std_logic_vector(9downto0);个位输入端。En,clk:in std_logic;en为密码确认开关。 En1:in std_logic;en1为密码检验开关。C,d:out std_logic_vector(6downto0):=”0111111”;输出七段数码管的控制。K,m:out std_logic);K为绿灯,M为红灯。End lock;Architecture behave of lock isSignal e:std_logic_vector(3downto0);Signal f: std_logic_vector (3downto0);Signal g:std_logic_vector(3downto0);Signal h:std_logic_vector(3downto0);Signal count1,count2,:std_logic:=0Signal s:std_logic:=0;Begin If (a(9downto0)=”0000000000”)Then c(6downto0)<=”0111111”;Elsif (a(1)=1) thenE<=”0000”;c(6downto0)<=”0111111”;Elsif(a(1)=1)thenE<=”0001”;c(6downto0)<=”0000110”;Elsif(a(2)=1)thenE<=”0010”;c(6downto0)<=”1011011”;Elsif(a(3)=1)thenE<=”0011”;c(6downto0)<=”1001111”;Elsif (a(4)=1) thenE<=”0100”;c(6downto0)<=”1100110”;Elsif (a(5)=1) thenE<=”0101”;c(6downto0)<=”1101101”;Elsif(a(6)=1) thenE<=”0110”;c(6downto0)<=”1111100”;Elsif(a(7)=1) thenE<=”0111”;c(6downto0)<=”0000111”;Elsif(a(8)=1) thenE<=”1000”;c(6downto0)<=”1111111”;Elsif(a(9)=1) thenE<=”1001”;c(6downto0)<=”1100111”;End if;End process;Process(b,f)个位的数据转换。BeginIf(b(9downto0)=”00000000000” thenD(6downto0)<=”0111111”;Elsif(b(0)=1) thenF<=”0000”;d(6downto0)<=”0111111”;Elsif(b(1)=1)thenF<=”0001”;d(6downto0)<=0000100”;Elsif(b(2)=1;thenF<=”0010”;d(6downto0)<=”1011011”;Elsif(b(3)=1) thenF<=”0011”;d(6downto0)<=”1001111”;Elsif(b(4)=1) thenF<=”0100”;d(6downto0)<=”1100110”;Elsif(b(5)=1) thenF<=”0101”;d(6downto0)<=”1101101”;Elsif(b(6)=1) thenF<=”0110”; d(downto0)<=”1111100”;Elsif(b(7)=1)thenF<=”0111”;d(6downto0)<=”0000111”;Elsif(b(8)=1) thenF<=”1000”;d(6downto0)<=”1111111”;Elsif(b(9)=1) thenF<=”1001”;d(6downto0)<=”1100111”;End if;End process;Process(clk)判断密码是否正确,可否开锁。BeginIf(s=1)and(en=1)and(count=0) thenG(3downto0)<=e(3downto0);H(3downto0)<=F(3downto0);Count1<=not(count1);End if;If(en1=1)and(count2=0) thenIf(e(3downto0)=g(3downto0)andf(3downto0)=h(3downto0) thenK<=1;S<=1;ElseK<=0;M<=1;End if;If (en=0)and(en1=0) thenCount1<=0;Count2<=0;K<=0;s<=0;m<=0;End if;If(en=0 and s=1) thenCount1<=0;End if;End process;End behave;五、 程序说明1. 此程序由解码、译码、数码管显示部分组成。2. 此程序是一个并行密码锁,用户开锁密码为00。当使用开锁密码后,指示灯亮(绿灯),表示锁被打开。用户可自行设置密码。用户可用2个DIP开关(110)设置099的2位十进制数密码。 课题6 数字频率计一、 设计任务及要求设计一个4位十进制数字显示的数字式频率计。要求如下:1 4位十进制数字显示的数字显示的数字式频率计,其频率测量范围为109999kHZ,测量单位为kHZ。2 要求量程能够自动转换。(即测几十到几百千赫兹(kHZ)时,有小数点显示,前者显示小数点后两位,后者显示小数点后一位。)3 当输入的信号小于10kHZ时,输出显示全0;当输入的信号大于9999kHZ时,输出显示全H。二、 可选器件EPM130208-2、共阴极七段数码管、按键开关、电阻、电容。三、 设计总体框图数字频率计总体框图如图6所示。复位译码显 示复位被测信号计数电路锁存器时分复用时钟输 入分频电 路图6 数字频率计总体框图四、 源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_signed.all;entity total isport (cp_20m:in std_logic; enable:in std_logic; input:in std_logic; reset:in std_logic; sel:out std_logic_vector( 3 downto 0); show:out

    注意事项

    本文(《电子设计自动化技术》EDA实训指导书 .doc)为本站会员(来看看)主动上传,三一文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一文库(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    经营许可证编号:宁ICP备18001539号-1

    三一文库
    收起
    展开