E1C07 09/14/2010
14:43:49 Page 270
Using this scheme, bit M À 1 is known as the most significant bit (MSB) because its contribution to
the numerical level of the word is the largest relative to the other bits. Bit 0 is known as the least
significant bit (LSB). In hexadecimal (base 16), a sequence of 4 bits is used to represent a single
digit, so that the 2
4 different digits (0 through 9 plus A through F) form the alphabet for creating a
word.
Several binary codes are in common use. In 4-bit straight binary, 0000 is equivalent to analog
zero and 1111 is equivalent to decimal 15 or hexadecimal F. Straight binary is considered to be a
unipolar code because all numbers are of like sign. Bipolar codes allow for sign changes. Offset
binary is a bipolar code with 0000 equal to À7 and 1111 equal to +7. The comparison between these
two codes and several others is shown in Table 7.1. In offset binary there are two zero levels, with
true zero being centered between them. Note how the MSB is used as a sign bit in a bipolar code.
The ones- and twos-complement binary codes shown in Table 7.1 are both bipolar. They differ
in the positioning of the zero, with the twos-complement code containing one more negative level
(À8) than positive (+7). Twos-complement code is widely used in digital computers. The bipolar
AVPS code uses the MSB as the sign bit but uses the lower bits in a straight binary representation; for
example, 1100 and 0100 represent À4 and +4, respectively.
A code often used for digital decimal readouts and for communication between digital
instruments is binary coded decimal (BCD). In this code, each individual digit of a decimal
number is represented separately by its equivalent value coded in straight binary. For example, the
three digits of the base 10 number 532 10 are represented by the BCD number 0101 0011 0010 (i.e.,
binary 5, binary 3, binary 2). In this code each binary number need span but a single decade, that is,
have values from 0 to 9. Hence, in digital readouts, when the limits of the lowest decade are
exceeded, that is, 9 goes to 10, the code just carries into the next higher decade.
Table 7.1 Binary Codes (Example: 4-Bit Words)
Bits
(Hex) Straight
Offset
Twos Complement
Ones Complement
AVPS
1
0000
0
À7
þ0
þ0
À0
0001
1
À6
þ1
þ1
À1
0010
2
À5
þ2
þ2
À2
0011
3
À4
þ3
þ3
À3
0100
4
À3
þ4
þ4
À4
0101
5
À2
þ5
þ5
À5
0110
6
À1
þ6
þ6
À6
0111
7
À0
þ7
þ7
À7
1000
8
þ0
À8
À7
þ0
1001
9
þ1
À7
À6
þ1
1010
A
þ2
À6
À5
þ2
1011
B
þ3
À5
À4
þ3
1100
C
þ4
À4
À3
þ4
1101
D
þ5
À3
À2
þ5
1110
E
þ6
À2
À1
þ6
1111
F
þ7
À1
À0
þ7
1
AVPS, absolute-value plus-sign code.
270 Chapter 7 Sampling, Digital Devices, and Data Acquisition
Précédent

- 282/605

Suivant