




免费预览已结束,剩余1页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
8位乘法器一:8位乘法器的源程序:module mult8( p, a, b); parameter size = 8; input size:1 a, b; output 2* size:1 p; reg 2* size:1 p;always ( a or b) Begin:mult integer index; p = 0;for(index=1; index=size; index=index+1) if (bindex=1) p = p + (a(index); endendmodule二:8位乘法器的测试代码:timescale 1ns/1nsinclude mult8.vmodule tb_mult8;reg8:1 ina,inb;wire16:1 p;mult8 tb_mult8(p,ina,inb);initialbegin#10 ina=$random%255;inb=$random%255;#10 ina=$random%255;inb=$random%255;#10 ina=$random%255;inb=$random%255;#10 $finish;endinitial $monitor($time,%d*%d=%d,ina,inb,p);endmodule三:Transcript显示结果:# Reading D:/altera/91/modelsim_ase/tcl/vsim/pref.tcl # Loading project adder# reading D:altera91modelsim_asewin32aloem/./modelsim.ini# Loading project mult# reading D:altera91modelsim_asewin32aloem/./modelsim.ini# Loading project mult# Compile of mult8.v was successful.# Compile of tb_mult8.v failed with 1 errors.# 2 compiles, 1 failed with 1 error. # Compile of tb_mult8.v was successful.# Compile of mult8.v was successful.# Compile of tb_mult8.v was successful.# 2 compiles, 0 failed with no errors. vsim work.tb_mult8# vsim work.tb_mult8 # Loading work.tb_mult8# * Error: (vsim-3033) E:/mult/tb_mult8.v(11): Instantiation of initial$monitor failed. The design unit was not found.# Region: /tb_mult8# Searched libraries:# E:multwork# Error loading design# Compile of mult8.v was successful.# Compile of tb_mult8.v was successful.# 2 compiles, 0 failed with no errors. vsim work.tb_mult8# vsim work.tb_mult8 # Loading work.tb_mult8# * Error: (vsim-3033) E:/mult/tb_mult8.v(11): Instantiation of initial$monitor failed. The design unit was not found.# Region: /tb_mult8# Searched libraries:# E:multwork# Error loading design# Compile of mult8.v was successful.# Compile of mult8.v was successful.# Compile of mult8.v was successful.# Compile of mult8.v was successful.# Compile of mult8.v was successful.# Compile of tb_mult8.v was successful.# 2 compiles, 0 failed with no errors. vsim work.tb_mult8# vsim work.tb_mult8 # Loading work.tb_mult8# Loading work.mult8# * Error: (vsim-3033) E:/mult/tb_mult8.v(12): Instantiation of initial$monitor failed. The design unit was not found.# Region: /tb_mult8# Searched libraries:# E:multwork# Error loading design# Compile of mult8.v was successful.# Compile of mult8.v was successful.# Compile of tb_mult8.v was successful.# 2 compiles, 0 failed with no errors. vsim work.tb_mult8# vsim work.tb_mult8 # Loading work.tb_mult8# Loading work.mult8# * Warning: (vsim-3015) E:/mult/tb_mult8.v(6): PCDPC - Port size (16 or 16) does not match connection size (8) for port p.# Region: /tb_mult8/tb_mult8# * Warning: (vsim-3015) E:/mult/tb_mult8.v(6): PCDPC - Port size (8 or 8) does not match connection size (4) for port a.# Region: /tb_mult8/tb_mult8# * Warning: (vsim-3015) E:/mult/tb_mult8.v(6): PCDPC - Port size (8 or 8) does not match connection size (4) for port b.# Region: /tb_mult8/tb_mult8add wave sim:/tb_mult8/*run -all# 0 x* x= x# 10 0*10= x# * Note: $finish : E:/mult/tb_mult8.v(10)# Time: 20 ns Iteration: 0 Instance: /tb_mult8# 1# Break in Module tb_mult8 at E:/mult/tb_mult8.v line 10quit -sim# Compile of mult8.v was successful.# Compile of mult8.v was successful.# Compile of tb_mult8.v was successful.# 2 compiles, 0 failed with no errors. vsim work.tb_mult8# vsim work.tb_mult8 # Loading work.tb_mult8# Loading work.mult8# * Warning: (vsim-3015) E:/mult/tb_mult8.v(6): PCDPC - Port size (16 or 16) does not match connection size (8) for port p.# Region: /tb_mult8/tb_mult8# * Warning: (vsim-3015) E:/mult/tb_mult8.v(6): PCDPC - Port size (8 or 8) does not match connection size (4) for port a.# Region: /tb_mult8/tb_mult8# * Warning: (vsim-3015) E:/mult/tb_mult8.v(6): PCDPC - Port size (8 or 8) does not match connection size (4) for port b.# Region: /tb_mult8/tb_mult8add wave sim:/tb_mult8/*run -all# 0 x* x= x# 10 0*10= x# * Note: $finish : E:/mult/tb_mult8.v(10)# Time: 20 ns Iteration: 0 Instance: /tb_mult8# 1# Break in Module tb_mult8 at E:/mult/tb_mult8.v line 10quit -sim# Compile of mult8.v was successful.# Compile of mult8.v was successful.# Compile of tb_mult8.v was successful.# 2 compiles, 0 failed with no errors. vsim work.tb_mult8# vsim work.tb_mult8 # Loading work.tb_mult8# Loading work.mult8# * Warning: (vsim-3015) E:/mult/tb_mult8.v(6): PCDPC - Port size (16 or 16) does not match connection size (8) for port p.# Region: /tb_mult8/tb_mult8# * Warning: (vsim-3015) E:/mult/tb_mult8.v(6): PCDPC - Port size (8 or 8) does not match connection size (4) for port a.# Region: /tb_mult8/tb_mult8# * Warning: (vsim-3015) E:/mult/tb_mult8.v(6): PCDPC - Port size (8 or 8) does not match connection size (4) for port b.# Region: /tb_mult8/tb_mult8add wave sim:/tb_mult8/*run -all# 0 x* x= x# 10 0*10= x# 20 8*12= x# 30 8*13= x# * Note: $finish : E:/mult/tb_mult8.v(12)# Time: 40 ns Iteration: 0 Instance: /tb_mult8# 1# Break in Module tb_mult8 at E:/mult/tb_mult8.v line 12quit -sim# Compile of mult8.v was successful.# Compile of mult8.v was successful.# Compile of tb_mult8.v was successful.# 2 compiles, 0 failed with no errors. vsim work.tb_mult8# vsim work.tb_mult8 # Loading work.tb_mult8# Loading work.mult8# * Warning: (vsim-3015) E:/mult/tb_mult8.v(6): PCDPC - Port size (16 or 16) does not match connection size (8) for port p.# Region: /tb_mult8/tb_mult8add wave sim:/tb_mult8/*run -all# 0 x* x= x# 10 128* 42= 0# 20 232* 92= 96# 30 72* 77=168# * Note: $finish : E:/mult/tb_mult8.v(12)# Time: 40 ns Iteration: 0 Instance: /tb_mult8# 1# Break in Module tb_mult8 at E:/mult/tb_mult8.v line 12quit -sim# Compile of mult8.v was successful.# Compile of tb_mult8.v was successful.# 2 compiles, 0 failed with no errors. vsim work.tb_mult8# vsim work.tb_mult8# Loading work.tb_mult8# Loading work.mult8# * Warning: (vsim-3015) E:/mult/tb_mult8.v(6): PCDPC - Port size (16 or 16) does not match connection size (8) for port p.# Region: /tb_mult8/tb_mult8add wave sim:/tb_mult8/*run -all# 0 x* x= x# 10 128* 42= 0# 20 232* 9
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年教育信息化基础设施建设与教育信息化项目合作模式创新报告
- 2025年中国覆盆子酱行业市场分析及投资价值评估前景预测报告
- 06 增分微课1 匀变速直线运动中的“形异质同”问题 【答案】听课手册
- 2025年中国风机叶片材料行业市场分析及投资价值评估前景预测报告
- 保姆培训知识家政公司课件
- 口腔专业知识培训
- 保利物业消防知识培训课件
- Unit 5 Friends说课稿-2023-2024学年小学英语五年级上册牛津沪教版(三起)
- 保健知识技能培训内容课件
- 2025年乡镇非遗普查员招聘考试题库及解析
- 老年人情绪管理课件
- 泵站的运行与维护
- 经典资料:2025中国大学生就业调查报告
- 汽车电驱系统讲解
- 房地产开盘活动主持词及流程模板
- 医院感染暴发的识别与处置
- 2025年期权开户考试题库及答案
- 超声引导下置管技术规范与临床应用
- 大阪驾照考试题库及答案
- 2025年中国智慧教育白皮书
- DB32/ 4439-2022工业涂装工序大气污染物排放标准
评论
0/150
提交评论