




免费预览已结束,剩余4页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
南昌大学实验报告学生姓名: 严文婧 学 号: 6100207254 专业班级: 电子073班 实验类型: 验证 综合 设计 创新 实验日期: 2009.11.12 实验成绩: 实验四 多功能数字钟设计一、 实验目的1、学习复杂数字电路系统的设计。2、设计一个多功能数字钟。二、实验要求1.数字显示当前的小时、分钟;2.可以预置为12小时计时显示和24小时计时显示;3.一个调节键,用于调节目标数位的数字。对调节的内容敏感,如调节分钟或秒时,保持按下时自动计数,否则以脉冲计数;4.一个功能键,用于切换不同状态:计时、调时、调分、调秒、调小时制式。三、实验仪器PC机、Quartus II软件、EDA实验箱四、实验原理1.系统需要两个六十进制计数器用于分钟和秒的计时,为方便译码采用10进制计数加6进制计数的方式;1)CLK是时钟信号,RESET是复位信号,SETMIN为分钟设置信号,ENMIN作为下一模块分钟设计的时钟信号,DAOUT输出信号最后接在动态译管码芯片上,得出实验要求的秒显示: 2)CLK接秒模块中的ENMIN信号,RESET同样是复位信号,ENHOUR作为下一模块小时(12与24)的时钟信号,DAOUT输出信号最后接在动态译码管芯片上.得出实验要求得分钟显示: 2.系统需要一个模12、模24和一个二选一数据选择器来实现12和24的切换,复位键无效后,模12和模24计数器同时计数,模12和模24由同一个分钟的进位作为输入,由数据选择器选择模12或模24输出,到数码管显示。 3.数码管的动态扫描需要一个将八位的输入转化为四位的输出,还有一个三位的输出,用来作为动态数码管选择器的输入。 4.用一个顶层文件将各个模块连接,构成一个完整的工程,实现数字钟。五、实验步骤1. 各模块程序:1)用文本输入法实现秒的计时,程序如下: LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;ENTITY SECOND ISPORT ( CLK : IN STD_LOGIC; RESET : IN STD_LOGIC; SETMIN : IN STD_LOGIC; ENMIN : OUT STD_LOGIC; DAOUT : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);END ENTITY SECOND;ARCHITECTURE ART OF SECOND IS SIGNAL COUNT : STD_LOGIC_VECTOR(7 DOWNTO 0); SIGNAL ENMIN_1,ENMIN_2 : STD_LOGIC; BEGIN DAOUT=COUNT; ENMIN_2=(SETMIN AND CLK); ENMIN=(ENMIN_1 OR ENMIN_2); PROCESS(CLK,RESET,SETMIN) BEGIN IF(RESET=0)THEN COUNT=00000000; ENMIN_1=0; ELSIF(CLKEVENT AND CLK=1)THEN IF(COUNT(3 DOWNTO 0)=1001)THEN IF(COUNT16#60#)THEN IF(COUNT=01011001)THEN ENMIN_1=1;COUNT=00000000; ELSE COUNT=COUNT + 7; END IF; ELSE COUNT=00000000; END IF; ELSIF(COUNT16#60#)THEN COUNT=COUNT + 1; ENMIN_1=0; ELSE COUNT=00000000;ENMIN_1=0; END IF; END IF; END PROCESS;END ART;2)用文本输入法实现分的计时,程序如下: LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;ENTITY MINUTE ISPORT ( CLK : IN STD_LOGIC; CLKS : IN STD_LOGIC; RESET : IN STD_LOGIC; SETHOUR : IN STD_LOGIC; ENHOUR : OUT STD_LOGIC; DAOUT : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);END ENTITY MINUTE;ARCHITECTURE ART OF MINUTE IS SIGNAL COUNT : STD_LOGIC_VECTOR(7 DOWNTO 0); SIGNAL ENHOUR_1,ENHOUR_2 : STD_LOGIC; BEGIN DAOUT=COUNT; ENHOUR_2=(SETHOUR AND CLKS); ENHOUR=(ENHOUR_1 OR ENHOUR_2); PROCESS(CLK,RESET,SETHOUR) BEGIN IF(RESET=0)THEN COUNT=00000000; ENHOUR_1=0; ELSIF(CLKEVENT AND CLK=1)THEN IF(COUNT(3 DOWNTO 0)=1001)THEN IF(COUNT16#60#)THEN IF(COUNT=01011001)THEN ENHOUR_1=1; COUNT=00000000; ELSE COUNT=COUNT + 7; ENHOUR_1=0; END IF; ELSE COUNT=00000000; END IF; ELSIF(COUNT16#60#)THEN COUNT=COUNT + 1; ENHOUR_1=0AFTER 100 NS; ELSE COUNT=00000000;ENHOUR_1=0; END IF; END IF; END PROCESS;END ART;3)用文本输入法实现小时的计时,程序如下: a.模12程序: LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;ENTITY HOUR_12 ISPORT ( CLK : IN STD_LOGIC; RESET : IN STD_LOGIC; DAOUT : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);END ENTITY HOUR_12;ARCHITECTURE ART OF HOUR_12 IS SIGNAL COUNT : STD_LOGIC_VECTOR(7 DOWNTO 0); BEGIN DAOUT=COUNT; PROCESS(CLK,RESET) BEGIN IF(RESET=0)THEN COUNT=00000000; ELSIF(CLKEVENT AND CLK=1)THEN IF(COUNT(3 DOWNTO 0)=1001)THEN IF(COUNT16#11#)THEN COUNT=COUNT + 7; ELSE COUNT=00000000; END IF; ELSIF(COUNT16#11#)THEN COUNT=COUNT + 1; ELSE COUNT=00000000; END IF; END IF; END PROCESS;END ART;b.模24程序: LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;ENTITY HOUR ISPORT ( CLK : IN STD_LOGIC; RESET : IN STD_LOGIC; DAOUT : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);END ENTITY HOUR;ARCHITECTURE ART OF HOUR IS SIGNAL COUNT : STD_LOGIC_VECTOR(7 DOWNTO 0); BEGIN DAOUT=COUNT; PROCESS(CLK,RESET) BEGIN IF(RESET=0)THEN COUNT=00000000; ELSIF(CLKEVENT AND CLK=1)THEN IF(COUNT(3 DOWNTO 0)=1001)THEN IF(COUNT16#23#)THEN COUNT=COUNT + 7; ELSE COUNT=00000000; END IF; ELSIF(COUNT16#23#)THEN COUNT=COUNT + 1; ELSE COUNT=00000000; END IF; END IF; END PROCESS;END ART;4)用文本输入法实现二选一选择器,程序如下: LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;ENTITY MUX21A ISPORT ( ain : IN STD_LOGIC_VECTOR(7 DOWNTO 0); bin : IN STD_LOGIC_VECTOR(7 DOWNTO 0); set : IN STD_LOGIC; y : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);END ENTITY MUX21A;ARCHITECTURE ART OF MUX21A IS BEGIN y=ain WHEN set = 0 ELSE bin; END ARCHITECTURE ART;5)数码管动态扫描显示所需程序: LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;USE IEEE.STD_LOGIC_ARITH.ALL;ENTITY SETTIME ISPORT ( CLK1 : IN STD_LOGIC; RESET : IN STD_LOGIC; SEC,MIN : IN STD_LOGIC_VECTOR(7 DOWNTO 0); HOUR : IN STD_LOGIC_VECTOR(7 DOWNTO 0); DAOUT : OUT STD_LOGIC_VECTOR(3 DOWNTO 0); DP : OUT STD_LOGIC; SEL : OUT STD_LOGIC_VECTOR(2 DOWNTO 0);END SETTIME;ARCHITECTURE ART OF SETTIME IS SIGNAL COUNT : STD_LOGIC_VECTOR(2 DOWNTO 0); BEGIN PROCESS(CLK1,RESET) BEGIN IF(RESET=0)THEN COUNT=101)THEN COUNT=000; ELSE COUNT=COUNT + 1; END IF; END IF; END PROCESS; PROCESS(CLK1,RESET) BEGIN IF(RESET=0)THEN DAOUT=0000; DP=0; SELDAOUT=SEC(3 DOWNTO 0); DP=0; SELDAOUT=SEC(7 DOWNTO 4); DP=0; SELDAOUT=MIN(3 DOWNTO 0); DP=1; SELDAOUT=MIN(7 DOWNTO 4); DP=0; SELDAOUT=HOUR(3 DOWNTO 0); DP=1; SELDAOUT=HOUR(7 DOWNTO 4); DP=0; SELDAOUT=0000; DP=0; SEL=111; END CASE; END IF; END PROCESS; END ART;2. 建立工作库文件夹,输入设计项目原理图或VHDL代码并存盘。3.将以上模块生成元器件。4.建立新的工程,将各个模块的元器件用原理图连接,进行编译。5.进行波形仿真,仿真后波形如下: 6.进行引脚绑定,如下: 7.进行下载,在实验箱上验证.六、实验结果与现象验证CLK给一个1KHZ,CLK1给2HZ,按下RESET,6个动态数码管从000000开始计数,再按SETMIN进行调分,按SETHOUR进行调时,按SET进行模24和模12的切换,最后都得到了预期的结果,验证了实验成功。七、实验小结 1、学会复杂数字电路系统的设计:对一般复杂的电路系统可以分模块设计,这样可以使设计简单明了 2、引脚绑定要和试验箱上的各个键对上号,在操作试验箱时才不会出错. 3、学会了数码管动态扫描电路的设计。English is the most widely spoken language in the history of our planet, used in some way by at least one out of every seven human beings around the globe. Half of the worlds books are written in English, and the majority of international telephone calls are made in English. English is the language of over sixty percent of the worlds radio programs. More than seventy percent of international mail is written and addressed in English, and eighty percent of all computer text is stored in English. English has acquired the largest vocabulary of all the worlds languages, perhaps as many as two million words, and has generated one of the noblest bodies of literature in the annals of the human it is now time to face the fact that English is a crazy language - the most lunatic and loopy and of all languages. In the crazy English language, the blackbird hen is brown, blackboards can be green or blue, and blackberries are green and then red before they are ripe. Even if blackberries were really black and blueberries really blue, what are strawberries, cranberries, huckleberries, raspberries, and gooseberries supposed to look add to this insanity there is no butter in buttermilk, no egg in eggplant, no grape in grapefruit, no bread in shortbread, neither worms nor wood in wormwood, neither mush nor room in mushroom, neither pine nor apple in pineapple, neither peas nor nuts in peanuts, and no ham in a hamburger. (In fact, if somebody invented a sandwich consisting of a ham patty in a bun, we would have a hard time finding a name for it.)To make matters worse, English muffins werent invented in England, fries in France, or Danish pastries in Denmark. And we discover even more culinary madness in the that sweetmeat is made from fruit, while sweetbread, which isnt sweet, is made from this unreliable English tongue, greyhounds arent always grey (or gray); panda bears and koala bears arent bears (theyre marsupials); a woodchuck is a groundhog, which is not a hog; a horned toad is a lizard; glowworms are fireflies, but fireflies are not flies (theyre beetles); ladybugs and lightning bugs are also beetles (and to, a significant proportion of ladybugs must be male); a guinea pig is neither a pig nor from Guinea (its a South American rodent); and a titmouse is neither is like the air we breathe. Its invisible, inescapable, indispensable, and we take it for granted. But, when we take the time to step back and listen to the sounds that escape from the holes in peoples faces and to ex- the paradoxes and vagaries of English, we find that hot dogs can be cold, darkrooms can be lit, homework can be done in school, nightmares can take place in broad daylight while morning sickness and daydreaming can take place at night, tomboys are girls and midwives can be men, hours - especially happy hours and rush hours - often last longer than sixty minutes, quick- sand works very slowly, boxing rings are square, silverware and glasses can be made of plastic and tablecloths of paper, most are dialed by being punched (or pushed?), and most bathrooms dont have any baths in them. In fact, a dog can go to the bathroom under a tree - no bath, no room; its still going to the bathroom. And doesnt it seem a little bizarre that we go to the bathroom in order to go to the is it that a woman can man a station but as man cant woman one, that a man can father a movement but a woman cant mother one, and that a king rules a kingdom but a queen doesnt rule a? How did all those Renaissance men reproduce when there dont seem to have been any Renaissance writer is someone who writes, and a stinger is something that stings. But fingers dont grocers dont, haberdashers dont, hammers dont ham, and humdingers dont the plural of tooth is teeth , shouldnt the plural of booth be ? One goose, two geese - so one moose, two One index, two indices - one Kleenex, two If people ring a bell today and rang a bell yesterday, why dont we say that they a ball? If they wrote a letter, perhaps they also their tongue. If the teacher taught, why isnt it also true that the preacher? Why is it that the sun shone yesterday while I shined my shoes, that I treaded water and then trod on the beach, and that I flew out to see a World Series game in which my favorite player flied we conceive a conception and receive at a reception, why dont we grieve a and believe a? If a horsehair mat is made from the hair of horses and a camels hair brush from the hair of camels, from what is a mohair coat made? If adults commit adultery, do infants commit infantry? If olive oil is made from olives, what do they make baby oil from? If a vegetarian eats vegetables, what does a humanitarian eat? (And Im beginning to worry about those authoritarians.)And if pro and con are opposites, is congress the opposite of you have to believe that all English speakers should be committed to an asylum for the verbally insane. In what other language do people drive in a parkway and park in a driveway? In what other language do people recite at a play and play at a recital? In what other language do privates eat in the general mess and generals eat in the private mess? In what other language do people ship by truck and send cargo by ship? In what other language can your nose run and your feet can a slim chance and a fat chance be the same and a bad licking and a good licking be the same, while a wise man and a wise guy are opposites? How can sharp speech and blunt speech be the same and quite a lot and quite a few the same, while overlook and oversee are opposites? How can the weather be hot as hell one day and cold as hell the next? How can the expressions Whats going on? and Whats coming off? mean exactly the samton and unbutton and tie and untie are opposites, why are loosen and unloosen and ravel and unravel he same? If bad is the opposite of good, hard the opposite of soft, and up the opposite of down, why are badly and goodly, hardly and softy, and upright and downright not opposing pairs? If harmless actions are the opposite of harmful why are shameful and shameless behavior the same and pricey objects less expensive than priceless appropriate and inappropriate remarks and passable and impassable mountain trails are opposites, why are flammable and inflammable materials, heritable and inheritable property, and
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 环卫工人劳动合同协议书
- 烧烤承包或转让合同范本
- 龙海人才市场就业协议书
- 消费赔偿保密协议书范本
- 销售立式镗铣床合同范本
- 球馆承包合同协议书范本
- 锤子直播带货协议合同书
- 米线店的加盟合同协议书
- 硅酸泥水泥采购合同范本
- 淮安机械工程监理协议书
- 中医护理常用腧穴课件
- 2025年营养指导员理论考试复习题库(含答案)
- GB/T 12706.1-2020额定电压1 kV(Um=1.2 kV)到35 kV(Um=40.5 kV)挤包绝缘电力电缆及附件第1部分:额定电压1 kV(Um=1.2 kV)和3 kV(Um=3.6 kV)电缆
- 新版有创血压监测ABP培训课件
- 重症医学科常用知情告知书
- 防溺水、防性侵、防欺凌安全教育家长会
- DB11-T1322-14-2017安全生产等级评定技术规范第14部分:汽车制造企业
- 养老机构安全检查表
- 企业员工上下班交通安全培训(简详共2份)
- 小区物业服务收支情况公示
- 统编版小学语文二升三衔接专项训练—看图写话(二)【含答案】
评论
0/150
提交评论