> For the complete documentation index, see [llms.txt](https://www.pranaypourkar.co.in/the-programmers-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pranaypourkar.co.in/the-programmers-guide/algorithm/bit-manipulation/number-system.md).

# Number System

## About

Number systems are methods for representing numbers in a consistent manner. They are essential for various fields, including mathematics, computer science, and engineering. There are 4 commonly used system i.e. Decimal, Binary, Octal, and Hexadecimal.

## Decimal Number System (Base 10)

### **Overview:**

* The most common number system used in daily life.
* Base 10 system, which means it has 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
* Each digit's position in a number has a value that is a power of 10.

### **Example:**

* The number 345 in decimal can be expressed as:

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-950a5e2f24aa7adbc3ed6f82e328c4e1ab42b1c9%2Fimage.png?alt=media" alt="" width="266"><figcaption></figcaption></figure>

### **Usage:**

* Used universally in everyday arithmetic and counting.

### Conversion:

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-b643a542d34cb3aad4c346657211f97d82298203%2Fimage.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

## Binary Number System (Base 2)

### **Overview:**

* Used primarily in computing and digital electronics.
* Base 2 system, with only two digits: 0 and 1.
* Each digit's position in a number has a value that is a power of 2.

### **Example:**

* The binary number 1011 can be expressed as

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-d0a2ab5ee0d3595a839cddd2b6097a3fc6f14d66%2Fimage.png?alt=media" alt="" width="461"><figcaption></figcaption></figure>

### **Usage:**

* Binary code is the fundamental language of computers.
* Used in digital circuits and data representation in computers.

### Conversion:

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-b58a03b7e0fa4640a410f2495b66c634b3b64829%2Fimage.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

## Octal Number System (Base 8)

### **Overview:**

* Base 8 system, with eight digits: 0, 1, 2, 3, 4, 5, 6, and 7.
* Each digit's position in a number has a value that is a power of 8.
* Group by 3 bits i.e. (2^3 = 8) in a binary number.

### **Example:**

* The octal number 345 can be expressed as:

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-76fd5f16f0031730d8467527f754e06e5bd43db5%2Fimage.png?alt=media" alt="" width="400"><figcaption></figcaption></figure>

### **Usage:**

* Sometimes used in computing as a more compact representation of binary-coded values.
* Historically significant in early computing systems.

### Conversion:

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-11ac8f90a83a6dfdb5dd6b62fec12ab8d04286af%2Fimage.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

## Hexadecimal Number System (Base 16)

### **Overview:**

* Base 16 system, with sixteen digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F.
* Each digit's position in a number has a value that is a power of 16.
* Group by 4 bits i.e. (2^4 = 16) in a binary number.

### **Example:**

* The hexadecimal number 1A3 can be expressed as:

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-20d4a0a5192b79cc99548153d9bda3dc650c92be%2Fimage.png?alt=media" alt="" width="458"><figcaption></figcaption></figure>

### **Usage:**

* Widely used in computer science and programming.
* Handy for representing large binary values compactly, such as memory addresses and color codes in web design.

### Conversion:

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2Fgit-blob-457ef2790abc0f04e0f2358658f8290cd75ef8c9%2Fimage.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.pranaypourkar.co.in/the-programmers-guide/algorithm/bit-manipulation/number-system.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
