全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1 三态门 library ieee; use ieee.std_logic_1164.all; entity three is port( a,en:in std_logic; y:out std_logic); end three; architecture bhv of three is begin process(a,en) begin if en=1 then y=a ; else y=Z; end if; end process; end bhv; 2. 用条件信号赋值语句设计8位比较器 library ieee; use ieee.std_logic_1164.all; entity comp8 is port(a,b: in std_logic_vector(0 to 7); gt,eq,lt: out std_logic); end comp8; architecture a of comp8 is signal c:std_logic_vector(0 to 2); begin cb else 010 when a=b else 001 when ab else 000; gt=c(0);eq=c(1);lt=c(2); end a ;3 检测8位二进制数中1的个数并用数码管显示检测结果 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity count_dec is port( a: in std_logic_vector(7 downto 0); led:out std_logic_vector(6 downto 0); end count_dec; architecture str of count_dec is signal temp:std_logic_vector(0 to 3); begin P1: process(a) variable cnt:std_logic_vector(0 to 3); begin cnt:=0000; for i in 0 to 7 loop if a(i)=1 then cnt:=cnt+1; end if; end loop; templedledledledledledledledledled=0000000; end case; end process; end str;4. N输入与门设计 library ieee; use ieee.std_logic_1164.all; entity andn is generic(n:integer:=8); port(a:in std_logic_vector( 0 to n-1); y:out std_logic); end andn; architecture hbv of andn is begin process(a) variable tmp:std_logic; begin tmp:=1; for i in 0 to alength-1 loop if a(i)=0then tmp:=0; end if; end loop; y2) port map(d(0 to 1),y1); u2:andn generic map(n=3) port map(d(2 to 4),y2); end hbv; 6. 七人表决器library ieee;use ieee.std_logic_1164.all;entity vote7 isport(a:in std_logic_vector( 0 to 6);lg,lr:out std_logic);end;architecture bhv of vote7 issignal pass:integer;beginprocess(a)variable tmp1:integer;begintmp1:=0;for i in 0 to 6 loopif a(i)=1 then tmp1:=tmp1+1; else tmp1:=tmp1+0;end if;end loop;pass=tmp1;end process;lg=4 else 0;lr=1when pass4 else 0;end bhv;7. 串行数据检测器的设计library ieee;use ieee.std_logic_1164.all;entity scheck isport(,clk,clr:in std_logic; y:out std_logic);end scheck;architecture b of scheck issignal s:integer range 0 to 8;signal d:std_logic_vector(7 downto 0);begind=10001110;p1:process(clr,clk) begin if clr=1then sif din=d(7)then s=1;else sif din=d(6)then s=2;else sif din=d(5)then s=3;else sif din=d(4)then s=4;else sif din=d(3)then s=5;else sif din=d(2)then s=6;else sif din=d(1)then s=7;else sif din=d(0)then s=8;else ss=0; end case; end if;end process;p2:process(s) begin if s=8 then y=1; else y=0; end if;end process;end b;8. 4选1数据选择器的设计(设计方法不唯一)library ieee;use ieee.std_logic_1164.all;entity mux41 isport(a,b,en:in std_logic; d:in std_logic_vector(0 to 3); y:out std_logic);End mux41;architecture bhv of mux41 issignal s
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 苏州百年职业学院《比较文学与世界研究方法论》2026-2027学年第一学期期末试卷含解析
- 淄博职业学院《工程实践与工程管理》2026-2027学年第一学期期末试卷含解析
- 沈阳建筑大学《领导科学与艺术》2026-2027学年第一学期期末试卷含解析
- 玉溪职业技术学院《市场营销学前沿专题》2026-2027学年第一学期期末试卷含解析
- 郑州食品工程职业学院《大学生就业创业训练》2026-2027学年第一学期期末试卷含解析
- 宜春幼儿师范高等专科学校《油画人物与场景》2026-2027学年第一学期期末试卷含解析
- 天津铁道职业技术学院《水质监测实验》2026-2027学年第一学期期末试卷含解析
- 上饶幼儿师范高等专科学校《现代社交礼仪》2026-2027学年第一学期期末试卷含解析
- 跨学科实践:制作简易杠杆课件2025-2026学年物理人教版八年级下册
- 艺术设计的创新与表达-艺术家的视角
- 重庆市护理三基三严考试题库(含答案)
- 郎溪直升班招生数学试卷
- DB64∕T 1147-2022代替DB64 1147-2015 工业企业单位产品能源消耗限额
- 前程无忧行测笔试题库
- 浙江科技学院《食物营养与健康》2023-2024学年第一学期期末试卷
- 河南省公路水运工程平安工地建设等级划分表、评价指南、评价标准
- 浙江台州市2024-2025学年高二下学期期末考试物理试卷
- (高清版)DB34∕T 4697-2024 水电站机组寿命评估技术规范
- 上海市闵行区2024-2025学年下学期期末考试六年级数学试卷及答案(新教材沪教版)
- 学法减分题库题目及答案
- 光纤熔接技术课件
评论
0/150
提交评论