Binary

binary

What is binary?

Binary describes a numbering scheme with only two possible values for each digit — 0 or 1 — and is the basis for all binary code used in computing systems. These systems use this code to understand operational instructions and user input and to present a relevant output to the user.

Binary also refers to any digital encoding/decoding system with exactly two possible states. In digital data memory, storage, processing, and communications, the 0 and 1 values are sometimes called low and high, respectively. In transistors, 1 refers to a flow of electricity, while 0 represents no flow of electricity.

Binary explained

The binary numbering system was refined in the 17th century by Gottfried Leibniz. A binary digit, or bit, is the smallest data unit in mathematics and computing systems. Each bit has a single value of either 1 or 0, which means it can’t take on any other value.

Computers can represent numbers using binary code as digital 1s and 0s inside the central processing unit (CPU) and RAM. These digital numbers are electrical signals on or off inside the CPU or RAM.

Binary vs. decimal

Since the binary system uses only two digits or bits and represents numbers using varying patterns of 1s and 0s, it is known as a base-2 system. Here, 1 refers to “on” or “true,” while 0 refers to “off” or “false.”

In contrast, the decimal numbering system is a base-10 system, where each possible place in a number can be one of 10 digits (0-9). In a multi-digit number, the rightmost digit is in the first place, the digit next to it on the left is in the 10th place, the digit further left is in the 100th place, and so on.

Example

The importance of binary code

The binary number system is the base of all computing systems and operations. It enables devices to store, access, and manipulate all information directed to and from the CPU or memory. This makes it possible to develop applications that enable users to do the following:

  • view websites;
  • create and update documents;
  • play games;
  • View streaming video and other kinds of graphical information;
  • access software, and
  • perform calculations and data analyses.

The binary schema of digital 1s and 0s offers a simple and elegant way for computers to work. It also offers an efficient way to control logic circuits and detect an electrical signal’s true (1) and false (0) states.

How binary numbers work

The binary system is the primary language of computing systems. Inside these systems, a binary number consists of eight bits. This series is known as a byte. In the binary schema, the position of each digit determines its decimal value. Thus, by understanding the position of each bit, a binary number can be converted into a decimal number.

In decimal numbers, each additional place is multiplied by 10 as we move from right to left (first place, 10th place, 100th place, etc.). But, in binary numbers, each additional place is multiplied by two while moving from right to left. The two examples below explain this idea.

Example 1

Here’s how the decimal values are calculated for an 8-bit (byte) binary number 01101000.

In this number, the first digit is at the far right, while the eighth is at the far left. The second (0) to the seventh (1) digits are read from right to left.

Bit position12345678
Bit00010110
Binary-to-decimal calculation (exponent)2021222324252627
Decimal value (x2)1248163264128

As the bit position increases from one to eight, the previous decimal value is multiplied by two. That’s why the first bit has a value of 1, the second bit has a value of 2, the third bit has a value of 4, and so on.

The final value of the decimal number is calculated by adding the individual values from the above table. However, only those values where the bit equals 1 should be added. These values represent the “on” position. The 0s represent the “off” position, so they are not counted in the decimal value calculation.

So, for the binary number 01101000, the decimal value is calculated as the following:

8 + 32 + 64 = 104

Example 2

Here’s how the decimal values are calculated for the binary number 11111111.

Bit position12345678
Bit11111111
Binary-to-decimal calculation (exponent)2021222324252627
Decimal value1248163264128

In this binary number, every bit has a value of 1, so all the individual values are added.

So, for this numberthe decimal value is the following:

1 + 2 + 4 + 8 + 16+ 32 + 64 +128 = 255

Representing decimal numbers in binary format

As mentioned earlier, the binary numbering system only works with 1s and 0s. However, the position of just these two digits can represent many more numbers. The examples in the previous section show how any decimal number from 0 to 255 can be represented using binary numbers. Numbers larger than 255 can also be represented by adding more bits to an 8-bit binary number.

Here are the decimal numbers from zero to 20 and their binary equivalents.

Decimal numberBinary numberDecimal numberBinary number
00111011
11121100
210131101
311141110
4100151111
51011610000
61101710001
71111810010
810001910011
910012010100
101010

Converting binary numbers into text characters

Binary numbers can be translated into text characters using American Standard Code for Information Interchange (ASCII) codes to store information in the computer’s RAM or CPU. ASCII-capable applications, like word processors, can read text information from the RAM or CPU. They can also store text information that the user can then retrieve at a later time. ASCII codes are stored in the ASCII table, which consists of 128 text or special characters. Each character has an associated decimal value.

In the first example of the previous section, the binary number is 01101000 (decimal number 104). In ASCII, this number would produce a lowercase h. To form words, more letters need to be added to h. In binary terms, this means adding more binary numbers to the binary number for h.

Example

The binary code for ASCII lowercase i is 01101001. So, to create the word hi, the binary number for i is added to the binary number for h. This yields the following binary number:

01101000 + 01101001 = 0110100001101001

In decimal terms, the decimal numbers for h and i are 104 and 105, respectively.

The following are other common examples of binary numbers converted to ASCII text code.

Binary numberDecimal numberASCII code
110000480
100000165A (uppercase)
1111111127DEL key
1101127ESC key

Nord VPN
60% off Nord VPN
Coinbase - Getty Images - 1234552839
Coinbase – Crypto Currency – Sign up with this link and get $10 free?! Buy/sell/exchange crypto, and use their ATM card to access your cash easily!
Chase Sapphire Preferred - Travel Points
NordPass - Password Manager - CJ Banner
https://www.dpbolvw.net/click-100604079-15345170
Binance Cryptowallet - Buy/Sell
Binance Blockchain
Amazon - Daily Deals
Amazon’s Daily Deals!
Your favorite restaurants are delivered to your front door! Grubhub!
Game Fly
Game Fly Video Game Rentals!

Please enter CoinGecko Free Api Key to get this plugin works.