Professional Documents
Culture Documents
OUTLINE
Binary-to-Decimal Conversions Decimal-to-Binary Conversions Octal Number System Hexadecimal Number System BCD Code Excess-3 Code Gray Code Alphanumeric Code Parity Method for Error Detection
Binary-to-Decimal Conversions
The binary number system is a positional system where each binary digit (bit) carries a certain weight based on its position relative to the LSB 1 1 0 1 12 (binary) 24 + 23 + 22 + 21 + 20 =16+8+2+1 =2710 (decimal)
Decimal-to-Binary Conversions
There are two ways to convert a decimal whole number to its equivalent binarysystem representation. The first method is the reverse of the process described in B-to-D. Another method uses repeated division by 2.
Cont
25 = 12 +remainder of 1 LSB 2 12 =6 +remainder of 0 2 6 =3 +remainder of 0 2 3 = 1 +remainder of 1 2 1 =0 +remainder of 1 MSB 2 2510 = 110012
Octal-to-Decimal
3728=3x(82) + 7x(81) + 2x(80) = 3x64 + 7x8 + 2x1 = 25010
Decimal-to-Octal
266 = 33 + remainder of 2 8 33 = 4 + remainder of 1 8 4 = 0 + remainder of 4 8 26610 = 4128
Octal-to-Binary
Octal Digit 0 1 2 3 4 5 6 7 Binary Equivalent 000 001 010 011 100 101 110 111
Cont
Hexadecimal
0 1 2 3 4 5 6 7 8 9 A B C D E F
Decimal
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Binary
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
BCD Code
8 7 4 1000 0111 0100 (decimal) (BCD)
Comparison of BCD and Binary 13710 = 100010012 (Binary) 13710 = 0001 0011 0111 (BCD)
Excess-3 Code
Decimal
0 1 2 3 4 5 6 7 8 9
BCD
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001
Excess-3
0011 0100 0101 0110 0111 1000 1001 1010 1011 1100
Gray Code
Decimal Binary Code Gray Code Decimal Binary Code Gray Code
0000
0000
1000
1100
0001
0001
1001
1101
0010
0011
10
1010
1111
0011
0010
11
1011
1110
0100
0110
12
1100
1010
0101
0111
13
1101
1011
0110
0101
14
1110
1001
0111
0100
15
1111
1000
Alphanumeric Code
Baca Halaman 33
Parity Bit
Parity bit: A parity bit is an extra bit that is attached to a code group that is being transferred from one location to another. The parity bit is made either 0 or 1, depending on the number of 1s that are contained in the code group.
Cont
Two different methods are used
1. Even-parity 2. Odd-parity
In the even-parity method, the value of the parity bit is choosen so that the total number of 1s in the code group (including the parity bit) is an even number.
Cont-1
The odd-parity method is used in exactly the same way except that the parity bit is chosen so the total number of 1s (including the parity bit) is an odd number. For example even-parity: A1000001 parity bit:0 odd-parity: A1000001 parity bit:1