60 likes | 199 Views
Chapter 2. Conversion. Any base to decimal. ( S k-1 … S 2 S 1 S 0 . S -1 S -2 …S -L ) b. S k-1 x b k-1 + … + S 2 X b 2 + S 1 X b 1 + S 0 X b 0. S -1 x b -1 + S -2 X b -2 + … + S -L X b -L. n = . +. Decimal to any base. Convert integral part. Convert fractional part.
E N D
Chapter 2 Conversion
Any base to decimal ( Sk-1 … S2S1S0.S-1S-2…S-L ) b Sk-1 x bk-1+ … + S2 X b2+ S1X b1+ S0X b0 S-1 x b-1+ S-2 X b-2+ … + S-LX b-L n = +
Decimal to any base Convert integral part Convert fractional part In each step: - Keep the Remainder in the Destination. - Stop when Quotient =0 In each step: - Keep the Integral part in the Destination. - Stop when Fractional part =0OR destination digits are enough
Binary to Hexadecimal • Starting from the rightmost bit: • Group each 4 bits together. • Use the table. • Hexadecimal to Binary - Use the table.
Binary to Octal • Starting from the rightmost bit: • Group each 3 bits together. • Use the table. • Octal to Binary - Use the table.
Octal to Hexadecimal or vise versa Use the binary system as the intermediate system.