Conversiones entre sistemas de numeración (Binario, octal y hexadecimal a decimal)

Conversiones entre sistemas de numeración (Binario, octal y hexadecimal a decimal)

Understanding Positional Number Systems

Introduction to Positional Number Systems

  • Positional number systems, such as decimal, octal, and binary, assign value based on the position of each digit.
  • For example, in the decimal system (base 10), the rightmost digit represents units (1), the middle digit represents tens (20), and the leftmost digit represents hundreds (100).

Value Calculation in Decimal System

  • The total value of a number is obtained by summing the values of each digit based on its position. For instance, adding 1 + 20 + 100 gives us 121.
  • As we move leftward in a number, each position's value increases by a factor of ten: units (10^0), tens (10^1), hundreds (10^2), etc.

Base and Exponents

  • Each positional value can also be expressed as powers of the base; for decimal numbers, this is base 10 raised to various powers.
  • This pattern continues indefinitely with increasing powers: 10^4 equals 10,000.

Converting Between Number Systems

Octal to Decimal Conversion

  • To convert from octal (base 8) to decimal, calculate each digit's value using base 8 instead of base 10.
  • The first position from the right is 8^0, followed by 8^1, 8^2. For example, for octal number 327:
  • 7 times 1 = 7
  • 2 times 8 = 16
  • 3 times 64 = 192

Example Calculation

  • Summing these values gives us 7 + 16 + 192 = 215. Thus, octal number "327" converts to decimal "215".

Further Examples in Octal

Another Octal Conversion Example

  • For octal number "2503":
  • Calculate positions:
  • 3 times 1 = 3
  • Skip zero since it contributes nothing.
  • 5 times 64 =320
  • Finally:
  • 2 times512 =1024.

Final Sum for Octal Example

  • Adding these results yields a total of 1347 in decimal.

Binary to Decimal Conversion

Understanding Binary System

  • In binary (base two), conversion involves calculating values similarly but using powers of two.

Step-by-Step Binary Calculation

  • For binary number "11011":
  • Positions are calculated as follows:
  • From right:
  • First position (2^0): 1
  • Second (2^1): 2
  • Third (2^2): 4
  • Fourth (2^3): 8
  • Fifth (2^4): 16.

Summation for Binary Result

  • Multiplying symbols by their positional values gives:
  • Total sum: 27, meaning binary "11011" equals decimal "27".

Simplifying Binary Conversions

Efficient Methodology for Binary Numbers

  • When converting binary numbers like "10101", only consider positions with '1':
  • Values are summed directly without multiplication where zeros appear.

Conclusion on Simplified Approach

Conversion of Binary and Hexadecimal to Decimal

Understanding Binary to Decimal Conversion

  • The speaker explains how to convert binary numbers to decimal without a calculator, using the example of 2^5 + 2^6 + 2^7, which sums up to 139 in decimal.
  • Direct calculation can be performed by writing out the powers of two, such as 2^0 + 2^1 + 2^3 + 2^7.

Transitioning from Decimal to Hexadecimal

  • To convert a number like 702 into decimal, each position's value is multiplied by its base (16 for hexadecimal).
  • A table is suggested for understanding hexadecimal symbols (0-9 and A-F), with their corresponding decimal values ranging from 0 to 15.

Calculating Values in Hexadecimal

  • The conversion process involves multiplying the decimal equivalent of hexadecimal symbols; for instance, 'CE' equals 12 in decimal.
  • The final sum after conversions yields that '700' in hexadecimal corresponds to 1986 in decimal.

Example Calculation Breakdown

  • For converting 'AB', calculations include:
  • CE (12) multiplied by 16^0,
  • B (11) multiplied by 16^1,
  • A (10) multiplied by 16^2.

This results in a total of 2748 in decimal.

Practice Resources

Video description

Encuentra ejercicios en https://programacionsimple.com/Conversiones Página de Facebook https://fb.me/ProgramacionSimple