# 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.

![](https://1200419583-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LKbpNQDFNJap9OTDSt6%2F-LKmB6Dl_tx0sQ2b6Yv-%2F-LKmSp0bT1KDLoDDLIqh%2FDecimal.png?alt=media\&token=8a318c2f-03b6-441f-be7b-4ccb1e74211b)

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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
