> For the complete documentation index, see [llms.txt](https://cs.brash.ca/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cs.brash.ca/unit-1/binary-and-logic/bits-and-bytes-binary.md).

# Bits and Bytes (Binary)

A bicycle has two wheels, a binomial has two... nomials, and we (humans) are bipedal - we have two feet! Electricity *has two states* - on (1) and off (0). This means we need a number system that allows us to count using only two digits.

{% tabs %}
{% tab title="Decimal vs. Binary" %}

### Decimal vs. Binary

Our decimal number system has ten 'digits', just like our fingers - which we also call digits (similar to 'digital' - no?). Our placeholders can have any of the digits 0 1 2 3 4 5 6 7 8 9. Once over 9, we increase the next placeholder by one and roll the 9 to 0.

![](/files/-LKmSp0bT1KDLoDDLIqh)

Since electricity can either be **on (|)** or **off (O)**, ether **flowing (1)** or **not flowing (0)**, we are unable to use the decimal system to represent numbers - ***we only have two states, not ten!***
{% endtab %}

{% tab title="Useful Media" %}

{% embed url="<https://www.youtube.com/watch?v=Xpk67YzOn5w>" %}
Why Do Computers Use 1s and 0s? Binary and Transistors Explained.
{% endembed %}

{% embed url="<https://youtu.be/ewokFOSxabs>" %}
How Computers Work - Binary and Data
{% endembed %}

{% embed url="<https://youtu.be/Sc3lh3D4rCw>" %}
How Computers Work - Circuits & Logic
{% endembed %}

**Other great videos:**\
&#x20; \- [Binary Numbers and Base Systems | As Fast as Possible](https://youtu.be/LpuPe81bc2w)\
&#x20; \- [Binary Tutorial](https://youtu.be/0qjEkh3P9RE) - written samples

{% embed url="<https://www.logic-puzzles.org/init.php>" %}
{% endtab %}
{% endtabs %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cs.brash.ca/unit-1/binary-and-logic/bits-and-bytes-binary.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
