Skip to content Skip to navigation

Connexions

You are here: Home » Content » Binary and Hexadecimal Notation

Navigation

Content Actions

  • Download module PDF
  • Add to ...
    Add the module to:
    • My Favorites
    • A lens
    • An external social bookmarking service
    • My Favorites (What is 'My Favorites'?)
      'My Favorites' is a special kind of lens which you can use to bookmark modules and collections directly in Connexions. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need a Connexions account to use 'My Favorites'.
    • A lens (What is a lens?)

      Definition of a lens

      Lenses

      A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

      What is in a lens?

      Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

      Who can create a lens?

      Any individual Connexions member, a community, or a respected organization.

    • External bookmarks
  • E-mail the authors

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual Connexions member, a community, or a respected organization.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • TI MSP430

    This module is included inLens: Texas Instruments MSP430
    By: Texas InstrumentsAs a part of collection:"Microcontroller and Embedded Systems Laboratory"

    Comments:

    "Basic introduction to microcontroller-based embedded systems development. Includes structured laboratory exercises in the following areas: assembly programming, C language programming, peripheral […]"

    Click the "TI MSP430" link to see all content affiliated with them.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.

Binary and Hexadecimal Notation

Module by: CJ Ganier, Patrick Frantz

Summary: Explains binary and hexadecimal numbers and how to convert them.

Because of the nature of the digital systems, it is necessary to be able to represent numbers as being composed of only 1’s and 0’s. Ordinarily we represent numbers using the characters 0-9, and this notation is called base 10 or decimal notation. Using only the characters 1 and 0 is called binary notation or base 2 (because there are only 2 characters to represent the number instead of 10). Converting integers between these two systems is easy. In base 10 each decimal place represents the number of a certain power of 10. Thus the one’s place(10^0), 10’s place(10^1), 100’s place (10^2) etc. In base 2 each place represents a corresponding power of 2.

To convert a base 10 number into its base 2 form, begin at the 2’s place of the largest power of two smaller than the base 10 number you are converting. This will be the highest 1 digit of the base two number. Now see if the next smaller power of 2 is larger than the reminder of your base 10 number. If it is the next place in the base two number is a 0 if its smaller, subtract the power of two from the base 10 number and put a 1 in the next place. Repeat this until you have reached the 2^0 place. To convert back, go through each power of two place in the binary number and multiply it by the corresponding power of two. Sum these products to get the decimal version of the binary number.

Example 1

steps in converting to base 2

  1. 721-512=209 721512 209 so the first bit is 1×291 29
  2. 209<256209256 so the second bit is 0×28028
  3. 209-128=8120912881 so the third bit is 0×27027
  4. 81-64=17 8164 17 so the fourth bit is 1×26126
  5. 17<32 1732 so the fifth bit is 0×25025
  6. 17-16=1 1716 1 so the sixth bit is 1×24124
  7. 1 <81 8 so the seventh bit is 0×23023
  8. 1<414 so the eigth bit is 0×22022
  9. 1<212 so the ninth bit is 0×21021
  10. 1-1=01 1 0 so the tenth bit is 1×20120
  11. thus the conversion: 721=10110100012 721 1011010001

This method works backwards also, starting from 101101000121011010001 and expanding each digit by its appropriate exponent.

Exercise 1

What is 293293 in binary? What is 111000121110001 in decimal?

Solution 1

293=1001001012293100100101 and 11100012=1131110001113

Hexadecimal is another numerical convention that is really base 16. It uses the characters 0-9 for its first 10 numbers and the letters A-F to represent 10 through 15. Conversion between it and base 10 numbers proceeds the same as base 2 substituting powers of 16 for powers of 2. However, the important use of hexadecimal numbers is as an abbreviation for binary; because binary representation of large numbers becomes quite long. When programming, hexadecimal numbers should be prefaced with 0x to indicate that they are hexadecimal numbers rather than variable names etc. Thus 14 is a decimal number in C, and 0x14 is a hexadecimal number (actually equal to 20 in decimal). Below is a the list of expansions for hexadecimal to binary to decimal.

binary to hexadecimal equivalence

  • 00002=016=00000 0 0
  • 00012=116=10001 1 1
  • 00102=216=20010 2 2
  • 00112=316=30011 3 3
  • 01002=416=40100 4 4
  • 01012=516=50101 5 5
  • 01102=616=60110 6 6
  • 01112=716=70111 7 7
  • 10002=816=81000 8 8
  • 10012=916=91001 9 9
  • 10102=A16=101010 A 10
  • 10112=B16=111011 B 11
  • 11002=C16=121100 C 12
  • 11012=D16=131101 D 13
  • 11102=E16=141110 E 14
  • 11112=F16=151111 F 15

Comments, questions, feedback, criticisms?

Send feedback