文档详情

二进制编码选编.ppt

发布:2017-04-14约3.46千字共41页下载文档
文本预览下载声明
Exercise before class :;1、已知:1810=000100102 求其相反数的补码表示: -1810=( )2 2、用最少位数写出-4910的二进制原码、补码、反码表示。1110001,1001111,1001110 3、已知:100111012是某个数的补码表示,问其用十进制的表达为? -99 4、分别以符号-数值数制、反码、补码将-24表示为一个8位数11100111;Review of last class;Sum up for the Complement (总结);Sum up for the Complement (总结);2.6 Two’s – Complement Addition and Subtraction (二进制补码的加法和减法);4 bits binary number;0000;0000;0000; ;What is most interesting is that we can also subtract n (or add -n) by moving the arrow 16 - n positions clockwise. Notice that the quantity 16 - n is what we defined to be the 4-bit two’s complement of n, that is, the two’s-complement representation of -n. (P41); -5 1011 +7 0111 + -6 + 1010 + +3 +0011; 2.6.3 Overflow(溢出)(P41) 如果加法运算产生的和超出了数制表示的范围,则结果发生了溢出(Overflow)。 对于二进制补码,加数的符号相同,和的符号与加数的符号不同。(C in 与 C out 不同) 对于无符号二进制数,若最高有效位上发生进位或借位,就指示结果超出范围。 -5 1011 + -6 + 1010 -11 10101 = +5 +7 0111 + +3 + 0011 +10 1010 = -6 ; 2.6.3 Overflow(溢出)(P41) 如果加法运算产生的和超出了数制表示的范围,则结果发生了溢出(Overflow)。 Addition of two numbers with different signs can never produce overflow, but addition of two numbers of like sign can . An addition overflows if the signs of the addends’ signs are the same but the sum’s sign is different from the addends’ sign. ;2.6.3 the rule for detecting overflow (溢出的判断规则)(P41) ; EXAMPLES OF OVERFLOW;Code(编码);Code(编码) A set of n-bit strings in which different bit strings represent different numbers or other things is called a code. (代表某数或事物的一组n位二进制码。) three data units:(3种数据单位) bit byte word ;Byte and Word Length;a decimal number is represented in a digital system by a string of bits, where different combinations of bit- values in the string represent different decimal numbers. 在数字系统(Digital System)中用位串(Bit
显示全部
相似文档