Digital Number System



Content "filtered", Please subscribe for FULL access.


Chapter 2 : Digital Number System



Number System arrow_upward


  • The study of Number System is useful for understanding how data is represented before it can be processed by any digital system including digital computer.
  • There are four number system used in digital electronics:
    • Binary number system
    • Decimal number system
    • Octal number system
    • Hexadecimal number system
  • Understanding these number system operations requires the ability to convert from one number system to another.
  • R is the radix or base of any number system.
    • R must be a positive number.
    • R digits in the number system ranges from 0 to R – 1

    Decimal Number System arrow_upward


  • The decimal number system is a radix- 10 number system therefore it has 10 symbols. These are 0,1,2,3,4,5,6,7,8,9
  • The decimal number system is a positional value system in which the value of digit depends upon its position.
    • For example, in decimal number 534, the digit 5 represents hundreds, the 3 represents tens and 4 represents ones.
    • Here 5 carries the most weight of three digits hence it is the most significant bit (MSB) and 3 carries the least weight and is called least significant bit (LSB).
  • Starting from the decimal point the place values of different digits in a mixed decimal number are 100 , 101 , 102 , and so on (for the integral part) and   10-1 , 10-2 , 10-3 and so on (for the fractional part).
  • Table shows the decimal position values as powers of

  • Integral Part

    102

    101

    100

    MSB



    Fractional Part

    .

    10-1

    10-2

    Decimal Point

    LSB



    Binary Number System arrow_upward


  • Digital computers internally use the binary (base-2) number system to represent data and perform arithmetic calculations.
  • In binary number system, there are only two symbols 0 and 1, that is binary number system requires working with long strings of zeros and ones.
  • 0 and 1 symbols used in the binary number system are referred as bit.
  • The group of four binary digits (bits) is known as Nibble while group of eight bits is known as Byte.
  • Starting from the binary point the place values of different digits in a mixed binary number are 20 , 21 , 22 and so on (for the integral part) and 21 , 2-2 , 2-3 and so on (for the fractional part).
  • Table shows that each digit position in a binary number represents a power of two.

  • Integral Part

    23

    22

    21

    20

    8

    4

    2

    1

    MSB



    Fractional Part

    -

    2-1

    2-2

    2-3

    -

    1/2

    1/4

    1/8

    Binary Point



    Octal Number System arrow_upward


  • The Octal number system is a radix- 8 number system therefore it has 8 symbols. These are 0,1,2,3,4,5,6 and 7.
  • The place values or weights of different digits in a mixed octal number are 80 , 81 , 82 , 83 and so on (for the integral part) and 8-1 , 8-2 , 8-3 and so on (for the fractional part).
  • Table shows the octal position values as powers of 8.

  • Integral Part

    Fractional Part

    83

    82

    81

    80

    -

    8-1

    8-2

    8-3

    512

    64

    8

    1

    -

    1/8

    1/64

    1/512

    MSB

    Octal Point

    LSB



    Hexadecimal Number System arrow_upward


  • The Hexadecimal number system is a radix- 16 number system.
  • In hexadecimal number system there are sixteen symbols.
  • The symbols used in hexadecimal number system are ten digits (0 to 9) and six characters (A to F).
  • These are:
    • 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
  • The place values or weights of different digits in a mixed hexadecimal number are 160 , 161 , 162 and so on (for the integral part) and 16-1 , 16-2 , 16-3 and so on (for the fractional part).
  • The decimal equivalent of A, B, C, D, E and F are 10, 11, 12, 13, 14 and 15 respectively.
  • Table shows that the hexa-decimal position values as powers of 16

  • Integral Part

    162

    161

    160

    MSB



    Fractional Part

    -

    16-1

    16-2

    Hexa-decimal Point

    LSB



    Relationship among Decimal, Binary, Octal and Hexadecimal Number System arrow_upward



    Decimal

    Binary

    Hexa-Decimal

    Octal

    0

    0000

    0

    0

    1

    0001

    1

    1

    2

    0010

    2

    2

    3

    0011

    3

    3

    4

    0100

    4

    4

    5

    0101

    5

    5

    6

    0110

    6

    6

    7

    0111

    7

    7

    8

    1000

    8

    8

    9

    1001

    9

    9

    10

    1010

    A

    10

    11

    1011

    B

    11

    12

    1100

    C

    12

    13

    1101

    D

    13

    14

    1110

    E

    14

    15

    1111

    F

    15



    Binary to Decimal Conversion arrow_upward


  • Any binary number can be converted to its equivalent decimal number by summing the weights of various positions.
  • Suppose we have binary number 11001.001
  • Decimal conversion:

  • For integral part:
  • (11001)2 =

    (1 x 24 + 1 x 23 + 0 x 22 + 0 x 21 + 1 x 20 )

    (11001)2 = (16+ 8 + 0 + 0 + 1)

    (11001)2 = (25)10

  • For fractional part:
  • (.001)2 = 0 x 2-1 + 0 x 2-2 + 1 x 2-3

    (.001)2 = 0 + 0 + 0.125

    (.001)2 = (0.125)10

  • Decimal equivalent of (11001.001)2 is (25.125)10
  •     (11001.001)2 = (25.125)10


    Decimal to Binary Conversion arrow_upward


  • Decimal to binary conversion can be done by dividing the integral part by 2 and writing down reminder after each division until a quotient 0 is obtained.
  • Binary equivalent is obtained by writing the first remainder as least significant bit and last reminder as most significant bit.
  • For fractional part it can be done by, multiplying the fractional part by 2 and write integer bit of the product and repeat this process till the fractional part of the product is 0.
  • We can understand decimal to binary conversion by the following example:
  • (22.625)10 can be converted to binary as:
    • For integral part:  (22)10

  • For fractional part:

  • Decimal Fraction

    Product

    Integer Bit

    0.625 X 2

    1.250

    1

    MSB

    0.250 X 2

    0.50

    0

    0.50 X 2

    1.0

    1

    LSB


    (.625)10 = (.101)2

  • Binary equivalent of (22.625)10 is (10110.101)2
  • (22.625)10 = (10110.101)2


    Binary to Octal Conversion arrow_upward


  • The bits of the binary number are grouped into groups of three bits starting at the LSB, and then each group of these three bits is converted into its octal equivalent.

  • Binary Digits

    Octal Equivalent

    000

    0

    001

    1

    010

    2

    011

    3

    100

    4

    101

    5

    110

    6

    111

    7


  • For example:
    • (101010011)2 = (523)8
  • Sometimes the binary number may not have even groups of three bits.
  • In those cases we can add one or two zeros to the left of MSB of the binary number to fill out the last group.
  • For example, binary number (1011011) can be converted as adding two zeros to the left of MSB so binary number will be (001011011)2 = (133)8

  • Octal to Binary Conversion arrow_upward


  • The octal to binary conversion is reverse of the binary to octal conversion.
  • For example:
  • (133)8 = (001011011)2


    Binary to Hexadecimal Conversion arrow_upward


  • For binary to hexadecimal conversion the binary numbers are arranged in group of four bits starting from LSB to MSB and adding number of zeros to the left of MSB if required for integral part.
  • For fractional part arranged in group of four bits from decimal and adding number of zeros to the right if required (to make it a group of four bits).
  • In this system (hexadecimal, or Base 16), the numbers are counted from 0 to 9, then letters A to F before adding another digit. The letter A through F represent decimal numbers 10 through 15, respectively.
  • For example:
  • (1110110101.11101)2 = 0011  1011  0101 . 1110  1000 = (3.B5.E8)16


    Hexadecimal to Binary Conversion arrow_upward


  • Base 16 is fourth power of 2 i.e. 24 = 16
  • We can replace each hexadecimal digit by a group of four binary digits. Thus it is easier to convert hexadecimal number to binary number.
  • For example: (1B87.E1)16 can be converted as:

  • 1

    B

    8

    7.

    E

    1

    0001

    1011

    1000

    0111.

    1110

    0001


    (1B87.E1) =(0001101110000111.11100001)2


    Octal to Decimal Conversion arrow_upward


  • An octal number can be converted to its decimal equivalent by multiplying each octal digit by its position weight.
  • For example, (35.8)8 can be converted to its decimal equivalent as:
  • (35.8)8 = (3 x 81 + 5 x 80 + 8 x 8-1 ) = (24 +5+ 0.1)

    (35.8)8 = (29.1)10

  • Decimal equivalent of (35.8) is (29.1)10

  • Decimal to Octal Conversion arrow_upward


  • Decimal to octal conversion can be done by dividing the integral part by 8 and writing down the remainder after each division until a quotient of 0 is obtained.
  • For example, (156.1640625)10 can be converted to its octal equivalent as:

  • Division

    Solution

    Octal

    156/8

    19 + Remainder of 4

    4 (LSB)

    19/8

    2 + Remainder of 3

    3

    2/8

    0 + Remainder of 2

    2 (MSB)

    (156)10

    = (234)8


  • For fractional Part it can be done by, multiply the fractional part by 8 and write integer bit of the product and repeat this process till the fractional part of the product is 0.

  • Decimal Fraction

    Product

    Integer digit

    0.1640625 x 8

    1.3125

    1

    MSB

    0.3125 x 8

    2.5

    2

    0.5 x 8

    4.0

    4

    LSB


  • Hence (156. 1640625)10 = (234.124)8

  • Decimal to Hexadecimal Conversion arrow_upward


  • To convert a decimal integer number into hexadecimal number, the decimal number is divided by sixteen repeatedly till the quotient becomes zero.
  • Hex equivalent is obtained by writing the first remainder as LSB and last remainder as MSB.
  • For example (367.25)10 can be converted as:

  • Division

    Remainder

    Hex equivalent

    367/16

    15

    F

    LSB

    22/7

    6

    6

    1/16

    1

    1

    MSB



    Decimal Fraction

    Product

    Hex equivalent

    0.25 x 16

    4.00

    4

    MSB

    .0 x 16

    0

    0

    LSB


  • Hence (367.25)10 = (16F.40)16

  • Hexadecimal to Decimal Conversion arrow_upward


  • Any Hexadecimal number can be converted to its equivalent decimal number by summing the weights of various positions.
  • For example (3AC.25) can be converted as:
  • (3AC.25)16 = (3 X 162 + (A)10 X 161 + (C)12 X 160 + 2 X 16-1 + 5 X 16-2 )

    (3AC.25)16 = 3 X 256 + 160 + 12 + 0.125 + 0.01953125 = (940.14453125)10


    Hexadecimal to Octal Conversion arrow_upward


  • First convert hexadecimal number into binary and then group the binary number by three bits starting from LSB.

  • Hexadecimal
  • Binary
  • 3AC
  • 001110101100
  • 001  110  101  100
  • Octal

  • 1      6       5       4
  • (1654)8


  • Octal to Hexadecimal Conversion arrow_upward


  • The octal to hexadecimal conversion is done in two steps:
  • For example: Convert (1045)8 into hexadecimal.
  • To Binary

  • 1

    0

    4

    5

    001

    000

    100

    101


  • To Hexadecimal

  • 0010

    001

    0101

    2

    2

    5


  • Hence (1045)8 = (225)16


  • Thank You from Kimavi arrow_upward


  • Please email us at Admin@Kimavi.com and help us improve this tutorial.


  • Mark as Complete

    Kimavi Logo

    Terms and conditions, privacy and cookie policy

    YouTube | Facebook | LinkedIn | Twitter | Pinterest | Vimeo | Google Play | @Email | Paid Subscription
    Science | Engineering | Math | Business | English | Medicine | History | Languages | Law | Animals | Social-Studies | Geography

    Tutorials, Videos and Quizzes - Real Simple Education


    humanSuccess = (education) => { `Life, Liberty, and the pursuit of Happiness` }