Understanding Binary (2024)

An Introduction to the 0s and 1s

Understanding Binary (3)

Why you should read this article

Even before I learned how to code, I knew there was something called binary and that it was the language computers spoke. I assumed that at some point during my 15 week bootcamp, we would discuss the elusive 0s and 1s but I was wrong. As it turns out, the code I was writing in JavaScript was being compiled and translated into 0s and 1s as instructions for the computer to understand. You may be thinking “ok, so I do not need to know about binary or number systems to code, then why should I bother learning it at all?” Even though understanding number systems is not required to code, it remains essential to our understanding of Computer Science. If you have any interest in taking a deep dive into how computers work, your starting point should be number systems and specifically, binary.

The numbers we know, aka decimal

Understanding Binary (4)

Numbers are presented to us in something called place-value notation. This means that both the digit and its position(or place-value) must be known to determine its value.

Let’s look at this in the context of our number system. 5 by itself would be considered in the first position in our number system and therefore to determine its value we multiply it by 1 and get 5. What if the 5 is in the second position? The second positions in our number system multiplies the digit by 10, making its value 50. What if the 5 is in the third position? The third position multiplies the digit by 100, making its value 500.

I am sure most of you are saying “duh” right now. But breaking numbers down like this will help us understand other number systems we encounter. Another way of looking at the above is that each place value is determined by raising 10 to an ever increasing value (multiplying 10 by itself a certain number of times) and multiplying the result by the digit. For these reason, our number system is called base 10 or decimal. In the above examples:

5 in the first position = 5 *10⁰ = 5 * 1 = 5
5 in the second position = 5 * 10¹ = 5 * 10 = 50
5 in the third position = 5 * 10² = 5 * 100 = 500

The number 10 not only determines the order of magnitude for each place-value but also represents the number of possible values for each digit, which is 0–9. The above example only uses a single digit in different positions but what if we have multiple digits in different positions.

2 in the first position = 2*1⁰ = 2* 1 = 2
5 in the second position = 5 * 1¹ = 5 * 10 = 50
6 in the third position = 6* 1² = 6* 100 = 600
600 + 50 + 2 = 652

One thing to note is 0 which represents a position with no value, regardless of the position it is in. 0 times 10¹⁰ (10,000,000,000) is still 0. For this reason, the lowest digit that carries value is 1, not zero.

With only 10 possible digits in each position, what happens when the highest possible digit (9) increases by 1? We add the lowest digit that carries value to the next position and reset the current position to 0 or no value. In other words, 9 becomes 10.

The numbers computers know, aka binary

Understanding Binary (5)

Now that we have had a grade school math refresher and introduced some new glossary terms, we will break down binary in the same way we did our numeral system of base 10.

To begin, ask yourself what you know about binary. Odds are your answer will be that each position can only be a 0 or 1. Given what we discussed above, what base would binary be? The answer is 2. Base 2 not only means that each position can only have one of two possible digits but also that the order of magnitude of each place-value increases by powers of 2 instead of 10, as is the case with our number system.

Let us use the model from our base 10 examples to break down binary, using the number 1

1 at the first position (1) = 1 * 2⁰ = 1 * 1 = 1
1 at the second position (10) = 1 * 2¹ = 1 * 2 = 2
1 at the third position (100) =1 * 2² = 1 * 4 = 4
1 at the fourth position (1000) =1 * 2³ = 1 * 8 = 8
1 at the fifth position (10000) =1 * 2⁴ = 1 * 16 = 16

The above demonstrates how we can convert binary numbers to decimal based on 1 being at different positions and having different place-values. If the binary number is 11111, we can add all the above values up to get the total value in decimal

11111 = 1 + 10 + 100 + 1000 + 10000 = 1 + 2 + 4 + 8 + 16 = 31

Another way of looking at this is

11111 is 100000 minus 1 or
(1 * 2⁵) - 1 = 32 - 1 = 31

To make sense of this, we need to do some basic counting in binary. 0 and 1 are the only two possible numbers in each position with 1 being the number with the highest value. Starting with 0, if we add 1, we get 1 (same thing we see in decimal if we were to add 1 to 0). What happens if we add 1 to 1? Just as is the case with 9 in decimal, when we add 1 to 1 in binary, we add the lowest digit of value to the next position and reset the current position.

1 + 1 = 10

Following this pattern of increasing by 1

0
1
10
11
100
101
110
111
1000

Converting 0–100 in binary to decimal:

0= 0 * 2⁰ = 0 * 1 = 0
1= 1* 2⁰ = 1 * 1 = 1
10=(1*2¹) + (0 * 2⁰) = (1 * 2) + (0 * 1) = 2 + 0 = 2
11=(1* 2¹) + (1* 2⁰) = (1 * 2) + (1 * 1) = 2 + 1 = 3
100=(1*2²) + (0 * 2¹) + (0 * 2⁰)= (1 * 4) + (0 * 2) + (0 * 1) = 4 + 0 + 0 =4

This helps us understand binary as a number system but their true value in computers is more than simply representing decimal numbers in a different way.

Understanding Binary (6)

Turning binary in building blocks

How does a series of 0s and 1s become every computer application that has ever existed? Just as letters can be grouped to form words, words to form sentences, and sentences to form paragraphs. Binary can be grouped to represent everything from a simple decimal number (as we saw above) to complicated and elaborate instructions dictating the behavior of a character in a computer game.

Above, 0s and 1s were referred to as digits in the context of comparing binary to our number system. However, in the context of the code where binary is the foundation of every computer operation, 0s and 1s are bits. That is to say a 0 by itself is a bit and a 1 by itself is also a bit. When eight bits are grouped together, they form a byte. Finally a familiar term!

Besides numbers, one of the simplest uses of a byte is to represent a letter. This is done with the American Standard Code for Information Interchange, or ASCII, which “is a character encoding standard for electronic communication. ASCII codes represent text in computers”.

ABC: 01000001 01000010 01000011
Hello, world!: 01001000 01100101 01101100 01101100 01101111 00101100 00100000 01110111 01101111 01110010 01101100 01100100 00100001

(Make your own secret messages in binary here)

If one byte can only hold a single letter, you can imagine how many are needed for a song, movie, or game.

This is obviously and extensive topic but as the subtitle of this article says, this is meant to be an “Introduction to the 0s and 1s”, not a definitive guide. I hope this article can serve as a starting point for your own exploration into binary and other Computer Science concepts.

Understanding Binary (2024)

References

Top Articles
The best Jamie Oliver Christmas recipes
Easy Maltesers Microwave Fudge Recipe | Kitchen Mason
Rick Steves Forum
5daysON | Hoofddorp (70089000)
Minus8 Patreon
Use Caution: Herds of wild horses escaping Davis Fire spotted evacuating up Geiger Grade
Understanding British Money: What's a Quid? A Shilling?
Busted Newspaper Longview Texas
Cristiano Ronaldo's Jersey Number: The Story Behind His No. 7 Shirt | Football News
Two men arrested following racially motivated attack on Sanford teen's car
Weldmotor Vehicle.com
Sutter Health Candidate Login
Red Dead Redemption 2 Legendary Fish Locations Guide (“A Fisher of Fish”)
Honda Accord 2012 gebraucht - AutoUncle
[PDF] JO S T OR - Free Download PDF
Msft Msbill Info
Zitobox Tips And Tricks
Stanford Rival Crossword Clue
Hotfixes: September 13, 2024
Karz Insurance Quote
13.2 The F Distribution and the F Ratio - Statistics | OpenStax
Solar Smash Secret Achievements List 2023
Dumb Money Showtimes Near Regal Edwards Nampa Spectrum
Take Me To The Closest Chase Bank
3850 Colonial Blvd Suite 100 Fort Myers Fl 33966
Insulated Dancing Insoles
Fastest Lovakengj Favour
Highway 420 East Bremerton
Red Dragon Fort Mohave Az
100000 Divided By 3
The 7 Cs of Communication: Enhancing Productivity and Effectiveness
Latest News Archives - Mon Valley Independent
Myhr North Memorial
Pain Out Maxx Kratom
Anmed My Chart Login
Riverwood Family Services
Apex Item Store.com
Candy Land Santa Ana
Dr Ayad Alsaadi
Liv Morgan Wedgie
How To Get Rope In Muck
The Whale Showtimes Near Cinépolis Vista
Mychart Mountainstarhealth
Pokeclicker Pikablu
How Do I Change My Usaa Pin
1 Reilly Cerca De Mí
University Of Michigan Paging System
Bonbast قیمت ارز
Jeep Forum Cj
Summer Rae on WWE return: Royal Rumble is 'step in the right direction'
Family Court Forms | Maricopa County Superior Court
Saratoga Otb Results
Latest Posts
Article information

Author: Zonia Mosciski DO

Last Updated:

Views: 5370

Rating: 4 / 5 (71 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Zonia Mosciski DO

Birthday: 1996-05-16

Address: Suite 228 919 Deana Ford, Lake Meridithberg, NE 60017-4257

Phone: +2613987384138

Job: Chief Retail Officer

Hobby: Tai chi, Dowsing, Poi, Letterboxing, Watching movies, Video gaming, Singing

Introduction: My name is Zonia Mosciski DO, I am a enchanting, joyous, lovely, successful, hilarious, tender, outstanding person who loves writing and wants to share my knowledge and understanding with you.