# The Binary Number System

### Positional Number Systems

There are three number systems that are the most relevant to computer science:&#x20;

* **decimal (10 symbols):**  0, 1, 2, 3, 4, 5, 6, 7, 8, 9
* **binary (2 symbols):** 0, 1
* **hexadecimal (16 symbol):** 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

They are all what are called positional number systems. Positional number systems follow the same set of rules for how to count and perform computations, such as addition and subtraction. They just have a different number of symbols.

The number of symbols determines when you shift over to the next place value.

![](https://4178747114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXd9FZsxrESRpx9oFdw%2F-M_DIlr7EzrZGIgdDN4D%2F-M_HkF1w9BiYNu7-rQ-x%2Fimage.png?alt=media\&token=ed16009d-5da7-4c6f-9ec9-df25f98e96a9)

### Positional Number System Rules

* The number system has a base, which specifies how many symbols are in the system.
* The base is what determines the worth of each place value.
* Each place value is worth (base times) more than the previous place value as you move from the right to the left.

![](https://4178747114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXd9FZsxrESRpx9oFdw%2F-M_DIlr7EzrZGIgdDN4D%2F-M_GvI7rojkrjrgq6w9b%2Fimage.png?alt=media\&token=6abe1c1e-45e7-4038-bcbf-0e16d00c8f46)

![](https://4178747114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXd9FZsxrESRpx9oFdw%2F-M_DIlr7EzrZGIgdDN4D%2F-M_HnveLSGkLplLxs2fx%2Fimage.png?alt=media\&token=4d37b13f-2177-430e-b476-1f415c720fa3)

![](https://4178747114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXd9FZsxrESRpx9oFdw%2F-M_DIlr7EzrZGIgdDN4D%2F-M_HofwEfM9hUc7nPQgM%2Fimage.png?alt=media\&token=083faa6e-4d1e-440a-a5cc-a52cae65de78)

### Why are Binary and Hexadecimal Important in Computer Science?

Binary is important because computers represent all data as numbers and a computer can easily represent a binary number with a series of on and off states with electrical signals.

Using binary, eight switches can represent a number as high as 255. Using 32 switches can represent a number as high 4,294,967,295.

![https://www.youtube.com/watch?v=Xpk67YzOn5w](https://4178747114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXd9FZsxrESRpx9oFdw%2F-M_DIlr7EzrZGIgdDN4D%2F-M_HpZN1U3I7UnEqhgVM%2Fimage.png?alt=media\&token=0df6c899-aaa0-4593-820f-9fa26f82d915)

Hexadecimal is important because it is a more compact notation to represent binary numbers. Every four binary digits equals a single hexadecimal digit.&#x20;

![](https://4178747114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXd9FZsxrESRpx9oFdw%2F-M_DIlr7EzrZGIgdDN4D%2F-M_HqxW8OhI9NqTXpn9s%2Fimage.png?alt=media\&token=da637f1f-0da3-4466-b3ee-d59182fdb111)

![](https://4178747114-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXd9FZsxrESRpx9oFdw%2F-M_DIlr7EzrZGIgdDN4D%2F-M_HrLsoKFsl8nM9SxeB%2Fimage.png?alt=media\&token=d3d6b39b-2bc3-46c6-8b7c-209c0e07b7b2)



### Resources

{% embed url="https://www.youtube.com/watch?v=ewokFOSxabs" %}

{% embed url="https://www.youtube.com/watch?v=Xpk67YzOn5w" %}

{% embed url="https://www.khanacademy.org/math/algebra-home/alg-intro-to-algebra/algebra-alternate-number-bases/v/number-systems-introduction" %}

{% embed url="https://www.youtube.com/watch?v=LpuPe81bc2w" %}

{% embed url="https://screencast-o-matic.com/watch/creIqpVczJd" %}

{% embed url="https://screencast-o-matic.com/watch/creIY1Vczsc" %}

{% embed url="https://screencast-o-matic.com/watch/creojTVckNU" %}
