Unformatted text preview: word is reserved for a “sign-bit” (0 is positive, 1 is negative) and the rest of the word is the magnitude of the output. Hence, the output -8 V and + 8 V differ only in the sign bit. But this is not the negative-integer convention for most computers. Most computers use “2s-complement” representation of negative integers. Forming a negative integer from a positive integer requires two steps: first, all bits in the positive integer are complemented (1’s become 0’s and 0’s become 1’s), then binary 1 is added. For instance, to get -1, start with +1 (all 0s except the lowest order bit is 1), then add binary 1. The result is all 1’s. Similarly the -2 is all 1s except the lowest-order bit of 0. Code a VI that accepts a 1-byte signed-integer number between -127 and 128 and displays the resulting bit pattern for the 2s-complement 1-byte integer....
View Full Document
- Fall '10
- Work, positive integer, simple on-or-off LEDs, 2s-complement 1-byte integer