为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

融资租赁担保合同协议

2020-11-11 1页 doc 18KB 267阅读

用户头像

办公小二二子

暂无简介

举报
融资租赁担保合同协议 CHAPTER 2 NUMBER SYSTEMS, OPERATIONS, AND CODES 数字系统、运算和编码 一般来说,二进制计数系统和数字编码是计算机和数字电子的基础。本章主要内容是二进制计数系统以及它和其他计数系统之间的关系,比如十进制、十六进制和八进制。同时也介绍了使用二进制数的算术运算,另外还介绍了一些数字编码,比如BCD,格雷码以及ASCII. 2-1 DECIMAL NUMBERS 十进制数 Introductory Paragraph You are familiar w...
融资租赁担保合同协议
CHAPTER 2 NUMBER SYSTEMS, OPERATIONS, AND CODES 数字系统、运算和编码 一般来说,二进制计数系统和数字编码是计算机和数字电子的基础。本章主要是二进制计数系统以及它和其他计数系统之间的关系,比如十进制、十六进制和八进制。同时也介绍了使用二进制数的算术运算,另外还介绍了一些数字编码,比如BCD,格雷码以及ASCII. 2-1 DECIMAL NUMBERS 十进制数 Introductory Paragraph You are familiar with the decimal number system because you use decimal numbers every day. Although decimal numbers are commonplace, their weighted structure is often not understood. In this section, the structure of decimal numbers is reviewed. Their review will help you more easily understand the structure of the binary number system, which is important in computers and digital electronics. 了解十进制数的构成(如何加权) Decimal Review Numbers consist of a bunch of digits, each with a weight. These weights are all powers of the base, which is 10. We can rewrite this: To find the decimal value of a number, multiply each digit by its weight and sum the products. 权重 Nothing Special about 10! Decimal system (and the idea of “0”) was invented in India around 100-500AD. Why did they use 10? Anything special about it? Not really. Probably the fact that we have 10 fingers influenced this. Will a base other than 10 work? Sure. What about base 2? 2-2 BINARY NUMBERS 二进制数 Introductory Paragraph The binary number system is simply another way to represent quantities. The binary system is less complicated than the decimal system because it has only two digits. It may seem more difficult at first because it is unfamiliar to you. The decimal system with its ten digits is a base-ten system; the binary system with its two digits is a base-two system. The two digits (bits) are 1 and 0. The position of a 1 or 0 in a binary number indicates its weight, or value within the number, just as the position of a decimal digit determines the value of that digit. The weights in a binary number are based on powers of two. Counting in Binary A binary count of 0 through 15 is shown below. As you will see, 4 bits are required to count from 0 to 15. Counting Tennis Balls Going into a box from a Conveyor Belt The counter counts the pulses from a sensor that detects the passing of a ball and produces a sequence of logic levels (digital waveforms) on each of its four parallel outputs. Each set of logic levels represent a 4-bit binary number. The decoder decodes each set of four bits and converts it to the corresponding decimal number in the 7-segment display. The Weighting Structure of Binary Numbers A binary number is a weighted number(加权数). The right-most bit is the LSB(最低有效位) in a binary whole number and has a weight of 20=1. The weights increase from right to left by a power of two for each bit. The left-most bit is the MSB(最高有效位). Fractional numbers(小数) can also be represented in binary by placing bits to the right of the binary point. The left-most bit is the MSB in a binary fractional number and has a weight of 2-1=0.5. The fractional weights decreases from left to right by a negative power of two for each bit. The weight structure of a binary number is LSB---Least significant bit MSB---Most significant bit Binary-to Decimal Conversion The decimal value of any binary number can be found by adding the weights of all bits that are 1 and discarding the weights of all bits that are 0. 2-3 DECIMAL-TO-BINARY CONVERSION Repeated Division-by-2 Method A systematic method of converting whole numbers from decimal to binary is the repeated devision-by-2 process. Repeated Multiplication-by-2 Method A systematic method of converting fractional numbers from decimal to binary is the repeated multiplication-by-2 process. 2-4 BINARY ARITHMETIC 二进制算术 Binary Addition The four basic rules for adding binary digits (bits) are as follows: 0 + 0 = 0 Sum of 0 with a carry of 0 0 + 1 = 1 Sum of 1 with a carry of 0 1 + 0 = 1 Sum of 1 with a carry of 0 1 + 1 = 0 Sum of 0 with a carry of 1 [Example] Add 1111 and 1100. Binary Subtraction The four basic rules for subtraction binary digits (bits) are as follows: 0 - 0 = 0 Difference of 0 with a borrow of 0 0 - 1 = 1 Difference of 1 with a borrow of 1 1 - 0 = 1 Difference of 1 with a borrow of 0 1 - 1 = 0 Difference of 0 with a borrow of 0 [Example] Subtract 100 from 111. Binary Multiplication The four basic rules for multiplication binary digits (bits) are as follows: [Example] Multiply 1101 by 1010. Binary Division Division in binary follows the same procedure as division in decimal. [Example] Divide 1100 by 100. 2-5 1‘S AND 2’S COMPLEMENTS OF BINARY NUMBERS 二进制的反码和补码 反码和补码 二进制的反码和补码是很重要的,因为它们允许达负数。补码算术方法广泛应用于计算机中用以处理负数。 Finding the 1’s Complement of a Binary Number The 1’s complement of a binary number is found by changing all 1s to 0s and all 0s to 1s. [Example] Find the 1’s complement of binary number 10110010. Finding the 2’s Complement of a Binary Number The 2’s complement of a binary number is found by adding 1 to the 1’s complement. [Example] Find the 2’s complement of binary number 10110010. 2-6 SIGNED NUMBERS 带符号数 带符号数 在二进制中,带符号整数有三种表达方式:符号数值、反码以及补码 The Sign Bit The left-most bit in a signed binary number is the sign bit, which tells you whether the number is positive or negative. A 0 is for positive, and a 1 is for negative. 符号位 Sign-Magnitude System When a signed binary number is represented in sign-magnitude, the left-most bit is the sign bit and the remaining bits are the magnitude bits. The magnitude bits are in true (uncomplemented) binary for both positive and negative numbers. The decimal values are determined by summing the weights in all the magnitude bit positions where there are 1s. The sign is determined by examination of the sign bit. 符号数值形式 Sign-Magnitude System [Example 2-15] Determine the decimal value of this signed binary number expressed in sign-magnitude: 10010101. 1’s Complement System Positive numbers in the 1’s complement system are represented the same way as the positive sign-magnitude numbers. Negative numbers, however, are the 1’s complements of the corresponding positive numbers. The decimal values of positive numbers are determined by summing the weights in all bit positions where there are 1s. The decimal values of negative numbers are determined by summing the weights in all bit positions where there are 1s, and adding 1 to the result. The weight of the sign bit is given a negative value. 反码形式 #以反码形式表示正数的方式和以符号数值形式表示正数的方式是一致的。 #负数是其相应正数的反码 #如何表示成十进制数 1’s Complement System Why? 1’s Complement System [Example 2-16] Determine the decimal value of the signed binary numbers expressed in 1’s complement: (a) 00010111 (b) 11101000. 2’s Complement System Positive numbers in the 2’s complement system are represented the same way as in sign-magnitude and 1’s complement systems. Negative numbers are the 2’s complements of the corresponding positive numbers. The decimal values are determined by summing the weights in all bit positions where there are 1s. The weight of the sign bit is given a negative value. 补码形式 计算机在所有的算术运算中都使用负整数的补码形式,原因是减去某个数和加上这个数的补码是一致的。 #以补码形式表示正数的方式和以符号数值形式表示正数的方式是一致的 #负数是相应正数的补码 #如何表示成十进制 2’s Complement System [Example 2-17] Determine the decimal value of the signed binary numbers expressed in 2’s complement: (a) 01010110 (b) 10101010. 2’s Complement Advantage To convert to decimal The 2’s complement system simply requires a summation of weights regardless of whether the number is positive or negative. The sign-magnitude system requires two steps – sum the weights of the magnitude bits and examine the sign bit to determine if the number is positive or negative. The 1’s complement system requires adding 1 to the summation of weights for negative numbers but not for positive numbers. Also, the 1’s complement system is not used because two representations of zero (00000000 or 11111111) are possible. The Development The 2’s complement of an n-bit number x is defined by For example, if n=8, then The Development and Range of Signed Integer Numbers The number of different combinations of n bits is For 2’s complement signed numbers, the range of value for n-bit numbers is 能够表示的带符号整数的范围 By the Way The 8-bit grouping has been given the special name byte. Bit Grouping Name 4-bit Nibble 8-bit Byte 16-bit Word 32-bit Double word Floating-Point Numbers(浮点数) Not required! 2-7 ARITHMETIC OPERATIONS WITH SIGNED NUMBERS 带符号数的算术运算 Addition(加法) The two numbers in an addition are the addend(加数) and the augend(被加数). The results are the sum (和)and the carry(进位). The addition process is stated as follows: add the two numbers and discard any final carry bit. [Example] (a) 00000111 + 00000100 = ? (b) 00001111 + 11111010 = ? (c) 00010000 + 11101000 = ? (d) 11111011 + 11110111 = ? Overflow Condition(溢出条件) When two numbers are added and the number of bits required to represent the sum exceeds the number of bits in the two numbers, an overflow results as indicated by an incorrect sign bit. An overflow can occur only when both numbers are positive or both numbers are negative. [Example] (a) 01111101 + 00111010 = ? (b) 10001000 + 11101101 = ? Subtraction(减法) The two numbers in a subtraction are the subtrahend(减数) and the minuend(被减数). The results are the difference(差) and the borrow(借位). The subtraction process is stated as follows: take the 2’s complement of the subtrahend and add. Disiscard any final carry bit. [Example] (a) 0001000 - 00000011 = ? (b) 11100111 - 00010011 = ? Multiplication(乘法) The two numbers in a multiplication are the multiplier(乘数) and the multiplicand(被乘数). The result is the product(积). The multiplication operation in most computers is accomplished using partial product method(部分积方法). The basic steps in the process are as follows: Determine if the signs of the two numbers are the same. This determines what the sign of the product will be. Change any negative number to true (uncomplemented) form. Starting with the LSB of the multiplier, generate the partial products. Shift each successive partial product one bit to the left. Add each partial product to the sum of the previous partial products to get the final product. If the sign of the product is negative, take the 2’s complement of the product. Attach the sign bit to the product. Multiplication [Example 2-22] Multiply the signed binary number 01010011 and 11000101. Division (除法) The two numbers in a division are the divisor(除数) and the dividend(被除数). The results are the quotient(商) and the remainder(余数). The basic steps in a division the process are as follows: Determine if the signs of the two numbers are the same. This determines what the sign of the quotient will be. Initialize the quotient to zero and initialize the partial remainder to the dividend. Subtract the divisor from the partial remainder using 2’s complement addition to get the next partial remainder. If the result is positive, add 1 to the quotient and repeat for the next partial remainder; otherwise, the division is complete. 除数在被除数中能够被减去的次数等于商。 Division [Example 2-23] Divide 01100100 by 00011001. 2-8 HEXADECIMAL NUMBERS(十六进制数) Why Hexadecimal? As you are probably aware, long binary numbers are difficult to read and write because it is easy to drop or transpose a bit. Since computers and microprocessors understand only 1s and 0s, it is necessary to use these digits when you program in machine language. The hexadecimal number system has 16 digits and is used primarily as a compact way of displaying or writing binary numbers because it is very easy to convert between binary and hexadecimal. 10 numeric digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) and 6 alphabetic characters (A, B, C, D, E, F) make up the hexadecimal number system. Relationship between hexadecimal and binary Each hexadecimal digit represents a 4-bit binary number. Binary-to-Hexadecimal Conversion Very straightforward! Simply break the binary number into 4-bit groups, starting at the right-most bit and replace each 4-bit group with the equivalent hexadecimal symbol. [Example 2-24] Convert the following binary numbers to hexadecimal: (a) 1100101001010111 (b) 111111000101101001 Hexadecimal-to-Binary Conversion Very straightforward! Simply replace each hexadecimal symbol with the equivalent 4-bit group. [Example 2-25] Determine the binary numbers for the following hexadecimal numbers: (a) 10A4h (b) CF8Eh (c) 9742h Hexadecimal-to-Decimal Conversion Multiply the decimal value of each hexadecimal digit by its weight and then take the sum of these products. [Example 2-27] Convert the following hexadecimal numbers to decimal: (a) E5h (b) B2F8h Decimal-to-Hexadecimal Conversion Repeated division of a decimal number by 16 will produce the equivalent hexadecimal number. [Example 2-28] Convert the decimal number 650 to hexadecimal by repeated division by 16. 还有八进制数( OCTAL NUMBER) 2-10 BINARY CODED DECIMAL (BCD) Introductory Paragraph Binary coded decimal (BCD) is a way to express each of the decimal digits with a binary code. Since there are only ten code groups in the BCD system, it is very easy to convert between decimal and BCD. Because we like to read and write in decimal, the BCD code provides an excellent interface to binary systems. Examples of such interfaces are keypad inputs and digital readouts. 二-十进制编码BCD是一种以二进制编码表示每一个十进制数字的方法。在BCD系统中,只有10个编码小组,所以很容易在十进制和BCD之间进行变换。 The 8421 Code The 8421 code is a type of BCD code. BCD means that each decimal digit, 0 through 9, is represented by a binary code of four bits. The designation 8421 indicates the binary weights of the four bits. 1010, 1011, 1100, 1101, 1110, and 1111 are invalid codes. The 8421 code is the predominant BCD code, and when we refer to BCD, we always mean the 8421 code unless otherwise stated. The 8421 Code To express any decimal number in BCD, simply replace each decimal digit with the appropriate 4-bit code. [Example 2-33] Convert each of the following decimal numbers to BCD. (a) 35 (b) 98 (c ) 170 (d) 2469 To determine a decimal number from a BCD number, start at the right-most bit and break the code into groups of four bits, then write the decimal digit represented by each 4-bit group. [Example 2-34] Convert each of the following BCD codes to decimal: (a) 10000110 (b) 001101010001 (c) 1001010001110000 BCD Addition BCD is a numerical code and can be used in arithmetic operations. Here is how to add two BCD numbers: Add the two BCD numbers, using the rules for binary addition. If a 4-bit sum is equal to or less than 9, it is a valid BCD number. If a 4-bit sum is greater than 9, or if a carry out of the 4-bit group is generated, it is an invalid result. Add 6 (0110) to the 4-bit sum in order to skip the six invalid codes and returned the code to 8421. If a carry results when 6 is added, simply add the carry to the next 4-bit group. [Example] Add the BCD numbers: 00010110 + 00010101. 2-11 DIGITAL CODES AND PARITY 数字编码和奇偶校验 Parity 奇偶性 Introductory Paragraph There are many specialized codes used in digital systems. You have just learned about the BCD code; now let’s look at a few others. Some codes are strictly numeric, like BCD, and others are alphanumeric; that is, they are used to represent numbers, letters, symbols, and instructions. The code introduced in this section are the Gray code and the ASCII code. Also, the detection of errors in codes using a parity bit is covered. The Gray Code(格雷码) The Gray code is unweighted and is not an arithmetic code; that is, there are no specific weights assigned to the bit positions. The important feature of the Gray code is that it exhibits only a single bit change from one code number to the next.相邻码 Binary-to-Gray code Conversion The MSB in the Gray code is the same as the corresponding MSB in the binary number. Going from left to right, add each adjacent pair of binary code bits to get the next Gray code bit. Discard carries. Gray-to-Binary Conversion The MSB in the binary code is the same as the corresponding MSB in the Gray code. Going from left to right, add each binary code bit generated to the Gray code bit in the next adjacent position. Discard carries. Application Example A simplified diagram of a 3-bit shaft position encoder mechanism(三位轴角位置编译器) is shown below. Application Example Consider what happens if one brush (for example, the MSB brush) is slightly ahead of the others during the transition from one sector to the next. Alphanumeric Codes(字母数字编码) In the strictest sense, alphanumeric codes are codes that represent numbers and alphabetic characters (letters). Most such codes, however, also represent other characters such as symbols and various instructions necessary for conveying information. The ASCII is the most common alphanumeric code. ASCII has 128 characters represented by a 7-bit binary code. The first 32 are nongraphic characters (control characters). That are never printed or displayed and used only for control purposes. The others are graphic characters that can be printed or displayed and include the letters of the alphabet (lowercase and uppercase), the ten decimal digits, punctuation signs, and other commonly used symbols. Parity Method for Error Detection (用于错误的奇偶校验法) Many systems use a parity bit as a means for bit error detection. Any group of bits contain either an even or an odd number of 1s. A parity bit is attached to a group of bits to make the total number of 1s in a group always even or always odd. An even/odd parity bit makes the total number of 1s even/odd. Homework Problems: 4,6,12,16,20,22,26,32,48,54 一般来说,二进制计数系统和数字编码是计算机和数字电子的基础。本章主要内容是二进制计数系统以及它和其他计数系统之间的关系,比如十进制、十六进制和八进制。同时也介绍了使用二进制数的算术运算,另外还介绍了一些数字编码,比如BCD,格雷码以及ASCII. 了解十进制数的构成(如何加权) 权重 LSB---Least significant bit MSB---Most significant bit 二进制算术 反码和补码 二进制的反码和补码是很重要的,因为它们允许表达负数。补码算术方法广泛应用于计算机中用以处理负数。 带符号数 在二进制中,带符号整数有三种表达方式:符号数值、反码以及补码 符号位 符号数值形式 反码形式 #以反码形式表示正数的方式和以符号数值形式表示正数的方式是一致的。 #负数是其相应正数的反码 #如何表示成十进制数 补码形式 计算机在所有的算术运算中都使用负整数的补码形式,原因是减去某个数和加上这个数的补码是一致的。 #以补码形式表示正数的方式和以符号数值形式表示正数的方式是一致的 #负数是相应正数的补码 #如何表示成十进制 能够表示的带符号整数的范围 除数在被除数中能够被减去的次数等于商。 还有八进制数( OCTAL NUMBER) 二-十进制编码BCD是一种以二进制编码表示每一个十进制数字的方法。在BCD系统中,只有10个编码小组,所以很容易在十进制和BCD之间进行变换。 Parity 奇偶性
/
本文档为【融资租赁担保合同协议】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索