Binary System

Binary System (Number—0,1): Definition, Conversion, Examples

Listen to this article

Analog signal & Digital signal

In some conventional electronic circuits—for example, rectifiers made of p-n junctions or amplifier circuits made of transistors—the voltage or current signal sent can be varied continuously over a certain range. For example, the input voltage to the CE circuit of a transistor can be stepped up from 0V to 6V or 10V. Such a signal is called an analog signal and the corresponding electronic circuit is called an analog circuit.

On the other hand, sophisticated electronic devices such as calculators, computers, etc. have only two discrete states of input or output signals—low or high. In this case, the exact value of the voltage or current signal is unimportant; For example, an input or output voltage value in the range of 0V to 0.5V can be considered low voltage and 4V to 5V as high voltage. In this case, the circuit is designed in such a way that the voltage value is never in the range of 0.5V to 4V.

If the input and output signals of an electronic circuit have only two discrete states, those two states can be indicated by only two digits. Such a signal is called a digital signal and the corresponding circuit is called a digital circuit. Compared to analog circuits, this circuit is relatively easy to use, the time lag between applying input and obtaining output is very short and the efficiency is very high. For these reasons, digital circuits are widely used nowadays.

The two most commonly used digits are 0 and 1 to represent only two discrete systems of digital signals. Such use of two digits—0 for a low value and 1 for a high value—is called positive logic. For example, two digits are used—0 to symbolize voltages from 0V to 0.5V, and 1 to symbolize voltages from 4V to 5V. On the other hand, less common negative logic uses 1 for low values and 0 for high values.

An example of the various possible analog and digital signals is shown in Fig. It is worth noting that in the case of analog signals, the waveform i.e., the exact form of change of voltage with time is very important. On the other hand, in the case of a digital signal, the waveform is always rectangular, the only thing that matters is how long the voltage value is low and how long it is high. In addition, the accuracy of the signal does not depend on the voltage value being precise or limited to a range, both at low and high levels.

Analog and digital waveform

Binary number system

By number, we usually mean any number in the decimal system. The total number of digits in the decimal system is ten—0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. We usually use the decimal system to write numbers, but computers cannot work with numbers in this system. Computers only work with binary system. The total number of digits in the binary system is two — 0 and 1.

Definition: The system of expressing all real numbers with only two digits — 0 and 1-is called a binary number system.

The value of a number depends on the following two factors:

  1. On the value and position of the digits of which a number is composed and,
  2. How a number is written on its base or radix. The number of digits in a number system is the base of that number system. For example, the bases of decimal and binary number systems are 10 and 2 respectively.

Any number formed in a system is usually expressed by the (number)base symbol. For example, the number 257 formed in the decimal system is written as (257)10. Similarly, the number 1101 formed in the binary system is written (1101)2. The numbers (11)10 and (11)2 are not the same; The first number is 11 and the second is 3.

Integers in decimal and binary systems

In decimal system

For any integer having four digits in the decimal system, 2795 is taken. The number is expressed in words thus—two thousand seven hundred and ninety-five. In this case, the position of the digits is given in the table below.

Position Thousand (4) Hundred (3) Tens (2) Ones (1)
Given Number
2
7
9
5

Given this position, and from the base of the number system, we find the value of the number.

2 × 1000 (103) + 7 × 100 (102) + 2 × 10 (101) + 2 × 10 (100) = 2795

See the table below for ease of understanding.

Position Thousand (4) Hundred (3) Tens (2) Ones (1)
Power of 10

103

102

101

100

Decimal value of 1 in different positions
1000
100
10
1
Decimal values of the digits used in number 2795 in various positions.
2000
700
90
5

The position of a number indicates its significance. The leftmost digit of a number has the most significance and the rightmost digit has the least significance. In this case, the 2, digit in the thousands place is the most significant. So, in this case 2 is called the most significant digit. Again, the 5, digit in the unit’s place is the least significant. So, in this case 5 is called the least significant number.

In binary system

For any four-digit integer in a binary system, 1101 is taken. In this case, the position of the digits is given in the table below.

Position Thousand (4) Hundred (3) Tens (2) Ones (1)
Given Number
1
1
0
1

Below is how we can find the value of the number from this position and the base of the number system.

1 × 8 (23) + 1 × 4 (22) + 0 × 2 (21) + 1 × 1 (20) = 13 (decimal value)

See the table below for ease of understanding.

Position 8's place (4) 4's place (3) 2's place (2) Unit place (1)
Power of 2

23

22

21

20

Decimal value of 1 in different positions
8
4
2
1
Decimal values of the digits used in number 2795 in various positions.
8
4
0
1

The 1 digit in the 8’s place is the most significant digit and the 1 digit in the unit’s place is the least significant digit for the given number.

Fractions in decimal and binary systems

In decimal system

A fraction is written in decimal form by placing a decimal point (.) and several digits to the right of it, such as .417. In this case, the position of the digits is given in the table below.

PositionOne tenth (1)One hundredth (2)One thousandth (3)
Given Number.417

Below is how we can find the value of the number from this position and the base of the number system.

4 × 10-1 + 1 × 10-2 + 7 × 10-3 = .417

See the table below for ease of understanding.

Position One tenth (1) One hundredth (2) One thousandth (3)
Power of 10

10-1  

10-2

10-3

Decimal value of 1 in different positions
.1
.01
.001
In different positions, .417-the decimal value of the digits used in the fraction
.4
.01
.007

In the case of fractions, the digit next to the decimal point has the most significance and the digit to the far right has the least significance. In this case, 4 digits to the tenth place is the most significant digit and 7 digits to the thousandth place is the least significant digit.

In binary system

A fraction .1011 is taken in a binary system. In this case, the positions of the digits are:

Position1/2th place (1)1/4th place (2)1/8th place (3)1/16th place (4)
Given Number.1011

Below is how we can find the value of the number from this position and the base of the number system.

1 × 2-1 + 0 × 2-2 + 1 × 2-3 + 1 × 2-4 = .6875 (decimal value)

See the table below for ease of understanding.

Position 1/2th place 1/4th place 1/8th place 1/16th place
Power of 2

2-1

2-2

2-3

2-4

Decimal value of 1 in different positions
.5
.25
.125
.0625
In different positions, .1011-the decimal value of the digits used in the fraction
.5
0
.125
.0625

The 1 digit in the 1/2 place is the most significant digit and the 1 digit in the 1/16 place is the least significant digit for the given fraction.

Binary to decimal conversion

Extracting the decimal value of a binary number and converting a binary number to decimal means the same thing. The following examples show how to convert binary numbers to decimal numbers.

  1. (10111)2 = (1 ×24) + (0 × 23) + (1 × 22) + (1 × 21) + (1 × 20) = 16 + 0 + 4 + 2 + 1 = (23). Note, that to distinguish the numbers of one system from the numbers of another system, the base is written as a subscript outside the brackets, with a number enclosed in brackets. For example, (10111)2, (23)10.
  2. (10.111)2 = (1 × 21) + (0 × 20) + (1 × 2-1) + (1 × 2-2) + (1 × 2-3) = 2 + 0 + 0.5 + 0.25 + 0.125 = (2.875)10
  3. (0.001)2 = (0 × 20) + (0 × 2-1) + (0 × 2-2) + (1 × 2-3) = 0 + 0 + 0 + 0.125 = (0.125)10
  4. (1.001)2 = (1 × 20) + (0 × 2-1) + (0 × 2-2) + (1 × 2-3) = 1 + 0 + 0 + 0.125 = (1.125)10

Decimal to binary conversion

Conversion of integers

The increasing powers of 2 starting from 20 are 20, 21, 22, 23, ·····. By multiplying 0 or 1 with these increasing powers of 2, any integer can be expressed as the sum of those products. For example,

  1. 44 = (25 × 1) + (24 × 0) + (23 × 1) + (22 × 1) + (21 × 0) + (20 × 0)
  2. 45 = (25 × 1) + (24 × 0) + (23 × 1) + (22 × 1) + (21 × 0) + (20 × 1)
  3. 46 = (25 × 1) + (24 × 0) + (23 × 1) + (22 × 1) + (21 × 1) + (20 × 0)
  4. 47 = (25 × 1) + (24 × 0) + (23 × 1) + (22 × 1) + (21 × 1) + (20 × 1)

Now, by multiplying the 0’s and 1’s that express a decimal number by the power of 2, the binary form of the decimal number is obtained by writing the 0’s and 1’s consecutively. That is,

(44)10 = (101100)2, (45)10 = (101101)2,

(46)10 = (101110)2, (47)10 = (101111)2

Converting decimal numbers to binary numbers as shown above is not the correct method. So, the correct method is given below.

Finding the binary form of (44)10: The divisor is the base of the number system and the numerator is the given number.

binary form of (44)10

Finding the binary form of (45)10:

binary form of (45)10

Conversion of fraction

Decreasing powers of 2 starting from 2-1 are 2-1, 2-2, 2-3, ·····. By multiplying 0 or 1 with these decreasing powers of 2, not all fractions can be expressed as the sum of those products. For example, 0.125 = (2-1 × 0) + (2-2 × 0) + (2-3 × 1), but 0.12 cannot be expressed this way. The procedure for converting a fraction from decimal to binary is given.

Any decimal fraction must first be multiplied by 2. Therefore, if the value of the fraction is less than 1, then 0 should be written, and if it is greater than 1, then 1 should be written. Binary points should be placed to the left of this 0 or 1. Now, if the value of the fraction is less than 1, it should be written as 0, and if it is greater than 1, then 1 should be removed from the integer and the remainder multiplied by 2 again. As before, write 0 if the value of this product is less than 1, and write 1 if it is greater than 1. This 0 or 1 should be written below the 0 or 1 written earlier. Thus, the right-hand side of the previous product point (i.e., the fraction) is repeatedly multiplied by 2 to write 0 or 1, depending on the value of the product, until the product is 1. The binary fraction can then be obtained by placing the decimal point at the far left and then writing the integers from top to bottom consecutively from left to right. But in most cases, the product is never 1. In that case, the given decimal fraction cannot be expressed in a binary fraction of the same value.  Below are two examples.

Determine the 0.5625-binary form:

binary form of 0.5625

Determine the 0.3-binary form:

binary form of 0.3

In this case, the product is never 1 and the 1001 parts is returned repeatedly. So, 0.3 cannot be expressed as a binary fraction of the same value. 0.010011001 ···· Since the part 1001 is recurring in the fraction, it can be written as— (0.0) (1001)2.

So, (0.3)10 = (0.0) (1001)2

It should be noted that a particular calculation is carried out with as many significant figures after the point as are required. For example, if a calculation is required with eight significant figures after the point, it would be written as,

(0.3)10 = (0.01001100)2

The binary form of any decimal number is written by converting the integer and fractional parts separately to binary. For example,

(44)10 = (101100)2 and (0.5625)10 = (0.1001)2

So, (44.5625)10 = (101100.1001)2

Addition, subtraction, multiplication, and a division of binary numbers

Addition, subtraction, multiplication, and division of binary system follow the same procedures as addition, subtraction, multiplication, and division of decimal system. The only difference between them is that in the decimal system, the number of digits is ten (0, 1, 2, ·····, 9) but in the binary system the number of digits is only two (0 and 1).

Binary addition

Rules of Addition: 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, 1 + 1 = 10

This last relation 1 + 1 = 10 means that if a place has a 1 on top and a 1 on the bottom during addition, 0 is added to the sum and 1 is moved to the left place. And is added to the digits of that place.

Example:

  1. Adding the rightmost places 1, 1, 0, 1, 0 is 1 + 1 + 0 + 1 + 0 = 10 + 1 = 11. Add the rightmost 1 to the sum and the leftmost 1 to the leftmost place (right from to the second place).
  2. The sum of that second place is, 1 (obtained from right) + 0 + 1 + 1 + 1 = 1 + 1 + 1 + 1 = 10 + 1 + 1 = 11 + 1 = 100; In this, the 0 on the right is added to the sum and the 10 is moved to the place on the left, i.e. the third place from the right.
  3. The sum of that third place is, 10 (found from the right) + 1 + 1 = 10 + 1 + 1 = 11 + 1 = 100; Since there are no more places on the left, this 100 is added to the sum.

Binary Subtraction

Rules of Subtraction: 0 – 0 = 0, 1 – 0 = 1, 1 + 1 = 0, 10 – 1 = 1

This last relation, 10 – 1 = 1, means that if a place has a 0 above and a 1 below during subtraction, 1 must be written in the subtraction result, but 1 must be subtracted from the number above the place to the immediate left.

Example:

Binary subtraction

  1. A 1 is placed as a minus under 0 – 1 in the rightmost place; In this case, according to the rule 10 – 1 = 1, the number above the left place is reduced from 1 to 1 and it is considered 0. 0 – 0 = 0 in that place.
  2. Similarly, 0 – 1 below 1 in the third place from the right and 1 above the fourth place is taken as 0.
  3. Again 0 – 1 is placed below 1 and 1 above the fifth place is taken as zero. The resulting subtraction is 1101.

To subtract a larger number from a smaller number, first subtract the smaller from the larger number. Then a minus sign must be placed before the subtraction. For example, 11001 – 11111—this subtraction can be done as:

Binary subtraction example

In this case, 11001 < 11111; So, written in reverse, Determinant Subtract = -110.

Binary multiplication and division

Rules of Multiplication: 0 × 0 = 0, 0 × 1 = 1 × 0 = 0, 1 × 1 = 1

The method of multiplying decimal and binary system is the same. Incidentally, the calculator or computer multiplies by repeated addition and divides by repeated subtraction. That is why multiplication and division of binary system have no such practical importance.

More related article...

Spread the love

Leave a Comment

Your email address will not be published. Required fields are marked *