A what is the binary representation of b what is the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: bit representation Ü ½ ܼ . We claim that ܼ Ü ¾ . To see this, by Equation 2.1, we have ÈÛ ½ ¼ ÈÛ ½ Ü ¾ and ܼ¼ È ½ Ü ¾ . We can therefore write Ü as Ü ¾ ܼ · ܼ¼ . Ü ¼ ܾ,Ü ¼ 2.3. INTEGER ARITHMETIC Observe that ¼ 65 ¾ Ü ¾ ܼ¼ ܼ · ܼ¼ ¾ È ½ ¾ ¼ ܼ · ܼ¼ ¾ ¼ ½ , and hence ¼ ܼ . ܼ¼ Û ¾ , implying that Û Ü¼¼ ¾ ¼ . Therefore Observe that performing a logical right shift of bit vector ¼ Û Û This bit vector has numeric value ܼ . That is, logically right shifting an unsigned number by is equivalent to dividing it by ¾ . Therefore, for unsigned variable x, the C expression x >> k is equivalent to x / pwr2k, where pwr2k equals ¾k . Now consider the effect of performing an arithmetic right shift on a two’s complement number. Let Ü be the two’s complement integer represented by bit pattern ÜÛ ½ ÜÛ ¾ ܼ , and be in the range ¼ Û. Let ܼ be the two’s complement number represented by the Û bits ÜÛ ½ ÜÛ ¾ Ü , and ܼ¼ be the unsigned number r...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online