Number System

 Important Number System for computer are :-

  • Decimal Number System (0-9)
  • Binary Number System (0-1)
  • Hexadecimal Number System (0-9, A-F)
  • Octal Number System (0-7)
1.) Decimal Number System : 
      Base : 10
      Values : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9


2.) Binary Number System : 
      Base : 2
      Values : 0, 1


3.) Hexadecimal Number System : 
      Base : 16
      Values : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A(10), B(11), C(12), D(13), E(14), F(15)
     

4.) Octal Number System : 
      Base : 8
      Values : 0, 1, 2, 3, 4, 5, 6, 7


Binary to Decimal Conversion:

Binary (base-2) numbers use only two digits: 0 and 1. Decimal (base-10) numbers use ten digits: 0 through 9. The conversion process relies on the idea of place value, just like in decimal numbers.

In decimal, each digit's position represents a power of 10 (e.g., in 123, 3 is , 2 is , 1 is ).

In binary, each digit's position represents a power of 2.

The Step-by-Step Process

  1. Write down the Binary Number: Start by writing the binary number you want to convert.

  2. Assign Place Values (Powers of 2): Starting from the rightmost digit of the binary number and moving to the left, assign increasing powers of 2 to each position.

    • The rightmost digit gets 2^0 (which is 1).

    • The next digit to the left gets 2^1 (which is 2).

    • The next gets 2^2 (which is 4), and so on.

  3. Multiply and Sum:

    • For each digit in the binary number:

      • If the binary digit is '1', multiply it by its corresponding power of 2.

      • If the binary digit is '0', the result for that position is 0 (as ).

    • Add up all the results from the multiplications. This sum is your decimal equivalent.

Example

Let's convert the binary number 11010 to decimal.

  1. Binary Number: 11010

  2. Assign Place Values (from right to left):

    • Rightmost '0' is at position 2^0

    • Next '1' is at position 2^1

    • Next '0' is at position 2^2

    • Next '1' is at position 2^3

    • Leftmost '1' is at position 2^4

  3. Multiply and Sum:

    Binary DigitPositionPower of 2CalculationResult
    1
    1
    0
    1
    0
    Sum:

Comments

Popular posts from this blog

Setting up a USB thermal printer with a Raspberry Pi 3B+

Autostart an app on reboot - Raspberry Pi

Basic Input/Output C Program