VHDL流水线加法器_第1页
VHDL流水线加法器_第2页
VHDL流水线加法器_第3页
已阅读5页,还剩12页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、可编程实验报告实验报告要求: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_sig ned.all;ENTITY dc38 ISP0RT(sel :in stdogic_vector(2 downto 0);y :out stdogic_vector(7 downto 0);END dc38;ARCHITECTURE behavior OF dc38 ISBEGINy &

2、lt;= "11111110" WHEN sel = "000" else "11111101" WHEN sel = "001" else "11111011" WHEN sel = "010" else "11110111" WHEN sel = "011" else "11101111" WHEN sel = "100" else "11011111" WHEN sel

3、= "101" else "10111111" WHEN sel = "110" else "01111111" WHEN sel = "111" else "ZZZZZZZZ"«««««««« JEND behavior;仿真结果:一位全加器比 MA-rplu-G 'll 刊* E<Sr V*w Synh>!巳趴辛* l>ifleii Woof Whdew 怖虫n曲百看

4、 昙 蚪缶蛹窃©总也药E蛋耳卫4吒蛊迫签勺耳三±>瓦11: I* Tiaw 何晁49D 加&I» ri世I可債i一_ rilMMMi; d d|_托 母 BBB幷n MAK»*Lii I 曲丄Kmudd ftJ諾,史I igqrfk l勒*d口U% ll 刊中 Edr View Had中斗料审 Lnh-rt 叶。皿 W-da-比切nqs严桥心囲用目总占险国菟ed6吧港雯澧朋四级流水加法器立第(位 全 加 l=LH、一位全加器第锁存library ieee;use ieee.stdo gic_1164.all;use ieee.std_log

5、ic_ un sig ned.all;use ieee.std_logic_arith.all;en tity adder isport(clk,rst : in std_logic;a,b : in std_logic_vector(3 dow nto 0); sum : out std_logic_vector(3 dow nto 0); c : out std_logic);end en tity adder;architecture depict of adder issignal reg1: std_logic_vector(7 dow nto 0); signal reg2: st

6、d_logic_vector(6 dow nto 0); signal reg3: std_logic_vector(5 dow nto 0); beginbitO:process(clk,rst)beginif(rst='1') the n reg1<="00000000"elsif(ris in g_edge(clk) the n reg1(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);re

7、g1(5)<= b(2);reg1(6)<= a(3);reg1(7)<= b(3);end if;end process bit0;bit1:process(clk,rst)beginif(rst='1') the nreg2<="0000000"elsif(ris in g_edge(clk) the nreg2(0)<= reg1(0);reg2(1)<= reg1(1) xor reg1(2) xor reg1(3);reg2(2)<=(reg1(1)andreg1(3)or(reg1(2)a nd reg1

8、(3);reg2(6 dow nto 3)<=reg1(7 dow nto 4);end if;end process bit1;bit2:process(clk,rst)beginif(rst='1') the nreg3<="000000"elsif(ris in g_edge(clk) the nreg3(1 dow nto 0)<=reg2(1 dow nto 0); reg3(2)<=reg2(2)xor reg2(3)xor reg2(4);reg3(3)<=(reg2(2)a ndreg2 (3) )or(reg2

9、(2)a ndreg2(4);reg3(5 dow nto 4)<=reg2( 6 dow nto 5);end if;end process bit2;bit3:process(clk,rst)beginif(rst='1') the nsum<="0000"c<='0'elsif(ris in g_edge(clk) the nsum(2 dow nto 0)<=reg3(2 dow nto 0);sum(3) <=reg3(3)xor reg3(4)xor reg3(5);c<=(reg3 (3) a

10、 ndreg3(4)or(reg3(3)a ndreg1(2)or(reg1(1)a ndreg2 (4) )or(reg2(3)a ndreg3(5)or(reg3(4)a ndreg3(5);end if;end process bit3;end depict;二 Tamo 阳nggytsn: MAXI 讥*id弹比F ,adiih<M 鼻砂a mw4 fngnu4Jnn*H»i ,7gi.呂呼M4J 9Wmt1dta1i r ii i i i i1 rf 1 f£«LD7-nrXV AF;丁;B IDT、r12" 1K j« K L

11、1 J(_j JL1 J. J Jt(3 训D T'K 2K¥rx t* T w乍-X飞 1 U J « :詁丫I1】右】.苯;qD-00I *Xi1尬一:t ;a MAM-rphri II 貝tr Edr 5e Nodt-Q¥4on« HMow Hr|pn启肴虽魄锁园出皿匪匹鬲序也甘覺蛊怕澄冊ci ,s 3 ? *(. 匚 rm 昨 1library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_ un sig ned.all;use ieee.std_logic_arith.all;e

12、n tity n oadd isport(clk,rst : in std_logic;a,b : in std_logic_vector(3 dow nto 0); sum : out std_logic_vector(3 dow nto 0); c : out std_logic);end en tity no add;architecture depict of no add issig nal reg : std_logic_vector(4 dow nto 0);sig nal rega: std_logic_vector(4 dow nto 0);sig nal regb: std

13、_logic_vector(4 dow nto 0);beginprocess(clk)beginif(risi ng_edge(clk)the nrega<='0' & a;regb<='0' & b;end if;end process;process(clk)beginif(rst='1')the nreg<="00000"elsif(ris in g_edge(clk)the nreg<=rega+regb;end if;end process;sum<=reg(3 dow

14、 nto 0);c<=reg(4);end depict;4位十进制数计数器library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_ un sig ned.all;use ieee.std_logic_arith.all;en tity dec_disp is port( clk_c nt : in std_logic;sel1 : out std_logic_vector(3 dow nto 0); sel2 : out std_logic_vector(3 dow nto 0);sel3 : out std_logic_

15、vector(3 dow nto 0);sel4 : out std_logic_vector(3 dow nto 0);end dec_disp;architecture behav of dec_disp issig naldata1:std_logic_vector(3 dow nto 0);sig naldata2:std_logic_vector(3 dow nto 0);sig naldata3:std_logic_vector(3 dow nto 0);sig naldata4:std_logic_vector(3 dow nto 0);begincoun t:process(c

16、lk_c nt)beginif(risi ng_edge(clk_cnt)the n if(data 1="1001")the n data1<="0000"else if(data2="1001")the n data2<="0000" data1<=data1+1;else if(data3="1001")the n data3<="0000" data2<=data2+1;else if(data4="1001")the

17、 n 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;vQV»iu n Hi口兰加“2 £ T 士32*Jh. n I?血_9»OHbZd叵fhil«ll*i| I He 12 hi 工应 1h 3te 14U- J 5rit

18、 4-K» 5«ufl BVk EX t.h# T£uc I Qua Bg 9 瞰 l.bi Pnjuu JL L JJLTL JUUL LUL'LLUtfLULIT lJinJE LJ JLrLl'J'Jt'LT_TLIL JJll L'LltTLLfLTL'MD3*正弦波发生器sin .mif 文件depth=256;width=8;address_radix=dec;data_radix=dec; contentbegin43:241;87:234;0: 131;44:242;88:233;1: 134;45:

19、244;89:231;2: 137;46:245;90:229;3: 141;47:246;91:227;4: 144;48:247;92:225;5: 147;49:249;93:223;6: 150;50:250;94:221;7: 153;51:250;95:219;8: 156;52:251;96:216;9: 159;53:252;97:214;10: 162;54:253;98:212;11: 165;55:254;99:209;12: 168;56:254;100:207;13: 171;57:255;101:204;14: 174;58:255;102:202;15: 177;

20、59:255;103:199;16: 180;60:255;104:196;17: 183;61:255;105:194;18: 186;62:255;106:191;19: 188;63:255;107:188;20: 191;64:255;108:186;21: 194;65:255;109:183;22: 196;66:255;110:180;23: 199;67:255;111:177;24: 202;68:255;112:174;25: 204;69:255;113:171;26: 207;70:254;114:168;27: 209;71:254;115:165;28: 212;7

21、2:253;116:162;29: 214;73:252;117:159;30: 216;74:251;118:156;31!219;75:250;119:153;32:221;76:250;120:150;33:223;77:249;121:147;34:225;78:247;122:144;35:227;79:246;123:141;36:229;80:245;124:137;37:231;81:244;125:134;38:233;82:242;126:131;39:234;83:241;127:128;40:236;84:239;128:125;41:238;85:238;129:122;42:239;86:236;130:119;131:115;175:10;219:29;132:112;176:9;220:31;133:109;177:7;221:33;134:106;178:6;222:35;135:103;179:6;223:37;136:10;180:5;224:40;137:97;181:4;225:42;1

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论