1 and 0 – beanz Magazine (2024)

When is the letter A not the letter A? Well, computers don't use the letter A. They use the eight character binary number 01000001 to represent A. This binary numbers tutorial describes what binary numbers are and how to calculate them.

Computers transport, calculate, and translate binary numbers because computer hardware circuits only have two electrical states, on or off. These two states can be represented as zero (off) or one (on). All letters of the alphabet, numbers, and symbols are converted to eight character binary numbers as you work with them in software on your computer.

How you create and translate binary numbers is a good way to learn how computers process data at the lowest level, in their hardware circuits.

Also, I provide a free Excel spreadsheet linked at the bottom of this article to help you visualize and calculate binary numbers.

The [Not So] Secret Formula

To represent the letter A as 01000001, the computer (and you, to follow along) Âneed several basic tools. One tool is an ASCII conversion chart. Without diving into too much technical detail, the ASCII chart maps a unique number between 1 and 255 to all letters of the alphabet capitalized (A-Z) and lower case (a-z), as well as numbers (0-9), spaces, and other special characters. The unique ASCII number that maps to each character, for example, the capital letter A, is used to calculate a unique eight-character binary number, a combination of ones and zeroes like 01000001.

It's basically a two-step secret code. The first step is to grab the unique ASCII number for a letter. The second step is to create a unique eight character binary number, a combination of ones and zeroes to represent the ASCII number.

And, of course, going from the eight character combination of ones and zeros to the letter or character reverses this process: first turn the binary number into a number between 1 and 255 then use the number to look up the letter in the ASCII chart.

How to Create Binary Numbers

Binary numbers are eight characters in length where every character is either a 1 or 0. The placement of each 1 indicates the value of that position, which is used to calculate the total value of the binary number. Each position of each of the eight characters represents a fixed number value, as shown below.

1 and 0 – beanz Magazine (1)

If you read these Default Value numbers from bottom to top, can you tell how each number immediately above is calculated? They're doubled. So binary numbers start on the bottom with the first position equal to 1. The second position from the bottom has a value 2, the third position 4, and so on.

If you add up all these numbers (1+2+4+8+16+32+64+128), can you guess what number you'll get? 255, the highest number used in the ASCII table. There is a perfect mapping between all possible numbers 1 to 255 in the ASCII table and the calculated values for all possible eight character binary numbers.

To calculate the number value of a binary number, add up the value for each position of all the 1s in the eight character number. The number 01000001, for example, is converted to 64 + 1 or 65. The ones in this binary number are in the first and seventh positions, counting from the bottom to top, or reading right to left. The first position has an assigned value of 1 while the seventh position has an assigned value of 64.

Let's Convert a Letter to a Binary Number

Now that you know the [not so] secret formula to convert letters to unique ASCII numbers to binary numbers, and how to create binary numbers, let's do the whole process step by step. Let's start with the letter C.

First, we need to use an ASCII chart like this one below to look up the unique number assigned to the uppercase letter C. The unique decimal number to use is 67.

DecimalCharacterDecimalCharacterDecimalCharacter
32Space64@96`
33!65A97a
3466B98b
35#67C99c
36$68D100d
37%69E101e
38&70F102f
3971G103g
40(72H104h
41)73I105i
42*74J106j
43+75K107k
44,76L108l
4577M109m
46.78N110n
47/79O111o
48080P112p
49181Q113q
50282R114r
51383S115s
52484T116t
53585U117u
54686V118v
55787W119w
56888X120x
57989Y121y
58:90Z122z
59;91[123{
60<92124|
61=93]125}
62>94^126~
63?95_127DEL

To convert the number for C, 67, into a binary number:

Remember how binary numbers are read bottom to top, first position and Default Value to top position and Default Value, with each of the eight character positions assigned a unique number value? With the chart below, what combination of values would equal 67?

1 and 0 – beanz Magazine (2)

You're correct if you said the Default Values 1 plus 2 plus 64 would equal 67, the ASCII number for the capital letter C. So let's change the first, second, and seventh position zeroes to ones, counted from right to left. The binary number is for the capital letter C is:

1 and 0 – beanz Magazine (3)

Can you decode this binary number? Add up the 1s to get 64+16+4 or 84. Look up the decimal number 84 in the ASCII chart to find the letter represented below:

1 and 0 – beanz Magazine (4)

If you converted this binary number to the capital letter T, you're correct. Here is the letter A as a binary number to represent the ASCII decimal number for A, which is 65:

1 and 0 – beanz Magazine (5)

If we combine the binary numbers we've looked at so far, we can spell CAT:

01000011 01000001 01010100

Bonus: Pseudo-Code to Design a Binary Number Converter

With an understanding of how letters and numbers are converted to binary numbers, and back, let's look at how we might create a software application to make these conversions on the fly. The application has no real value. But it provides a chance to discuss how a process can be converted to software.

Instead of actual code, however, we'll write up a series of statements or pseudo-code.

Let's take the word cat to start. What process do we need to convert these letters automatically into binary numbers? Here's one possible set of steps we could code:

  1. Break the word into individual letters.
  2. For each letter, look up the ASCII number value mapped to the letter.
  3. For each ASCII number value, convert to a binary number.
  4. For each binary number, save the binary number value. If it is the first binary number, create the initial binary number value; if a binary number value exists, add the new binary number to the end of the value.

Imagine if we skipped the last step: what would be the result of these steps? We'd only have the last binary number, for the lower case letter t in cat. It's important we capture each binary number as they are created.

Other observations about this pseudo-code process? We need to distinguish between capital letters and lower case letters, don't we? Otherwise, our binary number conversion might translate from binary number to ASCII letters as CAT or cAT or Cat. Our lookup to match letters to the ASCII table might grab the wrong number.

Bonus Bonus: A Final Puzzle

Can you decode the phrase in this set of binary numbers? Remember, these are eight character blocks of 1s and 0s.

01000011 01101111 01100100 01100101 01101001 01110011 01010000 01101111 01100101 01110100 01110010 01111001

Here’s a fairly easy way to convert any letter into a binary number. Grab a calculator, find the ASCII decimal value for the letter, from the chart above, then look at the binary number chart for the nearest value to the decimal value. Subtract the nearest number Default Value in the binary chart to get a remainder value. Look for the nearest binary Default Value for the remainder. Repeat until you run out of binary values.

If you’re clever, you’ll also note the sum of the values below any of the eight Default Values equals one less than the value: so below the binary value 4 are the values 2 and 1 which equal 3. Below the binary value of 8 are 4, 2, and 1 which equal 7. This also can help convert letters to binary numbers. If your remainder is 7, for example, then you know to put a 1 at the 4, 2, and 1 positions to create that part of your binary number.

To convert binary numbers to letters, just grab a piece of paper and a pen or pencil and add up the binary values of all the 1s. Then look up your total number as an ASCII decimal in the chart above.

Here’s a hint to help determine if you have solved the binary numbers above correctly: I majored in American poetry in college and love the old tagline used for WordPress publishing software.

If you want more binary numbers, check out our article about Bakuro binary number puzzles which work like Sudoku.

Learn More

Binary Number Worksheet (Excel format)

https://kidscodecs.com/binary-numbers-converter

Binary Numbers Worksheet (PDF)

https://kidscodecs.com/binary-numbers-worksheet

Binary Converter

http://www.rapidtables.com/convert/number/binary-converter.htm

A Tutorial on Binary Numbers

http://www.math.grin.edu/~rebelsky/Courses/152/97F/Readings/student-binary

Binary Numbers (Wikipedia)

https://en.wikipedia.org/wiki/Binary_number

ASCII Table

http://www.asciitable.com/

1 and 0 – beanz Magazine (2024)
Top Articles
8 Things Poor People Spend More Money on That the Rich and Middle Class Don’t
Are gold IRAs taxable?
What Did Bimbo Airhead Reply When Asked
UPS Paketshop: Filialen & Standorte
Amc Near My Location
Craigslist Vans
Kaydengodly
Bucks County Job Requisitions
Pitt Authorized User
<i>1883</i>'s Isabel May Opens Up About the <i>Yellowstone</i> Prequel
Premier Boating Center Conroe
Sport Clip Hours
Diablo 3 Metascore
2016 Ford Fusion Belt Diagram
Mineral Wells Independent School District
Colorado mayor, police respond to Trump's claims that Venezuelan gang is 'taking over'
What Happened To Anna Citron Lansky
Locate At&T Store Near Me
Niche Crime Rate
Wgu Academy Phone Number
Project, Time & Expense Tracking Software for Business
Www.publicsurplus.com Motor Pool
Craigslist Battle Ground Washington
Valic Eremit
Hctc Speed Test
Arrest Gif
Jesus Revolution Showtimes Near Regal Stonecrest
Speedstepper
Free T33N Leaks
2004 Honda Odyssey Firing Order
Frank Vascellaro
Korg Forums :: View topic
Robot or human?
Does Iherb Accept Ebt
Western Gold Gateway
Vanessa West Tripod Jeffrey Dahmer
Bimmerpost version for Porsche forum?
How To Get Soul Reaper Knife In Critical Legends
Wsbtv Fish And Game Report
NHL training camps open with Swayman's status with the Bruins among the many questions
Dr Adj Redist Cadv Prin Amex Charge
Anhedönia Last Name Origin
Gasoline Prices At Sam's Club
Promo Code Blackout Bingo 2023
Shell Gas Stations Prices
Rs3 Nature Spirit Quick Guide
4k Movie, Streaming, Blu-Ray Disc, and Home Theater Product Reviews & News
Matt Brickman Wikipedia
Suzanne Olsen Swift River
Affidea ExpressCare - Affidea Ireland
Ravenna Greataxe
Latest Posts
Article information

Author: Catherine Tremblay

Last Updated:

Views: 5387

Rating: 4.7 / 5 (47 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Catherine Tremblay

Birthday: 1999-09-23

Address: Suite 461 73643 Sherril Loaf, Dickinsonland, AZ 47941-2379

Phone: +2678139151039

Job: International Administration Supervisor

Hobby: Dowsing, Snowboarding, Rowing, Beekeeping, Calligraphy, Shooting, Air sports

Introduction: My name is Catherine Tremblay, I am a precious, perfect, tasty, enthusiastic, inexpensive, vast, kind person who loves writing and wants to share my knowledge and understanding with you.