Conversions from one system and another system

Conversion of decimal to binary • The easiest way to convert decimal to its binary equivalent is to use division algorithm. • Divide by two, keep track of the remainder at each step. • Put a remainder bit as 0, if that number gets divided by two. • Put a remainder bit as 1, if that number not divided by two. FIG 1.78: Example for Decimal to Binary Conversion • The binary equivalent of 67(10) is 1000011(2). Conversion of binary to decimal • Multiply each bit by 2n , where n is “weight” of bits. • The weight is position of the bit, which starts from 0 on the right, then 1 and goes on. • Add the result. E-Content of COURSE ON COMPUTER CONCEPTS (CCC) Page | 93 F 2 FIG 1.79: Example for Binary to Decimal Conversion • Decimal equivalent of 11010(2) is 26(10). Conversion of binary to hexadecimal • Group bits in fours, starting from the right. • Convert to hexadecimal digits • To convert 1011010111(2) to hexadecimal, just substitute the codes. FIG 1.80: Example of Binary to Hexadecimal Conversion • The hexadecimal equivalent of 1011010111(2) is 2C7(16) E-Content of COURSE ON COMPUTER CONCEPTS (CCC) Page | 94 F 2 Conversion of hexadecimal to binary • Convert each hexadecimal digit to a four bit equivalent binary representation. • To convert 10AF (16) to binary, just substitute the codes. FIG 1.81: Example for Hexadecimal to Binary Conversion • The Binary equivalent of 10AF (16) is 0001000010101111(2)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.