What Is Binary?
"20 Questions" demonstrates the power of dichotomous relationships, in which something can only be one thing or another (Yes/No). Other examples of dichotomous relationships might include: a light switch, which can either be flipped on/off (not including dimmer switches), or handedness (left/right, not including ambidextrous folks), or at the most basic level, existence (something either exists or it does not).
Binary code is another example of a dichotomous relationship. Binary code is represented with the two symbols 1 and 0. In binary code, if something isn't 1 then it must be 0 and vice versa. An example of what binary code looks like is 10110. Unlike the alphabet, which uses the characters A — Z or decimal numbers, which use the digits 0 — 9, binary uses only 1s and 0s to represent something. These 1s and 0s are referred to as bits (short for binary digits), and they are foundational to digital computing.
The purpose of bits is to represent something digitally. They are how information is stored, accessed, transformed, and used by computers. Everything that we see on a computer is actually stored as bits. The letters on this screen, the images, the links, everything you see on this webpage is stored digitally as electrical switches turned off or on (typically represented as long strings of 1s and 0s) that computers can interpret and transform into symbols we understand, like numbers, letters, images, sounds, and programs.
This is, of course, an oversimplification of binary code and bits. Typically, in modern computers, the 1s and 0s we refer to are the presence or absence of electrical signals, but they don't have to be! One of the many beauties of computer science is that abstraction allows us to view many processes and systems computationally — even those not involving a "computer."
"20 Questions" demonstrates the power of dichotomous relationships, in which something can only be one thing or another (Yes/No). Other examples of dichotomous relationships might include: a light switch, which can either be flipped on/off (not including dimmer switches), or handedness (left/right, not including ambidextrous folks), or at the most basic level, existence (something either exists or it does not).
Binary code is another example of a dichotomous relationship. Binary code is represented with the two symbols 1 and 0. In binary code, if something isn't 1 then it must be 0 and vice versa. An example of what binary code looks like is 10110. Unlike the alphabet, which uses the characters A — Z or decimal numbers, which use the digits 0 — 9, binary uses only 1s and 0s to represent something. These 1s and 0s are referred to as bits (short for binary digits), and they are foundational to digital computing.
The purpose of bits is to represent something digitally. They are how information is stored, accessed, transformed, and used by computers. Everything that we see on a computer is actually stored as bits. The letters on this screen, the images, the links, everything you see on this webpage is stored digitally as electrical switches turned off or on (typically represented as long strings of 1s and 0s) that computers can interpret and transform into symbols we understand, like numbers, letters, images, sounds, and programs.
This is, of course, an oversimplification of binary code and bits. Typically, in modern computers, the 1s and 0s we refer to are the presence or absence of electrical signals, but they don't have to be! One of the many beauties of computer science is that abstraction allows us to view many processes and systems computationally — even those not involving a "computer."
Binary Converter by anaptyxis
Simple Binary Conversion with your Fingers
Now try it yourself. Use the cartoon or video to help you along, or if you prefer written instructions, here is a procedure (or algorithm) that explains how you can encode a number in the range 0-31 on one hand:
Now try it yourself. Use the cartoon or video to help you along, or if you prefer written instructions, here is a procedure (or algorithm) that explains how you can encode a number in the range 0-31 on one hand:
- The pinky represents whether the number is <16 (if not extended), or ≥16 (if extended).
- So, if it is 16 or higher, extend your pinky, subtract 16 from your number, and continue with Step 2.
- If it is lower than 16, just skip ahead to Step 2.
- The ring finger represents whether the remaining value is <8 (if not extended), or ≥8 (if extended).
- So, if it is 8 or higher, extend your ring finger, subtract 8 from your number, and continue with Step 3.
- If it is lower than 8, just skip ahead to Step 3.
- The middle finger represents whether the remaining value is <4 (if not extended), or ≥4 (if extended).
- So, if it is 4 or higher, extend your middle finger, subtract 4 from your number, and continue with Step 4.
- If it is lower than 4, just skip ahead to Step 4.
- The index finger represents whether the remaining value is <2 (if not extended), or ≥2 (if extended).
- So, if it is 2 or higher, extend your index finger, subtract 4 from your number, and continue with Step 5.
- If it is lower than 2, just skip ahead to Step 5.
- The thumb represents whether the remaining value is <1 (if not extended), or =1 (if extended).
- So, if it is 1, extend your thumb, subtract 1 from your number, and you are done (you should have 0 as a remaining value).
- You are done (you should have 0 as a remaining value).
ASCII vs Unicode
This ASCII (American Standard Code for Information Interchange) table outlines a common set of conventions established for converting between binary values and alphanumeric characters.
As you may remember, ASCII stands for American Standard Code for Information Interchange. So it probably comes as no surprise that it was designed to meet the alphabetic needs of American languages like English. However, with this narrow bias, ASCII fails to provide for the many letters and characters that are common to the multitude of other world languages beyond English. As computers have become more and more ubiquitous, and people who speak languages other than English have begun to use computers, program, and participate in social media, the need to extend this venerable standard to accommodate them has grown.
The problem, of course, is that the ASCII table allows a very limited set of symbols — seven bits' worth. In order to make room for more symbols, more bits are needed. How many are needed?
The current solution is to use the newer Unicode standard. Unicode is a binary encoding system that can represent much more of the world's text than ASCII can. Unicode allows computers to represent most of the world languages' alphabets, not just English.
As you may remember, ASCII stands for American Standard Code for Information Interchange. So it probably comes as no surprise that it was designed to meet the alphabetic needs of American languages like English. However, with this narrow bias, ASCII fails to provide for the many letters and characters that are common to the multitude of other world languages beyond English. As computers have become more and more ubiquitous, and people who speak languages other than English have begun to use computers, program, and participate in social media, the need to extend this venerable standard to accommodate them has grown.
The problem, of course, is that the ASCII table allows a very limited set of symbols — seven bits' worth. In order to make room for more symbols, more bits are needed. How many are needed?
The current solution is to use the newer Unicode standard. Unicode is a binary encoding system that can represent much more of the world's text than ASCII can. Unicode allows computers to represent most of the world languages' alphabets, not just English.
- The ASCII table includes 27 values (7 bits).
- Unicode includes 216 values (16 bits).
- ASCII can represent 128 different characters.
- Unicode can represent 65,536 different characters!