# Digital Circuits/Binary Systems

## Contents

## Binary Numbers[edit]

Decimal | Binary | Octal
(base 8) |
Hexadecimal
(base 16) |
---|---|---|---|

00 | 0000 | 00 | 0 |

01 | 0001 | 01 | 1 |

02 | 0010 | 02 | 2 |

03 | 0011 | 03 | 3 |

04 | 0100 | 04 | 4 |

05 | 0101 | 05 | 5 |

06 | 0110 | 06 | 6 |

07 | 0111 | 07 | 7 |

08 | 1000 | 10 | 8 |

09 | 1001 | 11 | 9 |

10 | 1010 | 12 | A |

11 | 1011 | 13 | B |

12 | 1100 | 14 | C |

13 | 1101 | 15 | D |

14 | 1110 | 16 | E |

15 | 1111 | 17 | F |

In order to convert from decimals to binary number, you must think in powers of 2. 1111= 15= 2 power 3 + 2 power 2+ 2 power 1 + 2 power 0 = 8+4+2+1=15. 2 power 5 = 32. to represent 31 in binary = 11111= 2 power 4 plus 15 as described above. Remember, the first digit is 2 power zero, which equals to one.

## Number Base Conversions[edit]

as par role

## Octal and Hexadecimal Numbers[edit]

Binary is the intrinsic number system of digital circuits, but long strings of 1s and 0s are not easy for humans to read and write. Therefore, number systems with easy conversion to and from binary were developed, including octal and hexadecimal.

The octal number system is base 8, in contrast to our native number system (decimal) which is base 10. In base 8, only the numbers 0 through 7 are used. Each octal digit can be represented by three binary bits, as shown in the conversion table above (under Binary Numbers).

Conversion between octal and binary is straightforward. To convert from octal to binary, convert each octal digit to its three-bit equivalent, and vice versa.

Similarly, the hexadecimal number system, base 16, facilitates easy conversion to and from binary. Each hexadecimal digit represents exactly four binary bits, as shown in the table above.

Note that in hexadecimal, the letters A through F are used to represent the decimal equivalent of 10 through 15, respectively.

Long strings of bits can be represented in a much more compact fashion using octal and hexadecimal. Of the two, hexadecimal is more commonly used. As each hexadecimal digit represents four bits, hexadecimal is well-suited to represent values likely to be found in modern systems (16, 32 or 64 bits). Hexadecimal values are often prefixed with the expression "0x" - for instance, 0xFF is the hexadecimal equivalent of 255.

## Complements[edit]

Binary codes. Used are 8 and 2

## Examples[edit]

### Example 1[edit]

AB78 (hexadecimal) = 1010 1101 0111 1000 (binary)

### Example 2[edit]

1F1F (hexadecimal)=0001 1111 0001 1111 (binary)