



版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、国家开放大学年秋季学期电大考试数字电子技术基础大作业1 数 字 电 子 技 术 基 础 大 作 业 业 课程名称: 数字电子技术基础 设计题目: 血型与状态机 院 系: 班 级: 设 计 者: 学 号: 血型逻辑电路设计 一 实验目的 1. 掌握采用可编程逻辑器件实现数字电路与系统的方法。 2. 掌握采用 xilinx_ise 软件开发可编程逻辑器件的过程。 3. 学会设计血型能否输血的数字电路。 4. 掌握 verilog hdl 描述数字逻辑电路与系统的方法。 二 设计要求 1. 采用 basys2 开发板开关,led,数码管等制作验证能否输血的电路。 2. 采用 xilinx_ise 软
2、件进行编程、仿真与下载设计到 basys2 开发板。 三 电路图 1. 电路模块图(简化) 应用: 2. 内部电路组成(简化) 四 编程 1.源程序 module xuexing(m, n, p, q, e,f,g,out,ctl,clk,bi); input m; input n; input p; input q; input clk; output e; output3:0 f; output3:0 g; output7:0 out; output3:0 ctl; reg e; reg3:0 f; reg3:0 g; reg7:0 out; reg7:0 out1; reg7:0 out
3、2; reg7:0 out3; reg7:0 out4; reg3:0 ctl=4"b1110; output bi; reg bi; integer clk_cnt; reg clk_400hz; always (posedge clk) /400hz 扫描信号 if(clk_cnt=32"d100000) begin clk_cnt = 1"b0; clk_400hz = clk_400hz; end else clk_cnt = clk_cnt + 1"b1; /位控制 reg clk_1hz; integer clk_1hz_cnt; /1hz
4、发声信号 always (posedge clk) if(clk_1hz_cnt=32"d25000000-1) begin clk_1hz_cnt = 1"b0; clk_1hz = clk_1hz; end else clk_1hz_cnt = clk_1hz_cnt + 1"b1; always (posedge clk_400hz) ctl = ctl2:0,ctl3; /段控制 always (ctl) case(ctl) 4"b0111: out=out1; 4"b1011: out=out2; 4"b1101: out=
5、out3; 4"b1110: out=out4; default:out=4"hf; endcase always (m or n or p or q) begin e=(pq)|(mn)|(mq)|(np); /选择能否输血 case(e) 1: begin out1=8"b10001001; out2=8"b01100001; out3=8"b01001001; out4=8"b11111111; bi=clk_400hz; end 0: begin out1=8"b00010011; out2=8"b0000
6、0011; out3=8"b11111111; out4=8"b11111111; bi=clk_1hz; end endcase end always (m or n or p or q) /显示输入输出血型 begin if(m=1n=0) f=4"b1000; else if(m=0n=1) f=4"b0100; else if(m=1n=1) f=4"b0010; else f=4"b0001; end always (m or n or p or q) /显示输入输出血型 begin if(p=1q=0) g=4"
7、b1000; else if(p=0q=1) g=4"b0100; else if(p=1q=1) g=4"b0010; else g=4"b0001; end endmodule 2.管脚定义程序 net m loc=n3; net n loc=e2; net p loc=l3; net q loc=p11; net e loc=b2; net out7 loc = l14; net out6 loc = h12; net out5 loc = n14; net out4 loc = n11; net out3 loc = p12; net out2 loc =
8、 l13; net out1 loc = m12; net out0 loc = n13; net ctl3 loc = k14; net ctl2 loc = m13; net ctl1 loc = j12; net ctl0 loc = f12; net clk loc=b8; net f3 loc=g1; net f2 loc=p4; net f1 loc=n4; net f0 loc=n5; net g3 loc=p6; net g2 loc=p7; net g1 loc=m11; net g0 loc=m5; net bi loc=b6; 五 仿真图 六 下载设计到 2 basys2
9、 开发板与实物图 实物图: 附:程序流程: 1. 基本电路设计 用 mn 表示输入血型,pq 表示受血者血型其中 10 表示 a 型,01 表示 b 型,11 表示 ab 型,00表示 o 型。用 e 表示能否输血,1 表示能,0 表示不能。 m n n p p q q e e m n n p p q q e e 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 0 0 1 0 1 1 0 1 0 1 0 0 0 1 1 1 1 0 1 1 1 0 0 1 0 0 0 1 1 0 0 0 0 0 1 0 1 1 1 1 0 1 0 0 0 1 1 0
10、0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 则卡诺图为: mn pq 00 01 11 10 00 1 0 0 0 01 1 1 0 0 11 1 1 1 1 10 1 0 0 1 表达式为: e pq mn mq np = + + + 则设计一个四输入一输出的电路 其逻辑电路图为 mnpqe 通过此电路图,编写程序,把输入引脚定位到开关上,把输出引脚定位到一个 led 上便可以完成设计任务。 2. 项目创新 (1)仅使用一个 led 的亮与灭来表示能否输血效果不明显,为了加入一个更明显显示能否输血的指示,所以就用到了 basys2 板子上自带的数码管,使其在能够输血时
11、显示 yes,不能输血时显示no。 观察硬件电路图发现,数码管只由一个片选端控制,所有如果使数码管显示不同字母,则需要利用人类的视觉暂留效应进行循环扫描,来使数码管来显示不同的信息。 (2)为了增强能否输血的提示效果,所以加入一个蜂鸣器,用声音提示能否输血。当系统开启切能输血时,蜂鸣器输出一低音震荡,当不能输血时,蜂鸣器输出高音报警,提示不能输血。 (3)在加入蜂鸣器报警与数码管之后,使用 led 来表示能否输血已经多余,而且别人无法判断输血与受血分别是什么血型,所以把 8 个 led 分成两组,其中第一组表示输血血型,第二组表示受血血型,第一个灯表示 a 型,第二个灯表示 b 型,第三个灯表
12、示 ab 型,最后一个灯表示 o 型。 时序逻辑电路设计 一 实验目的 1.掌握采用可编程逻辑器件实现数字电路与系统的方法。 2.掌握采用 xilinx_ise 软件开发可编程逻辑器件的过程。 3.学会设计状态机时序逻辑电路。 4.掌握 verilog hdl 描述数字逻辑电路与系统的方法。 二 设计要求 1.采用 basys2 开发板开关,led,数码管等制作验证能否输血的电路。 2.采用 xilinx_ise 软件进行编程、仿真与下载设计到 basys2 开发板。 三 电路图 1.电路模块图 2.内部电路组成 四 编程 1.源程序 module shixu(clk,op,din,b,c,d
13、,e,f,g,h,i,bi,out,ctl); input clk; input din; output bi,op; output7:0 out; output3:0 ctl; output b,c,d,e,f,g,h,i; reg7:0 out; reg7:0 out1; reg7:0 out2; reg7:0 out3; reg7:0 out4; reg3:0 ctl=4"b1110; reg b,c,d,e,f,g,h,i; reg1:0 current_state,next_state; reg op,bi; parameter s0=2"b00,s1=2&quo
14、t;b01,s2=2"b10,s3=2"b11; reg clk_1hz,clk_400hz; integer clk_1hz_cnt,clk_cnt; always (posedge clk) if(clk_1hz_cnt=32"d25000000-1) begin clk_1hz_cnt = 1"b0; clk_1hz = clk_1hz; end else clk_1hz_cnt = clk_1hz_cnt + 1"b1; always (posedge clk) if(clk_cnt=32"d100000) begin clk
15、_cnt = 1"b0; clk_400hz = clk_400hz; end else clk_cnt = clk_cnt + 1"b1; reg clk_05hz; integer clk_05hz_cnt; always (posedge clk) if(clk_05hz_cnt=32"d50000000-1) begin clk_05hz_cnt = 1"b0; clk_05hz = clk_05hz; end else clk_05hz_cnt = clk_05hz_cnt + 1"b1; reg clk_2hz; integer c
16、lk_2hz_cnt; always (posedge clk) if(clk_2hz_cnt=32"d12500000-1) begin clk_2hz_cnt = 1"b0; clk_2hz = clk_2hz; end else clk_2hz_cnt = clk_2hz_cnt + 1"b1; reg clk_4hz; integer clk_4hz_cnt; always (posedge clk) if(clk_4hz_cnt=32"d6250000-1) begin clk_4hz_cnt = 1"b0; clk_4hz = cl
17、k_4hz; end else clk_4hz_cnt = clk_4hz_cnt + 1"b1; reg clk_40hz; integer clk_40hz_cnt; always (posedge clk) if(clk_40hz_cnt=32"d1250000-1) begin clk_40hz_cnt = 1"b0; clk_40hz = clk_40hz; end else clk_40hz_cnt = clk_40hz_cnt + 1"b1; always (posedge clk_400hz) ctl = ctl2:0,ctl3; alw
18、ays (posedge clk_05hz) begin current_state=next_state; end always (ctl) case(ctl) 4"b0111: out=out1; 4"b1011: out=out2; 4"b1101: out=out3; 4"b1110: out=out4; default:out=4"hf; endcase always (current_state or din) begin case(current_state) s0: begin op=0; b=1;c=1;d=0;e=0; f=
19、0;g=0;h=0;i=0; out1=8"b01001001; out2=8"b00000011; out3=8"b11111111; out4=8"b00000011; bi=clk_1hz; if(din=0) next_state=s0; else next_state=s1; end s1: begin op=0; b=0;c=0;d=1;e=1; f=0;g=0;h=0;i=0; out1=8"b01001001; out2=8"b10011111; out3=8"b11111111; out4=8"b
20、00000011; bi=clk_2hz; if(din=0) next_state=s0; else next_state=s2; end s2: begin op=0; b=0;c=0;d=0;e=0; f=1;g=1;h=0;i=0; out1=8"b01001001; out2=8"b00100101; out3=8"b11111111; out4=8"b00000011; bi=clk_4hz; if(din=0) next_state=s0; else next_state=s3; end s3: begin op=1; b=0;c=0;d=
21、0;e=0; f=0;g=0;h=1;i=1; out1=8"b01001001; out2=8"b00001101; out3=8"b11111111; out4=8"b10011111; bi=clk_40hz; if(din=0) begin next_state=s0; end else next_state=s3; end default: begin op=0; b=1;c=1;d=0;e=0; f=0;g=0;h=0;i=0; next_state=s0; end endcase end endmodule 2.管脚定义程序 net din
22、 loc=n3; net op loc=c6; net b loc=g1; net c loc=p4; net d loc=n4; net e loc=n5; net f loc=p6; net g loc=p7; net h loc=m11; net i loc=m5; net clk loc=b8; net bi loc=b6; net out7 loc = l14; net out6 loc = h12; net out5 loc = n14; net out4 loc = n11; net out3 loc = p12; net out2 loc = l13; net out1 loc
23、 = m12; net out0 loc = n13; net ctl3 loc = k14; net ctl2 loc = m13; net ctl1 loc = j12; net ctl0 loc = f12; 五 仿真图 六 下载设计到 ba2 sys2 开发板与实物图 实物图: 附:为了更好的说明各状态,我对蜂鸣器加入了不同的发声频率区分。 七 实验结论 经实验验证,此程序可以完成预期要求,完成特定任务。 八 心得体会 本次大作业让我熟悉了开发板的使用与可编程逻辑器件的应用, 我了解了如何设计开发一个 a fpga 逻辑电路的流程,我以后懂得了可以使用 a fpga 来完成以后的一些工
24、作,对我有很大的帮助。 电大开放专科英语 i( 1) 试点机考题库 选词填句子(choose the correct answers) 1this is where you work ,xiaoyan ,that is your desk and this is _ 选(b)mine 2john: paul,this is mr smith ,my landlord. paul: im pleased to meet you mr smith:_ 选(b)very pleased to meet you .too 3a: what does your mother do? b:_ 选(c)sh
25、e is a clerk in a bank 4a: could you ring them up please?imsometimes quite nervous on the phone. b:_ 选(c)yes of course .i will phone them for you 5david is _only accountant in my sons company 选(a)the 6 i usually get up _7 oclock _the morning 选(b)at ,in 7she_the flat advertisement. 选(a)has a problem
26、with 8_would you like,tea or coffice? 选(c)what 9why is she _lunch so early?its only 10 now 选(a)having 10i am planning a new marketing compaign at the moment_? 选(c)what are you doing 11whats_job?are_british? 选(c)your, you 12a: hello,xiaoyan ,how are you?and how are things? b:_everybody is very nice a
27、nd helpful. 选(c)great.l am fine 13a;_? b:she is talking to mary 选(a)what is she doing right now 14 a: the shower isnt working. b:_ 选(b)ill call the plumber 15i am_engineer 选(b)an 16this is his book could you give it _him? 选(a)to 17does david_? 选(a)like flying 18a: what tv programmes do you like? b:i
28、_london lives. 选(a)like watching 19there_three plants in the office 选(a)are 20my uncle_in the it department.but now he_on a plan for the marketing department 选(a)works. is working 21a_? b: my father is a manager. my mother is a nurse. 选(b)what do your parents do 22mr manning_in paris today and tomor
29、row. 选(c)is working 23_name is jane _is from the usa. 选(a)her ,she 24 a:_? b: yes,id like to .thanks 选 (b) would you like to come to the shop one 25my mother is a doctor .she is _medicine. 选(c)in 26polly enjoys_in a band in her frem time. 选(c)playing the guitar 27a: _you like a drink?wine?beer? 选(b)
30、would 28a: _? b: yes,i do , my mother and father live in oxford. 选(a)do you have any family 29i_ this e-mail to tell you about my new office. 选(a)am writing 30we often have_supper at home 选(c)our 31a; - b: hi my names rose.are you from london? 选(a)hello. im paul. whats your 32a; what does your fathe
31、r do? b: _ 选(a)he is responsible for the central computer system 33a: where is david? b: hi is having lunch in_ chinese restaurant on_seventh floor 选(c)the .the 34i sometimes go to the pub_ friday _ my colleagues. 选(a)on, with 35my aunt_ for her friends at home 选(c)enjoys cooking 36a:_ polly? b: id
32、like a glass of wine ,thank you. 选(b)what would you like 37_a coffee machine in the room 选(b)is therlondon? 选(a)hello. im paul. whats your 38jane and paul like good coffee ,so go and get some good coffee for_ 选(b)them 39hello im david manning .nice to meet you b:_ 选(c)nice to meet you im 40a:_,daid?
33、 b: anorange juice. 选(b)what would you like 41ive got a lot of photos of my traveling .would you_them? 42a: are there two men in the room? 43david_ on a new database at the moment 44 a: why dont you go to an estate agent,then,youre talking face to face? b:well,_ 45my husband doesnt_ ,but i like it v
34、ery much. 46a; _ b: she works in the oxford university 选(a)like to see 选(b)no, theres only one 选(b)is currently working 选(c)i dont know 选(a)like shopping 选(a)what does your mother 47london is _capital of britain ,and it is_great city too 选(c)the .a 48id_a beer toothank you 选(b)like to have 49_people
35、 are my friends._people are my husbands friends. 选(a)these ,those 50john: linda, this is rose ,my wife ,my wife ,rose, this is linda, my new student from beijing rose:_ 选(b)hello.lindal i am pleased to meet you 51i go swimming on_ thursdays for two hours. 选(a)/ 52mr green is now_ a holiday 选(c)on 53
36、mary_ brown eyes and golden hair 选(c)has got 54 a: what do you do? b: _ 选(a)i am a policeman 55he often works in_ evening 选(c)the 56my cousin doesnt_serious(严肃的)tv programmes on the weekendsv 选(b)enjoy watching 57 hello, linda ,how are you? b: _ a: 选 (b) very well, thank you, and you? 58a; how about
37、 seeing a film this evening? b: yes_ 选(a)thats a good idea 59my father_for an important phone call at the moment . he cant go to have lunch with you ,i am afraid 选(c)is waiting 60but_wei ght if i dont exercise。 选(b)put on 61the work ers usually_wark at 8:30 选(b)start 62i domtwant_milk in my coffee.
38、选(a)any 63a: i am form enoland. b:_ 选(a)so am i 64a: the shops in this area are _ 选(c)too old-fashioned b : yes i agerr the are not modem emough 65a: the area ia too noisy b: yes,i agree its_ (选 c)not quiet enough 57.you can paint the walls and_posters .you can do what you want (选 a)put up 66quite o
39、ften after dinnet they_ music in a pub and _home about midnight(选 c)play.go 67 do you have_friends in shang hai? 选(b)any 68a: i dont get up late on sundays.b_ 选(c)neither do 61.i dont need _mineral water ,but id like_tea,thanks 选(c)any, some 69on my way home,iquite often _the milk man 选(c)com across
40、 70it often _in winer in the north of china 选(c)snows 71the news in not new at all it is _ 选(b)quiet old 72a:so,do you like the cinema near hydepark? b:yes ,i _it 选(a)love 73i am getting too fat.i have to _my wei 选(a)work off 74a:ihave a light breakfast early in the morning b:_ 选(b)me too 75.i come
41、here twice a week to swin and_ 选(b)work out 75i just-at the office for most of the day ,and i do no exercise 选(a)sit around 77.a:the classroom is not big enough for 50 students b:yes,i agree .its_ 选(a)too small 78.71.it_heavily here at this moment 选(c)is raining 79.he hasnt got_cousins 选(a)any 73.id
42、 like_apples pleass 选(a)some 80.a;he has got two sisters b_ 选(a)so have 81.a:the area ia too noisy b:yes,l agree ,its_ _ 选(c)not quiet enough 82.a:i havent got a car b: _ 选(a)neither have i 83.:a:i like documentaries on tv b:_ 选(b)so do i 84.a:the chair is not comfortable enough. b:yes,i agree .it i
43、s_ 选(b)too uncomfortable 85.a:i dont get up late on sundays.b:_ 选(c)neither do i 86. a:_like to have a coffee? b: yes,please 选(b)would you 87.john is _experienced at training than mary is 选(a)more 88.a :would you like to come to _shop one day? b :yes ,id love to thank you 选(c) my 89he is a good stud
44、ent he never _late. 选(b)comes 90he is a good student he never _earl 选(b)always comes 91im sorry shes not in .would you like to _a message? 选(c)leave 92i go to see my grandparents once _week with my parents. 选(c)a 87david likes fish_breakfast. 选(a)for 93a:should i take some medicime? b;no ,you dont _
45、to take any medicime 选(c)need 94she_work next monday 选(a)is starting 95a:_was the meeting like? b:it was very exciting 选(a)how 96polly is very busy she_work at about 7:00very day 选(c)finishes 97he _in tuavelling. 选(a)is interested 97im bad at spelling ,but jane is_me 选(b)worse than 98l like cookingf
46、or my friends in _free time 选(b)my 99the business banking departmentis on _second floor 选(c)the 100 this is my new watch ,it was a present _my wife. 选(c)from 101a:_is the nearest chemists b:on the comer 选(b)where 101james is _french thean polly 选(a)a bit better at 102who is that man over there ? do
47、youknow_name? 选(a)his 103willians_in london ,mot in china 选(b)lives 104whats the weather_this winter? 选(a)like 105polly goes to a gym twice_week with her friends 选(b)a 106im a nurse .l work_david_the same hospital. 选(c)with.in 107a:i thave got a pain in my chest b:you_see the doctor 选(c)should 107wh
48、en_for london? 选(a)is she flying 108a:_is david from? b:i think hes an american.butlm not sure 选(a)where 109its nearly seven olock jack_be there at any moment. 选(c)should 110_people are coming for the party? 选(c)how many 111this radio is_than that one 选(a)more expensive 112 a;whose dog is it ?b:_our
49、 dog_name is rex. 选(c)its .its 113a:im going to clean the house.b:_do the shopping 选(c)ill 114xiaoyan has a reservation_a single room 选(b)for 113sallys parents_come and stay with her soon 选(b)are going to 115 hello_franco rossi speaking .can l speak to polly williams? 选(a)this is 116you need to redu
50、ce your temperarure,so you_take some medicime 选(b)should 117pam will not come to our meeting nest week .she_in ffance from monday till thursday 选(a)is staying 118a:_time do you have lunch?b:l usually have lunch at 12 选(b)what 119davids younger brother is _engineer 选(b)an 120this watch is _t hat one 选(a)as expensive as 121tell me about your new friend._is he like? 选(b)what 122rose is_easy-going than f rank in the interview. 选(c)much more 123he is_on the 6 oclock train on friday evening 选(a)travelling 124im a deputy manager i work_an it company 选(a)for 123a:i saw tom j
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年运维软件合作协议书
- 肝胆中医养生知识
- 农产品批发综合市场供应链管理与物流体系
- 第五单元第15课三、《网络安全》教学设计 2023-2024学年人教版初中信息技术七年级上册
- 第二课 信息传输新体验 教学设计 2024-2025学年西交大版(2024)初中信息技术七年级上册
- 脑卒中治疗和护理
- 二零二五年度银联国际个人信用卡领用与全球支付服务合同
- 2025至2030年中国带置物架豪华淋浴房数据监测研究报告
- 二零二五年度房产赠与子女协议书联合子女房产租赁收益共同管理协议
- 互换性第1章 学习教材
- 2024年达州市总工会招聘工会社会工作者笔试真题
- 2025至2030年中国肌酸数据监测研究报告
- 1.2 读懂彼此的心 第二课时 课件 2024-2025学年五年级下册道德与法治 统编版
- 2025年度电视产品进出口贸易合同4篇
- 2025年“开学第一课”观后感心得体会(3篇)
- 2024年湖南食品药品职业学院高职单招语文历年参考题库含答案解析
- 外科护理5分钟小讲课
- 《船舶油漆作业》课件
- 2025年中国融通农发社会招聘笔试参考题库含答案解析
- 2025年天津市宁河区事业单位招聘12人高频重点提升(共500题)附带答案详解
- 2024年福建省莆田市数学三上期末质量检测模拟试题含解析
评论
0/150
提交评论