ImageVerifierCode 换一换
格式:DOC , 页数:16 ,大小:153.04KB ,
资源ID:2646105      下载积分:8 金币
快捷注册下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/2646105.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

开通VIP折扣优惠下载文档

            查看会员权益                  [ 下载后找不到文档?]

填表反馈(24小时):  下载求助     关注领币    退款申请

开具发票请登录PC端进行申请

   平台协调中心        【在线客服】        免费申请共赢上传

权利声明

1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:0574-28810668;投诉电话:18658249818。

注意事项

本文(组成专题实验报告三.doc)为本站上传会员【w****g】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4009-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

组成专题实验报告三.doc

1、个人收集整理 勿做商业用途 计算机组成原理 实验报告 学 院:____ 电信学院_ ____ 专 业:_计算机科学与技术____ 学 号:___2110505108________ 班 级:___计算机15_________ 姓 名:_____张玲玲__________ 时 间:__ 2013年1月3日 __ 一、 实验目的 (1)掌握基本的算术运算和逻辑运算的运算规则和实现方法; (2)掌握基本运算器的信息传送通路; (3)掌握运算器的工作原理,设计并实现

2、具有定点、浮点运算功能的模块。 二、 实验内容 设计一个基本的算术逻辑运算模块,包括: ①算术运算模块,主要包括定点运算:加减乘除运算及浮点运算(浮点运算依照IEEE754标准); ②逻辑运算模块,主要包括与、或、非、异或和各种移位运算等; 注: 运算器模块框图:运算器(ALU)通常有两个数据输入端(opr1和opr2),一个数据输出端(result),运算模式控制信号(code)和标志位( cin , flag)等。下图为运算器的逻辑框图: 图2-1 运算器 运算器包含加法器(含用先行进位的构成的加法器,如4位一组

3、构成16位)、减法器、乘法器、与门、或门、非门、异或门和移位器等及浮点运算模块;运算器模块中也可以加入寄存器组. 本实验中设计的运算器操作数可以分别为8/16/32位字长((32位字长运算可以只进行仿真分析) ③ 定点乘法: 已知X=-0。1010,Y=0。0011,求 X*Y=? 利用原码乘法的方法,设计VHDL程序,完成乘法的运算并描述其算法及电路图; 三、 实验原理 在计算机内实现原码乘法时,要做以下方面的改进工作。由于在运算器内通常只能完成对两数的求乘操作,则可以每求得一个相加数,就同时完成与上一次部分积相加的操作。其次是在手

4、工计算时,各加数逐位左移,最终相加数为相乘二位数的两倍,而在计算机中,加法器的位数一般与乘法器的位数相同,而不是寄存器位数的两倍。这实际上也可以用另外的办法解决.手工计算时,各加数是逐位左移,但很容易发现,在求本次部分积之和时,前一部分积的最低一位是不再与任何数值相加的。这就意味着,若采用每求得一次部分积之后使其右移一位,则可以只用N位的加法器就能实现两个N位的数相乘j!显而易见,若前一次部分积已经右移一位,就可以用其高位部分加上被乘数或加零的方法求得本次部分积。最后一点是,手工计算时,乘数每一位的值是0还是1都直接看得见,而在计算机内,采用放乘数的寄存器的每一位直接决定本次相加数是被乘数还是

5、零是很不方便的,若均采用该寄存器的最低一位来执行这种判别就简便了。为此,只要每求一次部分积就使放乘数的寄存器执行一次右移操作即可以了。若移位时,使其最高数值位接收加法器最低位的输出,则完成乘法运算后,该寄存器中保存的是乘积的低位部分。计算机内求乘积的符号,很容易用求相乘二数符号的半加和(异或值)实现。个人收集整理,勿做商业用途 原码一位乘法的规则: ⑴判断参加运算的操作数是否合格; ⑵令乘数的最低位为判断位,若为“1",加被乘数,若为“0”,不加被乘数(加0); ⑶累加后的部分积以及乘数右移一位 ⑷重复n次⑵和⑶ ;

6、⑸符号位单独处理,同号为正,异号为负。 通常,乘法运算需要3个寄存器。被乘数存放在B寄存器中;乘数存放在C寄存器中;A寄存器用来存放部分积与最后乘积的高位部分,它的初值为0。运算结束后寄存器C中不再保留乘数,改为存放乘积的低位部分. 例:已知:X=0。1101,Y=-0。1011,求:X×Y。 |X|=00.1101→B,|Y|=。1011→C,0→A 原码一位乘法示例 A C 说明 00。0000 1011

7、 +|X| 00.1101 C4=1,+|X| 00。1101 → 00.0110 1101 部分积右移一位 +|X| 00。1101 C4=1,+|X| 01。0011

8、 → 00。1001 1110 部分积右移一位 +0 00。0000 C4=0,+0 00.1001 → 00。0100 1111 部分积右移一位 +|X| 00.1101 C4=1,+|X|

9、 01。0001 → 00。1000 1111 部分积右移一位 ∵PS=XS⊕YS=0⊕1=1 ∴X*Y=-0。10001111 原码一位乘法流程图 这里为了简便,我编写了无符号数原码的乘法运算,不考虑符号位。即实现了两个四位数相乘,结果放入一个八位数中。 四、 实验源代码 library ieee; use ieee.std_logic_1164。all; use ieee。std_logic_unsigned.all; use ieee.std_logic_arith。all;

10、 entity ALU is port( set:in std_logic;—- 运算控制信号 code:in std_logic_vector(3 downto 0);-- 操作码 cin:in std_logic;—- 低位向高位的进位或者借位信号 opr1:in std_logic_vector(7 downto 0);-— 第一操作数 opr2:in std_logic_vector(7 downto 0);-— 第二操作数 result:out std_logic_vector(7 downto 0);-—

11、运算结果 flag:out std_logic——运算结果标志位flag ); end ALU; architecture behav of ALU is signal a:std_logic_vector(7 downto 0); signal b:std_logic_vector(7 downto 0); signal c:std_logic_vector(7 downto 0); shared variable y,x:std_logic_vector(7 downto 0); begin process(b,c,temp1,set,code

12、cin,opr1,opr2) variable i: integer; begin a<="00000000"; b〈=”00000000”; C<=”00000000”; x:="00000000"; temp:=”00000000"; temp1〈="00000000"; result<="00000000”; flag<='0'; if set=’1'then case code is when"0000”=>——”+" a(0)<=opr1(0) and opr2(0);b(0)〈=opr1(0) xor opr2(0);--产生

13、本地进位和传递条件 a(1)<=opr1(1) and opr2(1);b(1)<=opr1(1) xor opr2(1); a(2)<=opr1(2) and opr2(2);b(2)<=opr1(2) xor opr2(2); a(3)〈=opr1(3) and opr2(3);b(3)〈=opr1(3) xor opr2(3); a(4)<=opr1(4) and opr2(4);b(4)<=opr1(4) xor opr2(4); a(5)〈=opr1(5) and opr2(5);b(5)<=opr1(5

14、 xor opr2(5); a(6)〈=opr1(6) and opr2(6);b(6)<=opr1(6) xor opr2(6); a(7)〈=opr1(7) and opr2(7);b(7)<=opr1(7) xor opr2(7); —-每四位一组,组内先行进位加法,组间串行进位加法. result(0)<=b(0) xor cin; c(0)<=a(0) or (b(0) and cin); result(1)〈=b(1) xor c(0); c(1)<=a(1) or (b(1) an

15、d a(0)) or (b(1)and b(0)and cin); result(2)〈=b(2) xor c(1); c(2)<=a(2) or (b(2) and a(1)) or (b(2)and b(1)and a(0)) or (b(2)and b(1)and b(0)and cin); result(3)<=b(3) xor c(2); c(3)<=a(3) or (b(3) and a(2)) or (b(3)and b(2)and a(1)) or (b(3)and b(2)and b(1)and a(0)) or

16、 (b(3)and b(2)and b(1)and b(0)and cin); result(4)<=b(4) xor c(3); c(4)<=a(4) or (b(4) and c(3)); result(5)〈=b(5) xor c(4); c(5)<=a(5) or (b(5) and a(4)) or (b(5)and b(4)and c(3)); result(6)<=b(6) xor c(5); c(6)<=a(6) or (b(6) and a(5)) or (b(6)and b(5)

17、and a(4)) or (b(6)and b(5)and b(4)and c(3)); result(7)<=b(7) xor c(6); flag〈=a(7) or (b(7) and a(6)) or (b(7)and b(6)and a(5)) or (b(7)and b(6)and b(5)and a(4)) or (b(7)and b(6)and b(5)and b(4)and c(3)); when”0001”=>--”+1" result(0)〈=not opr1(0); result(1)<=opr

18、1(1) xor opr1(0); result(2)〈=opr1(2) xor (opr1(1) and opr1(0)); result(3)〈=opr1(3) xor (opr1(2) and opr1(1) and opr1(0)); result(4)<=opr1(4) xor (opr1(3) and opr1(2) and opr1(1) and opr1(0)); result(5)<=opr1(5) xor (opr1(4) and opr1(3) and opr1(2) and opr1(1) and op

19、r1(0)); result(6)〈=opr1(6) xor (opr1(5) and opr1(4) and opr1(3) and opr1(2) and opr1(1) and opr1(0)); result(7)<=opr1(7) xor (opr1(6) and opr1(5) and opr1(4) and opr1(3) and opr1(2) and opr1(1) and opr1(0)); flag〈=opr1(7) and opr1(6) and opr1(5) and opr1(4) and opr1(3) and

20、 opr1(2) and opr1(0); when”0010"=>—-"-" a(0)〈=opr1(0) and (not opr2(0));b(0)<=opr1(0) xor (not opr2(0)); a(1)〈=opr1(1) and (not opr2(1));b(1)〈=opr1(1) xor (not opr2(1)); a(2)〈=opr1(2) and (not opr2(2));b(2)〈=opr1(2) xor (not opr2(2)); a(3)〈=opr1(3) and (not opr

21、2(3));b(3)〈=opr1(3) xor (not opr2(3)); a(4)<=opr1(4) and (not opr2(4));b(4)<=opr1(4) xor (not opr2(4)); a(5)<=opr1(5) and (not opr2(5));b(5)<=opr1(5) xor (not opr2(5)); a(6)〈=opr1(6) and (not opr2(6));b(6)<=opr1(6) xor (not opr2(6)); a(7)〈=opr1(7) and (not opr2(7));b(

22、7)〈=opr1(7) xor (not opr2(7)); result(0)<=b(0) xor (not cin); c(0)〈=a(0) or (b(0) and (not cin)); result(1)〈=b(1) xor c(0); c(1)〈=a(1) or (b(1) and a(0)) or (b(1)and b(0)and (not cin)); result(2)〈=b(2) xor c(1); c(2)〈=a(2) or (b(2) and a(1)) or (b(2)an

23、d b(1)and a(0)) or (b(2)and b(1)and b(0)and (not cin)); result(3)<=b(3) xor c(2); c(3)〈=a(3) or (b(3) and a(2)) or (b(3)and b(2)and a(1)) or (b(3)and b(2)and b(1)and a(0)) or (b(3)and b(2)and b(1)and b(0)and (not cin)); result(4)<=b(4) xor c(3); c(4)<=a(4) or (b(4) an

24、d c(3)); result(5)〈=b(5) xor c(4); c(5)〈=a(5) or (b(5) and a(4)) or (b(5)and b(4)and c(3)); result(6)〈=b(6) xor c(5); c(6)<=a(6) or (b(6) and a(5)) or (b(6)and b(5)and a(4)) or (b(6)and b(5)and b(4)and c(3)); result(7)<=b(7) xor c(6); c(7)〈=a(7) or (b(

25、7) and a(6)) or (b(7)and b(6)and a(5)) or (b(7)and b(6)and b(5)and a(4)) or (b(7)and b(6)and b(5)and b(4)and c(3)); flag〈=not c(7); when"0011"=〉—-"-1" result(0)<=not opr1(0); result(1)〈=opr1(1)xor(not opr1(0)); result(2)〈=opr1(2)xor(not (opr1(1)or opr1(0)));

26、 result(3)〈=opr1(3)xor(not (opr1(2)or opr1(1)or opr1(0))); result(4)〈=opr1(4)xor(not (opr1(3)or opr1(2)or opr1(1)or opr1(0))); result(5)〈=opr1(5)xor(not (opr1(4)or opr1(3)or opr1(2)or opr1(1)or opr1(0))); result(6)<=opr1(6)xor(not (opr1(5)or opr1(4)or opr1(3)or opr1(2)or

27、opr1(1)or opr1(0))); result(7)<=opr1(7)xor(not (opr1(6)or opr1(5)or opr1(4)or opr1(3)or opr1(2)or opr1(1)or opr1(0))); flag<=not(opr1(7)or opr1(6)or opr1(5)or opr1(4)or opr1(3)or opr1(2)or opr1(1)or opr1(0)); when”0100"=>-—”*”操作数为4位,结果为8位,无符号数原码乘法 --c〈=opr1(3 downto 0)*

28、opr2(3 downto 0); x(0):=’0'; x(1):='0’; x(2):='0'; x(3):=’0’; x(4):=opr1(0); x(5):=opr1(1); x(6):=opr1(2); x(7):=opr1(3); y(0):=opr2(0); y(1):=opr2(1); y(2):=opr2(2); y(3):=opr2(3); y(4):=’0’; y(5):=’0’; y(6):='0’; y(7):=’0’;

29、 i:=0; while (i<4) loop if(y(0)=’1') then y:=x+y; else y:=y; end if; y(0):=y(1); y(1):=y(2); y(2):=y(3); y(3):=y(4); y(4):=y(5); y(5):=y(6); y(6):=y(7); y(7):='0’; --y(7 downto 0)<=y1(7 downto 0); i:=i+1; end loop; --y(7)<=opr1(7) xor

30、opr2(7); result<=y; if((opr1>15) or (opr2〉15)) then flag<='1'; end if; when"0101”=>——传送数据 result〈=opr1(7 downto 0); when"0110”=〉——”and” result(0)〈=opr1(0)and opr2(0); result(1)〈=opr1(1)and opr2(1); result(2)<=opr1(2)and opr2(2); result(3)

31、<=opr1(3)and opr2(3); result(4)〈=opr1(4)and opr2(4); result(5)〈=opr1(5)and opr2(5); result(6)〈=opr1(6)and opr2(6); result(7)〈=opr1(7)and opr2(7); when"0111"=〉--"or” result(0)〈=opr1(0)or opr2(0); result(1)<=opr1(1)or opr2(1); result(2)<=op

32、r1(2)or opr2(2); result(3)<=opr1(3)or opr2(3); result(4)<=opr1(4)or opr2(4); result(5)〈=opr1(5)or opr2(5); result(6)<=opr1(6)or opr2(6); result(7)<=opr1(7)or opr2(7); when”1000”=>—-”not” result(0)〈=not opr1(0); result(1)<=not opr1(1);

33、 result(2)<=not opr1(2); result(3)〈=not opr1(3); result(4)〈=not opr1(4); result(5)〈=not opr1(5); result(6)〈=not opr1(6); result(7)<=not opr1(7); when"1001"=>--"xor” result(0)<=opr1(0)xor opr2(0); result(1)〈=opr1(1)xor opr2(1);

34、 result(2)<=opr1(2)xor opr2(2); result(3)<=opr1(3)xor opr2(3); result(4)〈=opr1(4)xor opr2(4); result(5)〈=opr1(5)xor opr2(5); result(6)<=opr1(6)xor opr2(6); result(7)〈=opr1(7)xor opr2(7); when”1010"=>—-”SAL" case opr2 is when ”0000

35、0000"=〉result<=opr1; when "00000001”=>result(0)<=opr1(0); result(7 downto 1)〈=opr1(6 downto 0); when "00000010”=>result(0)<=opr1(0); result(1)<=opr1(0); result(7 downto 2)<=opr1(5 downto 0)

36、 when "00000011”=〉result(0)<=opr1(0); result(1)〈=opr1(0); result(2)<=opr1(0); result(7 downto 3)〈=opr1(4 downto 0); when ”00000100"=〉result(0)<=opr1(0); result(1

37、〈=opr1(0); result(2)<=opr1(0); result(3)〈=opr1(0); result(7 downto 4)〈=opr1(3 downto 0); when ”00000101”=>result(0)〈=opr1(0); result(1)〈=opr1(0); res

38、ult(2)〈=opr1(0); result(3)<=opr1(0); result(4)<=opr1(0); result(7 downto 5)〈=opr1(2 downto 0); when ”00000110"=>result(0)〈=opr1(0); result(1)<=opr1(0);

39、 result(2)〈=opr1(0); result(3)<=opr1(0); result(4)〈=opr1(0); result(5)〈=opr1(0); result(7 downto 6)〈=opr1(1 downto 0); when "00000111”=〉result(0)<=opr1(0);

40、 result(1)〈=opr1(0); result(2)<=opr1(0); result(3)〈=opr1(0); result(4)<=opr1(0); result(5)〈=opr1(0); result(6)<=opr1(0); result(7)〈=

41、opr1(0); when others=>result〈=”00000000"; flag<='1’;-—error end case; when”1011"=〉——”SAR” case opr2 is when "00000000”=>result<=opr1; when ”00000001”=>result(7)〈=opr1(7);

42、 result(6 downto 0)〈=opr1(7 downto 1); when ”00000010"=〉result(7)<=opr1(7); result(6)〈=opr1(7); result(5 downto 0)〈=opr1(7 downto 2); when "00000011"=〉result(7)〈=opr1(7); result(6)〈=opr1(7)

43、 result(5)<=opr1(7); result(4 downto 0)〈=opr1(7 downto 3); when "00000100"=〉result(3 downto 0)〈=opr1(7 downto 4); result(4)〈=opr1(7); result(5)〈=opr1(7);

44、 result(6)〈=opr1(7); result(7)〈=opr1(7); when "00000101"=>result(7)〈=opr1(7); result(6)〈=opr1(7); result(5)〈=opr1(7); result(4)<=opr1(7);

45、 result(3)〈=opr1(7); result(2 downto 0)〈=opr1(7 downto 5); when ”00000110”=〉result(7)〈=opr1(7); result(6)<=opr1(7); result(5)〈=opr1(7); result(4)<=opr1(7);

46、 result(3)〈=opr1(7); result(2)<=opr1(7); result(1 downto 0)<=opr1(7 downto 6); when "00000111”=〉result(7)〈=opr1(7); result(6)〈=opr1(7); result(5)〈=opr1(7);

47、 result(4)〈=opr1(7); result(3)〈=opr1(7); result(2)〈=opr1(7); result(1)<=opr1(7); result(0)〈=opr1(7); when others=〉result<=”00000000";

48、 flag<='1'; end case; when"1100”=>—-”SLL” case opr2 is when "00000000”=〉result<=opr1; when "00000001”=〉result(0)〈=’0’; result(7 downto 1)〈=opr1(6 downto 0); when "00000010"=〉result(1 dow

49、nto 0)〈=”00"; result(7 downto 2)<=opr1(5 downto 0); when "00000011”=>result(2 downto 0)<=”000”; result(7 downto 3)〈=opr1(4 downto 0); when "00000100”=〉result(3 downto 0)〈=”0000"; result(7 d

50、ownto 4)〈=opr1(3 downto 0); when "00000101"=〉result(4 downto 0)<="00000"; result(7 downto 5)<=opr1(2 downto 0); when ”00000110”=>result(5 downto 0)<=”000000"; result(7 downto 6)〈=opr1(1 downto 0); when

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服