×

What is Binary?

There are four types of the number system in computer applications through which we represent the different numbers.
Before moving to binary numbers, let's discuss the rest of the number system and the type of number system we include in the computer application.
The first one is the hexadecimal number system, and this type of number system includes the base value equal to 16. Sixteen different symbols have been assigned in this number system.
The second one is the decimal number system. The base value of this number system is 10. We have been using the number system since our childhood to count something or solve mathematics in our classes. The third one is the octal number system. In this number system, you will find the base value is 8. In this number system, you will find eight different symbols. And those symbols are from 0 to 7.
And, the fourth one is the binary number system, which we are going to read in this article:
A binary number in a binary number system or base 2 number system called binary. In Binary System, we define the symbol as 1 and 0. The propositional position of the binary number system is 2.
Computers use this numerical system to store and retrieve data such as numbers, music, pictures, words, etc. The term 'bit,' which refers to the smallest digital technology unit, is derived from the words 'BInary digiT.' Today, programmers utilize the hexadecimal or base-16 number system to concisely express binary data.   Because it is easier for computers to convert from binary to hex and vice versa, whereas doing so with the generally used decimal number system is far more difficult.

A brief history of the binary number

Gottfried Leibniz and a few more mathematicians previously described the contemporary binary numbers in Europe in the 16th and 17th centuries. The I Ching, also known as the Masterpiece of Changes or the Book of Modifications, is one of China's earliest books, dating from the 9th century BCE. The notion of Yin-Yang is used in the same work to depict the interconnection of forces in the world.

Ancient Egyptian scribes employed something called Horus-Eye fractions, which was one of two methods the Egyptians used to depict fractions, even before these advancements in China.

Fairly close to home, in the 2nd century BC, An Indian intellectual, Pingala, creator of Chhandahshastra, was also renowned as one of the early developers of the binary system.

The distinctions between the current binary system and Pingala's creation are that the latter's system begins with one rather than zero. The binary interpretations expand to the right rather than the left, as in the contemporary version.

Representation in binary

We can categorize binary numbers in two forms, the first one is signed number, and the second is an unsigned number

  1. Unsigned Numbers
    Only the amount of the number is included in unsigned numbers. They don't have any identification. All unsigned binary values are, therefore, positive. Using a positive sign before a number, like in the decimal number, is optional for portraying positive number. Consequently, zero and all those who sign is not positive can be considered unsigned numbers.
  2. Signed Numbers
    In a signed integer, you will find the expected value of a number. The symbol is placed in front of the phone number in most cases. That’s why, for positive integers, we must identify the positive sign, and for negative values, we must examine the negative sign. As a result, if an appropriate sign is put next to the integer, it can be regarded as a signed number.

Representation of Un-Signed Binary Numbers

The size of a value is recorded in the bits of an unsigned binary value. If an unsigned binary number has 'N' bits, then all of the N bits indicate the number's value because it lacks a sign bit.

Example:

Think about the value 23 in decimal form. 10111 is the binary equal of this number. This is how an unsigned binary number is represented.

10111=23

It has seven bits. The value of the integer 23 is indicated by these 5 bits.

Representation of Signed Binary Numbers

In signed binary numbers, Most Significant Bit MSB is used to denote the sign of the numbers.

Representation of Signed Binary Numbers

Placing a '0' in the signed binary shows a positive sign. In the same way, putting a '1' in the signed binary represents a negative sign.

Signed binary integers can be represented in three ways:

  • Sign-magnitude form
  • 1's complement form, and
  • 2's complement form.

A positive number has the same meaning in all three types. However, only the depiction of negative numbers in each format will vary.

Sign-Magnitude form

The MSB is often used to describe the number's sign, while the remaining bits indicate the number's value. As a result, add the sign bit to the unsigned binary number's leftmost side. This notation is analogous to the format of signed decimal numbers.

Consider the number -23, which is a negative decimal number. This integer has a magnitude of 23. The unsigned binary value of the number 23 is 10111. It consists of 5 bits. All of these bits represent the value.

Assume the sign bit as one on the leftmost side of the magnitude because the provided integer is negative.

-2310 = 1101112

As a result, -23's sign-magnitude equivalent is 110111.

1's complement form

Accompanying all the bits of a signed binary number yields the 1's complement of a value. As a result, when a positive number is multiplied by 1, the result is a negative value. In the same way, adding 1 to a negative integer produces a positive number.

If you multiply a binary number by two times the 1's complement, you will receive the original signed binary value.

Example

Assume the negative decimal value -23. The value of this number is 23. The signed binary representation of 23 comes out to be equal to 10111.

It consists of 5 bits. This number's MSB is zero, indicating an excellent value. One is the complement of zero and vice versa. To get the negative number, replace zeros with ones and ones with zeros.

-2310 = 010002

Therefore, the 1's complement of 2310 is 010002.

2's complement form

A binary number's 2's complement is obtained by adding one to the 1's complement of a signed binary number. As a result, when a positive value is multiplied by two, the result is a negative number. Similarly, when a negative value is multiplied by two, the result is an excellent value.

If you multiply a binary number by two times its 2's complement, you will receive the duly signed binary number.

Example:

Assume the negative decimal value is -23.

Then the value of 23's 1's complement of (23)10 is (01000)2

2's compliment of 2310 = 1's compliment of 2310 + 1.

= 01000 + 1

= 01001

Therefore, the 2's complement of 2310 is 010012.


Related Topics

What is Safe Mode?

There are various operating systems that provide multiple boot options to the users. Safe mode is also one of the boot options available for the users. It is very different...

6 minutes read.

What is Data?

In our daily life, you can see everybody is dealing with information and data to analyze things. Data can be of different forms and can be converted to the required...

6 minutes read.

What is an Expansion Card?

An expansion card is also called an add-on card, or an adapter card is a Printed Circuit Board (PCB) on the motherboard and fixed into an expansion slot. An expansion...

6 minutes read.

How many types of files are there in Linux

You will undoubtedly come across several file types when browsing the Linux file system. Regular files and directories are the most common and evident file formats. But with an additional...

3 minutes read.

What is a Silicon Chip?

A silicon chip is a microscopic silicon component found inside computers. It has electronic circuits holding much data or conducting logical or mathematical computations. An integrated circuit comprised mostly of...

4 minutes read.

What is Bracket?

A bracket is one of two large, forward- or afterwards-facing punctuation marks that is frequently used to separate a section of text or data from its surroundings. Depending on the...

3 minutes read.

Advanced Encryption Standard (AES)

What is Encryption? In cryptography, encryption is a way to convert data into secret data so that nobody can understand that except those with encryption keys. There are various algorithms for encrypting...

3 minutes read.

What are the advantages of the Internet?

Advantages of the Internet What is the Internet? Today’s world is connected through an internet so that imaging a day without the Internet is like a scary nightmare. The Internet is one...

6 minutes read.

What is Cache Memory? Types of Cache Memory

Cache Memory in Computer Cache memory is a semiconductor chip used to retrieve data from a computer's memory efficiently. Generally, cache memory is much costlier than main memory or any other...

4 minutes read.

How to associate a file with a program?

How to associate a file with a program in Windows? By default, a particular program is selected by the Windows to open each file type, but you may re-associate a file...

4 minutes read.

How to Fix a Windows CD-ROM, DVD, or Disc Drive Issue?

If your CD-ROM, DVD, or disc drive is not working properly in Windows, you can try a few troubleshooting steps to fix the issue. These steps include checking the connections,...

6 minutes read.

What is a Card Reader?

A hardware device that can read from and write to a memory card or memory stick is termed a card reader. Its task is to transfer data to computers and...

9 minutes read.

What is a Case fan?

A case fan, sometimes known as a system fan, is a component of a computer that is attached to the front or rear of the device's chassis. Case fans aid...

3 minutes read.

What is Website?

Website A collection of web pages is known as a website. The web pages may have a collection of text, images, audio, video, etc. We can also say that website is...

4 minutes read.

What is an Executable File?

An executable file (EXE file) contains a set of instructions, when the user clicks on the file icon, the system can immediately execute. The file extension for an executable file...

4 minutes read.

What does Alt+R do?

Alt+ R The Alt button is adjacent to the spacebar in the keyword. The Alt key is used with many other keys to perform various functions. When the user uses R...

4 minutes read.

What is Google Chrome?

Google Chrome, released on December 11, 2008, is a free Internet browser. The benefits of Chrome include synchronization with Google service and accounts and automated translation and spell checking. It...

6 minutes read.

Who invented the Internet?

Introduction of the Internet: The Internet is the foremost important tool and useful resource for any person. It connects millions of millions of computers, smartphones, web pages, servers, etc. It connects...

6 minutes read.

What are the Advantages of Computers?

A computer is an electrical device capable of storing, processing, and retrieving data. It can usually accomplish a range of things that make life easier. Computers conduct instructions written in...

7 minutes read.

How to find similar images using Search by Image

Google is well recognised for its search engine that uses keywords. By entering terms in the search bar, users can locate content or photos associated with a topic. However, there...

3 minutes read.