数字逻辑2-2.ppt

上传人:hwp****526 文档编号:84481577 上传时间:2023-04-05 格式:PPT 页数:16 大小:171.50KB
返回 下载 相关 举报
数字逻辑2-2.ppt_第1页
第1页 / 共16页
数字逻辑2-2.ppt_第2页
第2页 / 共16页
点击查看更多>>
资源描述

《数字逻辑2-2.ppt》由会员分享,可在线阅读,更多相关《数字逻辑2-2.ppt(16页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、Chapter 2 Number systems and codes Unsigned and Signed numbersBinary numbers with certain width;The numbers always be set as 0.xxxxxxxx;We can take these numbers as integers for operations!MSB/LSB Unsigned numberOperations for unsigned numbers0+0=0 1+0=1 1+1=10AdditionC:carry S:sum 0A=0 1A=A Multipl

2、ication Shift-add:use adders and shift-registers;The product width will be 2n!Operations for unsigned numbersNew rule differ from addMaybe get negative number subtraction Should use signed number to express positive and negativeOperations for unsigned numbersOnce the signed numbers be used,subtracti

3、on can be made by add!Operations for unsigned numbersSubtraction rule is not necessary!Signed-magnitude code(S-M code):Signed numberSigned-magnitude code(S-M code):Add may get wrong result!Signed numberTwos complement code:Signed numberTwos complement code:Change the sign means change every bit,and

4、add 1 at LSBSigned numberConverting rules for signed numbersFrom unsigned to signed:Its MSB is changed to sign bit.The number must be a positive!Beware the overflow!Key point:A positive signed number with any code must be the same!Its MSB is“0”!From one code to another Step 1:Check the MSB(sign-bit)

5、;For positive number(MSB=0):no changes!Step 2:For negative number(MSB=1):first change its sign by the former code way;then change its sign by the next code way!Examples:From one code to another 1two numbers must be the same width,and keep the width in addition!2subtract a number means add the negati

6、ve number;Examples:1110+1010=1000 0110 0011=0110+1101=0011 Addition for signed numbersOverflow:the result exceeds the number ranges;condition:two numbers has the same sign;checking:the sign is wrong!solving:increase the data width!Examples:0101+0101=1010 1101+1010=0111Addition for signed numbersMultiplication for signed numbersOnly S-Ms code can be easy done!The sign-bit of the result is the XOR of the sign-bits of the inputs!The value-bits of the result is decided by the multiplication rules for the unsigned numbers!

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 生活常识

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁