IT Questions and Answers :)

Thursday, May 16, 2019

Convert 56 from decimal to binary.

Convert 56 from decimal to binary.

  • 110110
  • 1001000
  • 111000
  • 110111 
Convert 56 from decimal to binary.

EXPLANATION

 

Binary to decimal conversion result in base numbers

(111000)2 = (56)10

Binary System

The binary numeral system uses the number 2 as its base (radix). As a base-2 numeral system, it consists of only two numbers: 0 and 1.
While it has been applied in ancient Egypt, China and India for different purposes, the binary system has become the language of electronics and computers in the modern world. This is the most efficient system to detect an electric signal’s off (0) and on (1) state. It is also the basis for binary code that is used to compose data in computer-based machines. Even the digital text that you are reading right now consists of binary numbers.

Reading a binary number is easier than it looks: This is a positional system; therefore, every digit in a binary number is raised to the powers of 2, starting from the rightmost with 20. In the binary system, each binary digit refers to 1 bit.

How to Read a Binary Number

In order to convert binary to decimal, basic knowledge on how to read a binary number might help. As mentioned above, in the positional system of binary, each bit (binary digit) is a power of 2. This means that every binary number could be represented as powers of 2, with the rightmost one being in the position of 20
Example: The binary number (1010)2 can also be written as follows:
(1 * 23) + (0 * 22) + (1 * 21) + (0 * 20)

Decimal System

The decimal numeral system is the most commonly used and the standard system in daily life. It uses the number 10 as its base (radix). Therefore, it has 10 symbols: The numbers from 0 to 9; namely 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.

As one of the oldest known numeral systems, the decimal numeral system has been used by many ancient civilizations. The difficulty of representing very large numbers in the decimal system was overcome by the Hindu–Arabic numeral system. The Hindu-Arabic numeral system gives positions to the digits in a number and this method works by using powers of the base 10; digits are raised to the nth power, in accordance with their position.
For instance, take the number 2345.67 in the decimal system:
  • The digit 5 is in the position of ones (100, which equals 1),
  • 4 is in the position of tens (101)
  • 3 is in the position of hundreds (102)
  • 2 is in the position of thousands (103)
  • Meanwhile, the digit 6 after the decimal point is in the tenths (1/10, which is 10-1) and 7 is in the hundredths (1/100, which is 10-2) position
  • Thus, the number 2345.67 can also be represented as follows: (2 * 103) + (3 * 102) + (4 * 101) + (6 * 10-1) + (7 * 10-2)

How to Convert Binary to Decimal

There are two methods to apply a binary to decimal conversion. The first one uses positional representation of the binary, which is described above. The second method is called double dabble and is used for converting longer binary strings faster. It doesn’t use the positions.


Method 1: Using Positions

  • Step 1: Write down (1010)2 and determine the positions, namely the powers of 2 that the digit belongs to.
  • Step 2: Represent the number in terms of its positions. (1 * 23) + (0 * 22) + (1 * 21) + (0 * 20)
  • Step 3: (1 * 8) + (0 * 4) + (1 * 2) + (0 * 1) = 8 + 0 + 2 + 0 = 10
  • Therefore, (1010)2 = (10)10
(Note that the digits 0 in the binary produced zero values in the decimal as well.)

Method 2: Double Dabble

Also called doubling, this method is actually an algorithm that can be applied to convert from any given base to decimal. Double dabble helps converting longer binary strings in your head and the only thing to remember is ‘double the total and add the next digit’.
  • Step 1: Write down the binary number. Starting from the left, you will be doubling the previous total and adding the current digit. In the first step the previous total is always 0 because you are just starting. Therefore, double the total (0 * 2 = 0) and add the leftmost digit.
  • Step 2: Double the total and add the next leftmost digit.
  • Step 3: Double the total and add the next leftmost digit. Repeat this until you run out of digits.
  • Step 4: The result you get after adding the last digit to the previous doubled total is the decimal equivalent.
Now, let’s apply the double dabble method to same the binary number, (1010)2
  • Your previous total 0. Your leftmost digit is 1. Double the total and add the leftmost digit
    (0 * 2) + 1 = 1
  • Step 2: Double the previous total and add the next leftmost digit.
    (1 * 2) + 0 = 2
  • Step 3: Double the previous total and add the next leftmost digit.
    (2 * 2) + 1 = 5
  • Step 4: Double the previous total and add the next leftmost digit.
    (5 * 2) + 0 = 10
This is where you run out of digits in this example. Therefore, (1010)2 = (10)10

Binary to decimal conversion examples

Example 1: (1110010)2  = (114)10
Method 1:
(0 * 20) + (1 * 21) + (0 * 22) + (0 * 23) + (1 * 24) + (1 * 25) + (1 * 26)
= (0 * 1) + (1 * 2) + (0 * 4) + (0 * 8) + (1 * 16) + (1 * 32) + (1 * 64)
= 0 + 2 + 0 + 0 + 16 + 32 + 64 = 114
Method 2:
0 (previous sum at starting point)
(0 + 1) * 2 = 2
2 + 1 = 3
3 * 2 =6
6 + 1 =7
7 * 2 = 14
14 + 0 =14
14 * 2 = 28
28 + 0 =28
28 * 2 = 56
56 + 1 = 57
57 * 2 = 114

Example 2: (11011)2  = (27)10
Method 1:
(0 * 20) + (1 * 21) + (0 * 22) + (1 * 23) + (1 * 24)
= (1 * 1) + (1 * 2) + (0 * 4) + (1 * 8) + (1 * 16)
= 1 + 2 + 0 + 8 + 16 = 27
Method 2:
(0 * 2) + 1 = 1
(1 * 2) + 1 = 3
(3 * 2) + 0 = 6
(6 * 2) + 1 = 13
(13 * 2) + 1 = 27
Share:

0 comments:

Post a Comment

Popular Posts