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/

I'm an enthusiast with a deep understanding of binary numbers and their application in computer science. My expertise extends to the practical aspects of converting letters to binary code, decoding binary numbers, and understanding the fundamental concepts involved. Let me delve into the key concepts presented in the article:

  1. Binary Representation of Letters: Computers use binary code to represent characters, including letters. For instance, the letter A is represented as the eight-character binary number 01000001. This binary representation is crucial for computers to process and manipulate textual data.

  2. ASCII Conversion: The ASCII (American Standard Code for Information Interchange) chart is a foundational tool in this context. It assigns a unique decimal number to each character, including uppercase and lowercase letters, numbers, spaces, and special characters. The ASCII number for a character is then used to calculate its corresponding eight-character binary representation.

  3. Binary Number Structure: Binary numbers consist of eight characters, where each character is either a 1 or 0. The position of each 1 represents a specific value, following a doubling pattern (1, 2, 4, 8, 16, 32, 64, 128). The sum of these values for a given binary number corresponds to the ASCII decimal value of the represented character.

  4. Binary to Decimal Conversion: To determine the decimal value of a binary number, add up the values corresponding to each position of the 1s in the eight-character binary code. For example, the binary number 01000001 represents the decimal value 65 (64 + 1), which corresponds to the letter A in ASCII.

  5. Converting Letters to Binary: The process involves looking up the ASCII number for a specific letter, then converting that ASCII number into its eight-character binary representation using the binary number structure.

  6. Pseudo-Code for Binary Number Converter: The article briefly touches on creating a software application for automatic conversions between letters and binary numbers. The suggested pseudo-code involves breaking down words into letters, looking up ASCII values, and converting them into binary numbers.

  7. Binary Decoding Exercise: The article presents a binary sequence (01000011 01000001 01010100) and challenges readers to decode it. This exercise reinforces the understanding of converting binary numbers back to letters using the ASCII chart.

  8. Bonus Section - Binary Number Puzzle: The article includes a bonus puzzle where readers are encouraged to decode a set of binary numbers (01000011 01101111 01100100...). This challenges readers to apply their knowledge of binary-to-decimal conversion.

  9. Bonus Bonus Section - Decimal to Binary Conversion: A hint is provided for converting any letter into a binary number using a calculator and the binary number chart. The importance of considering remainders and the relationship between binary values is highlighted.

  10. Additional Resources: The article concludes by providing additional resources, including an Excel spreadsheet for binary number visualization and calculation, a binary numbers worksheet in both Excel and PDF formats, a binary converter tool, and links to further tutorials and references on binary numbers and ASCII.

For those interested in exploring binary numbers further or honing their skills, these resources offer practical tools and information to deepen their understanding of this foundational concept in computer science.

1 and 0 – beanz Magazine (2024)
Top Articles
Latest Posts
Article information

Author: Kareem Mueller DO

Last Updated:

Views: 6052

Rating: 4.6 / 5 (46 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Kareem Mueller DO

Birthday: 1997-01-04

Address: Apt. 156 12935 Runolfsdottir Mission, Greenfort, MN 74384-6749

Phone: +16704982844747

Job: Corporate Administration Planner

Hobby: Mountain biking, Jewelry making, Stone skipping, Lacemaking, Knife making, Scrapbooking, Letterboxing

Introduction: My name is Kareem Mueller DO, I am a vivacious, super, thoughtful, excited, handsome, beautiful, combative person who loves writing and wants to share my knowledge and understanding with you.