Before proceeding to relationship between binary, decimal, octal and hexadecimal number system we need to understand the concept of Binary Number Formats.
Binary numbers are represent as a sequence of bits (bits is short for binary digits). We have defined boundaries for these bits. These boundaries are:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoDRanjNrC-YqCze1MAA9J1oacRbR4NxIPQMKYo1p_-VLXHBkKSyBr6cM1v4VLNDLiu69h8Il7RlcPy3YjRDqR6sUYU8tYC3BCoL92DN95KjNZMUHyXsAwHGnfatbqXwYswVsbQZtLP53u/s1600/Binary+formats.png)
In any number base, we may add as many leading zeros as we wish without changing its value. However, we normally add leading zeros to adjust the binary number to a desired size boundary. For example we can represent the number five as:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCHGMIbPMqIpNn345x3q1FLz3pqdA0Xdqvf__ztrPrTmT_KagEbQK4LMv15PJ7vfTCoiJym7eT_ADBk7879dz9gchKtNSlljdpVGQdzAlUa74PPkhE348AgrNpdGlpPNDdYbmJfMiN1N3o/s1600/Binary+formats1.png)
The Bit:
- The smallest "unit" of data is defined as a single bit.
- With a single bit we can represent any two distinct items like true or false, on or off, male or female. right or wrong etc.
The Nibble:
- A nibble is a combination of four bits. It would be not be particularly interesting data structure except for two items: BCD (binary coded decimal) numbers and hexadecimal (base 16) numbers because it takes four bits to represent a single BCD or hexadecimal digit.
- With a nibble, we can represent upto 16 distinct values.
- The structure of nibble is as shown below; with b3 acting as MSB and b0 as LSB.
The Byte:
- A byte is a combination of 8-binary bits.
- The number of distinct values represented by a byte is 256, ranging from 00000000 to 11111111.
- The structure of a byte is shown below. Bit b7 is the MSB and b0 is the LSB.
- A byte contains two nibbles. Bits b0 to b3 comprise the low order nibble whereas bits b4 to b7 comprise the higher order nibble.
- Byte is the most important data structure. It is the smallest addressable datum (data item) in the microprocessor.
The Word:
- A word is a combination of 16 bits.
- Hence it consists of two bytes. The format of a word is shown below.
- Bits b0 through b7 form the lower order byte, whereas bits b8 through b15 form the higher order byte. We can also represent the word as combination of four nibbles.
Relation between Binary, Decimal, Octal and Hexadecimal Numbers
Hexadecimal numbers are compact and easy to read. It is very easy to convert numbers from binary system to hexadecimal system and vice versa, every nibble (4 bits) can be converted to a hexadecimal digit using the table shown below.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMSKv6kV34tTkv6KTdCQFSInURiy8t1EQjPzKsM-3IFdTEnSfrULEG1vRUs_v_IQc_Uzr8C_haGuDd4re6sq4Jsw-bhgnKVyzuiYFeazilYxUH-zLzyQJKvYTkzsPapBL4F7duGeuW6h8J/s1600/Relation+between+number+systems.png)
If the hexadecimal numbers are to be converted into binary then, each hex digit should be considered separately and converted into an equivalent 4 bit binary number as shown in table below:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEKLrMM-4DLxIin0H09n2t-ddUK9pgS8vG_JyO4dH8wNE7GHzLg1zYzn3NfJqrkp8vpEO5IBpZuXH4xFSet33PjD4hKMzcJ8cXYuwVYXI7luQ6TRnMbWFtrrjEUC6Tpm89mn_4BiriTbu0/s1600/Hex+to+binary.png)
Post a Comment