




已阅读5页,还剩8页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
.可编程实验报告实验报告要求:1、任务的简单描述2、画出电路图3、写出源代码4、仿真结果5、分析和讨论1、3-8译码器源代码:LIBRARY ieee;USE ieee.std_logic_1164.all;USE ieee.std_logic_arith.all;USE ieee.std_logic_signed.all;ENTITY dc38 ISPORT(sel:instd_logic_vector(2 downto 0);y:outstd_logic_vector(7 downto 0);END dc38;ARCHITECTURE behavior OF dc38 ISBEGINy=11111110 WHEN sel = 000 else11111101 WHEN sel = 001 else11111011 WHEN sel = 010 else11110111 WHEN sel = 011 else11101111 WHEN sel = 100 else11011111 WHEN sel = 101 else10111111 WHEN sel = 110 else01111111 WHEN sel = 111 elseZZZZZZZZ;END behavior;仿真结果:一位全加器 A B CI S CO 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1四级流水加法器一位全加器 第 一 级 锁 存 器 第 三 级 锁 存 器 一位全加器第 二 级 锁 存 器一位全加器 第 四 级 锁 存 器一位全加器library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity adder isport(clk,rst : in std_logic;a,b : in std_logic_vector(3 downto 0);sum : out std_logic_vector(3 downto 0);c : out std_logic);end entity adder;architecture depict of adder issignal reg1: std_logic_vector(7 downto 0);signal reg2: std_logic_vector(6 downto 0);signal reg3: std_logic_vector(5 downto 0);beginbit0:process(clk,rst)beginif(rst=1) thenreg1=00000000;elsif(rising_edge(clk) thenreg1(0)= a(0) xor b(0); reg1(1)= a(0) and b(0);reg1(2)= a(1); reg1(3)= b(1);reg1(4)= a(2);reg1(5)= b(2);reg1(6)= a(3);reg1(7)= b(3);end if;end process bit0;bit1:process(clk,rst)beginif(rst=1) thenreg2=0000000;elsif(rising_edge(clk) thenreg2(0)= reg1(0);reg2(1)= reg1(1) xor reg1(2) xor reg1(3);reg2(2)= (reg1(1) and reg1(2)or(reg1(1)and reg1(3)or(reg1(2)and reg1(3);reg2(6 downto 3)=reg1(7 downto 4);end if; end process bit1;bit2:process(clk,rst)beginif(rst=1) thenreg3=000000;elsif(rising_edge(clk) thenreg3(1 downto 0)=reg2(1 downto 0);reg3(2)=reg2(2)xor reg2(3)xor reg2(4);reg3(3)=(reg2(2)and reg2(3)or(reg2(2)and reg2(4)or(reg2(3)and reg2(4);reg3(5 downto 4)=reg2( 6 downto 5);end if;end process bit2;bit3:process(clk,rst)beginif(rst=1) thensum=0000;c=0;elsif(rising_edge(clk) thensum(2 downto 0)=reg3(2 downto 0);sum(3)=reg3(3)xor reg3(4)xor reg3(5);c=(reg3(3)and reg3(4)or(reg3(3)and reg3(5)or(reg3(4)and reg3(5);end if;end process bit3;end depict;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity noadd isport(clk,rst : in std_logic;a,b : in std_logic_vector(3 downto 0);sum : out std_logic_vector(3 downto 0);c : out std_logic);end entity noadd;architecture depict of noadd issignal reg : std_logic_vector(4 downto 0);signal rega: std_logic_vector(4 downto 0);signal regb: std_logic_vector(4 downto 0);beginprocess(clk) beginif(rising_edge(clk)thenrega=0& a;regb=0& b; end if;end process;process(clk)beginif(rst=1)thenreg=00000;elsif(rising_edge(clk)thenreg=rega+regb;end if;end process;sum=reg(3 downto 0);c=reg(4);end depict;4位十进制数计数器library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity dec_disp is port(clk_cnt : in std_logic;sel1 : out std_logic_vector(3 downto 0);sel2 : out std_logic_vector(3 downto 0);sel3 : out std_logic_vector(3 downto 0);sel4 : out std_logic_vector(3 downto 0);end dec_disp;architecture behav of dec_disp issignal data1 : std_logic_vector(3 downto 0);signal data2 : std_logic_vector(3 downto 0);signal data3 : std_logic_vector(3 downto 0);signal data4 : std_logic_vector(3 downto 0);begin count:process(clk_cnt) begin if(rising_edge(clk_cnt)then if(data1=1001)then data1=0000; else if(data2=1001)then data2=0000; data1=data1+1; else if(data3=1001)then data3=0000; data2=data2+1; else if(data4=1001)then data4=0000; data3=data3+1; else data4=data4+1; end if; end if; end if; end if;end if;end process count;sel1=data1;sel2=data2;sel3=data3;sel4=data4;end behav;正弦波发生器 .sin.mif文件depth=256;width=8;address_radix=dec;data_radix=dec;contentbegin 0: 131; 1: 134; 2: 137; 3: 141; 4: 144; 5: 147; 6: 150; 7: 153; 8: 156; 9: 159; 10: 162; 11: 165; 12: 168; 13: 171; 14: 174; 15: 177; 16: 180; 17: 183; 18: 186; 19: 188; 20: 191; 21: 194; 22: 196; 23: 199; 24: 202; 25: 204; 26: 207; 27: 209; 28: 212; 29: 214; 30: 216; 31!219; 32:221; 33:223; 34:225; 35:227; 36:229; 37:231; 38:233; 39:234; 40:236; 41:238; 42:239; 43:241; 44:242; 45:244; 46:245; 47:246; 48:247; 49:249; 50:250; 51:250; 52:251; 53:252; 54:253; 55:254; 56:254; 57:255; 58:255; 59:255; 60:255; 61:255; 62:255; 63:255; 64:255; 65:255; 66:255; 67:255; 68:255; 69:255; 70:254; 71:254; 72:253; 73:252; 74:251; 75:250; 76:250; 77:249; 78:247; 79:246; 80:245; 81:244; 82:242; 83:241; 84:239; 85:238; 86:236; 87:234; 88:233; 89:231; 90:229; 91:227; 92:225; 93:223; 94:221; 95:219; 96:216; 97:214; 98:212; 99:209; 100:207; 101:204; 102:202; 103:199; 104:196; 105:194; 106:191; 107:188; 108:186; 109:183; 110:180; 111:177;112:174; 113:171; 114:168; 115:165; 116:162; 117:159; 118:156; 119:153; 120:150; 121:147;122:144; 123:141; 124:137; 125:134; 126:131; 127:128; 128:125; 129:122; 130:119; 131:115; 132:112; 133:109; 134:106; 135:103; 136:10; 137:97; 138:94; 139:91;140:88; 141:85; 142:82; 143:79; 144:76; 145:73; 146:70; 147:68; 148:65; 149:62; 150:60; 151:57; 152:54; 153:52; 154:49; 155:47; 156:44; 157:42; 158:40; 159:37; 160:35; 161:33; 162:31; 163:29; 164:27; 165:25;166:23; 167:22;168:20; 169:18; 170:17; 171:15; 172:14; 173:12; 174:11; 175:10; 176:9; 177:7; 178:6; 179:6; 180:5; 181:4; 182:3; 183:2; 184:2; 185:1; 186:1; 187:1; 188:0; 189:0; 190:0;191:0; 192:0; 193:0; 194:0; 195:1;196:1; 197:1; 198:2; 199:2; 200:3; 201:4; 202:5; 203:6; 204:6; 205:7; 206:9; 207:10; 208:11; 209:12; 210:14; 211:15; 212:17; 213:18; 214:20; 215:22; 216:23; 217:25; 218:27; 219:29; 220:3
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 工商银行2025西宁市秋招笔试EPI能力测试题专练及答案
- 2025年3D打印技术的个性化医疗
- 2025年3D打印的医疗植入物研发
- 工商银行2025天津市秋招群面模拟题及高分话术
- 交通银行2025宜春市秋招笔试创新题型专练及答案
- 2025行业品牌建设成功案例
- 交通银行2025阜新市信息科技岗笔试题及答案
- 邮储银行2025白山市半结构化面试15问及话术
- 建设银行2025太原市秋招结构化面试经典题及参考答案
- 中国银行2025巴中市秋招笔试专业知识题专练及答案
- (2025)入党积极分子考试试题库(附参考答案)
- 解码2025年健康消费市场新趋势报告-尼尔森iq-202506
- 2025秋三年级上册语文上课课件 11 宝葫芦的秘密(节选)
- 2025央国企AI+数智化转型研究报告
- YY/T 1955-2025组织工程医疗器械胶原蛋白术语
- 北京市2025学年高二(上)第一次普通高中学业水平合格性考试物理试题(解析版)
- 小学生借物抒情写法课件
- 抽水试验记录表格
- 工会换届经审工作报告
- T/CWAN 0099-2023液化天然气用奥氏体不锈钢管焊接工艺规程
- 大学生宿舍行为规范准则
评论
0/150
提交评论