# Binary Formula

Binary Formula-  A binary number system is a set of numbers with a base of two and just two digits, “0 and 1”. It is one of the four types of number systems and is most widely used in programming languages such as Java and C++. “Bi” in the term “binary” means “two.” Examples of binary numerals include (11)2, (1110)2, (10101), and so on. The radix of a binary integer is 2, and each digit is referred to as a bit. A binary number may be transformed into three different number systems: decimal, octal, and hexadecimal. In this article, we explore the arithmetic operations on binary numbers and the conversion equations that transform binary numbers into other three number systems.

## Binary Formula

To grasp the binary number system, we must first appreciate how it works. Binary numbers are widely employed in electrical circuits that produce logic gates, as well as by microcontrollers for logical computing. A binary number has only two digits, “0 and 1,” and each digit is known as a bit. The computer’s input is initially translated to binary using an assigned ASCII code. Furthermore, the information is transformed from binary to user language and shown as an output.

## Arithmetic Operation on Binary Numbers

Binary number addition differs from regular addition, yet it is still quite straightforward. To add two binary integers, we must do it digit by digit. The sum of two binary integers is a binary number. To further comprehend binary number addition, refer to the table below.

Binary number 1

Binary number 2

Sum

Carry

0

0

0

0

0

1

1

0

1

0

1

0

1

1

0

1

### Binary Subtraction

Binary number addition differs from regular addition, yet it is still relatively simple. To add two binary integers, we must do it digit by digit. The sum of two binary integers is a binary number. To further comprehend binary number addition, refer to the table below.

Binary number 1

Binary number 2

Difference

Borrow

0

0

0

0

0

1

1

1

1

0

1

0

1

1

0

0

### Binary Multiplication

Binary multiplication is similar to the multiplication of normal numbers. Have a look at the table given below to understand the multiplication of binary numbers.

Binary number 1

Binary number 2

Multiplication

0

0

0

0

1

0

1

0

0

1

1

1

### Binary to Decimal Formula

A binary number’s decimal equivalent is determined by performing a binary-to-decimal conversion on the Binary Formula. A number system is a format that specifies how to represent numbers. The binary number system, which only has the digits 0 and 1, is used in computers and other electronic devices to represent data. The most widely used and most widely understood number system in the world is the decimal system. The positional notation approach and the doubling method are two ways to convert from binary to decimal.

Decimal Number

Binary number

Decimal Number

Binary number

1 001 11 1011
2 010 12 1100
3 011 13 1101
4 100 14 1110
5 101 15 1111
6 110 16 10000
7 111 17 10001
8 1000 18 10010
9 1001 19 10011
10 1010 20 10100

### Decimal to Binary Formula

The formula for converting decimal values to binary numbers is known as the “decimal-to-binary conversion.” The remainder formula makes it simple to translate decimal integers into binary numbers. The technique involves repeatedly dividing the provided decimal value by 2 and noting the remainder until we arrive at a quotient of 0 or 1. The given decimal number will be divided recursively by two in the formula to convert decimal to binary, and the remainder will be noted until we have either 0 or 1 as the final quotient.

A digit in a number is given a weight based on its position when using the positional notation method. To accomplish this, multiply each digit by the base (2) increased to the appropriate power, depending on where that digit falls in the number. The equivalent value of the supplied binary number in the decimal system is determined by adding up all of these values received for each digit.

### Binary to Octal Formula

In contrast to the decimal number system, the binary and octal number systems use distinct conventions to write numbers. The only digits used to represent numbers in the Binary Formula system are 0 and 1, but 0 to 7 digits are used to represent numbers in the octal number system. By applying a set of principles, any number that is written using one number system can be translated into another.

Binary number

Octal Number

Binary number

Octal Number

000 0 1000 10
001 1 1001 11
010 2 1010 12
011 3 1011 13
100 4 1100 14
101 5 1101 15
110 6 1110 16
111 7 1111 17

Another conversion that takes place in the number system is from Binary Formula to hexadecimal. In mathematics, there are four different sorts of number systems: binary, octal, decimal, and hexadecimal. These forms can all be converted using the conversion method or conversion table to the other type of number system.

The process of translating binary numbers into hexadecimal values is known as “binary-to-hexadecimal conversion.” Hexadecimal has a base number of 16, whereas binary digits have a base number of 2. With the help of the base numbers, binary is converted to hexadecimal. There are several ways to perform the conversion; the first is by changing the binary representation into a decimal number and then a hexadecimal number.

Decimal number

Binary number

Decimal number

Binary number

0 0000 0 8 1000 8
1 0001 1 9 1001 9
2 0010 2 10 1010

A

3  0011 3 11 1011

B

4 0100 4 12 1100

C

5 0101 5 13 1101

D

6 0110 6 14 1110

E

7 0111 7 15 1111

F

### Solved Examples on Binary Formula

Example 1: Convert the binary number (110010100)2 to octal.

Solution:  To convert the binary number into octal, first, we have to divide the given binary number into a pair of three digits, starting from the right end. Now, substitute the value of the octal number into it.

110010101 ⇒ 110 – 010 – 100

6 – 2 – 4 = 624

Therefore, the binary number (110010100)2 in the octal system is 624.

Example 2: Convert the binary number (10010111)2 to hexadecimal.

Solution:  To convert the binary number into hexadecimal, we first have to divide the given binary number into a pair of four digits, starting from the right end. Now, substitute the value of the hexadecimal number into it.

10010111 ⇒ 1001 – 0111

(1001)2 = (9)16

(0111)2 = (7)16

So, (10010111)2 = (97)16

Therefore, the binary number (10010111)2 in the hexadecimal system is 97.