Logo Passei Direto
Buscar
Material
páginas com resultados encontrados.
páginas com resultados encontrados.

Prévia do material em texto

Step of 5 2.022E The range an integer is in the range of Consider the definition of [x] which is two's complement representation of an integer X: ifx20 (1) ifx [x]+[y]modulo 2" 2"modulo 2" [x]+[y]modulo 2" (11) Rewrite the equation (11) using the equation express the negative number in two complement form as follows, [x]+[y]modulo2" =[x+y] Thus, the two complement's additional rule when adding negative integer and positive integer is proved. Step 4 of 5 Case III: Consider positive integer and negative integer y. its two complement representation from equation (1) and (2). [x]=x=|x| (12) (13) Summation of the equation (2) and (3): Take modulus operation to the base 2" on both sides of the equation [x]+[y]modulo 2" 2" [x]+[y]modulo 2" 2" (14) Modulus operation returns the remainder of the division operation. hence the two complement of greater than 0. Hence 2" is greater than Since the modulus operation is distributive over addition, rewrite the equation (14) follows [x]+[y]modulo 2" [x]+[y]modulo 2" (15) In equation (15), consider the absolute value considering the variables along with the sign we can write the equation follows, Thus, the two complement's additional rule when adding positive integer and negative integer is proved. Step Case IV: Let us consider both and are positive integers and their maximum values are From the definition of [x] in the equation (1) and [y] in the equation (2), (16) (17) Summation of the equations (16) and (17): Take modulus operation to the base 2" on both sides. [x]+[y]modulo 2" =x+y modulo 2" (18) Modulus operation returns the remainder of the division operation. The Right hand side of equation (18), is always less than 2" because and y only take the values less than In complement addition carry is discarded. When the number of bits of the addition result is n+1 then leftmost first bit is discarded from the [x]+[y]modulo =[x+y] Example for this proof: Let us consider 4 bit positive numbers. Their maximum values of positive decimal numbers are 7. So the resultant of these positive integers is 14; which is also a4 -bit. Hence, the statement is true for the four possible cases of addition operation over complement of signed

Mais conteúdos dessa disciplina