logo image - link to home page

Products | Support | Resources | PurchaseContact  | Basket  | Checkout

  Home
  What's New
  Products
  Distributors
  Purchasing Info
  Developer Resources
  Support
  Upgrades
  Site Index
  Contact Us
  Pb-Free Info (RoHS)
 

 

keyword search:
 


 

Home:
  Developer Resources:

Programming Help
    Sample Programs
    Search the
PICBASIC™ List
    PICBASIC PRO™
Compiler Manual
    PICBASIC™ Compiler
Manual
    Serin2/Serout2 Modes
    ASCII Character Set
    Number Conversion
    Floating Point
Routines
    PBP Debug Monitor
    Articles and Tutorials

Hardware Help
    PICmicro® MCU
Selection Guide
    PIC16F62x Datasheet
    PIC16F84A Datasheet
    PIC16F87x Datasheet
    Parts / Vendor List
    PICPROTO™ Boards
    LAB-X1 Docs
    LAB-X2 Docs
    LAB-X20 Docs
    LAB-X3 Docs
    LAB-X4 Docs
    LAB-XUSB Docs
    LAB-XT Docs
     

 Other Resources
    MicroCode Studio
IDE for Windows
    melabs Loader
HEX files
    Links to other sites

Decimal Number System


Overview - Number Systems

Probably the biggest stumbling block most beginning programmers encounter when attempting to learn assembly language is the common use of the binary and hexadecimal numbering systems. Understanding these numbering systems is important because their use simplifies other complex topics including boolean algebra and logic design, signed numeric representation, character codes, and packed data.

Microcontrollers don't use the decimal system to read and write numbers. Instead, they use a binary or two's complement numbering system. To understand the limitations of computer arithmetic, you must understand how computers represent numbers.

There are three number bases commonly used in PICBASIC. These are:

Name Base Symbol
Binary Base 2 %
Decimal Base 10 none
Hexadecimal Base 16 $

The Decimal Number Base Systems

The Decimal Number System uses base 10. It includes the digits from 0 through 9. The weighted values for each position is as follows:

Power of 10: 107 106 105 104 103 102 101 100
Value: 10000000 1000000 100000 10000 1000 100 10 1

You have been using the decimal (base 10) numbering system for so long that you often take it for granted. When you see a number like "123", you don't think about the value 123. Instead, you generate a mental image of how many items this value represents. In reality, however, the number 123 represents:

(1 * 102) + (2 * 101) + (3 * 100) =

(1 * 100) + (2 * 10) + (3 * 1) =

100 + 20 + 3 =

123

 

Copyright 2008
microEngineering Labs, Inc.
Box 60039
Colorado Springs CO 80960
(719) 520-5323
(719) 520-1867 fax
email: support@melabs.com

Last Updated: 01/04/2008

Home | What's New | Products | Support
Resources
| Purchase | Index Contact

PIC, PICmicro, dsPIC, and  MPLAB are registered trademarks of Microchip Technology Inc. in the USA and other countries.  PICBASIC, PICBASIC PRO, PICPROTO, and EPIC are trademarks of Microchip Technology Inc. in the USA and other countries.   BASIC Stamp is a trademark of Parallax, Inc.

Microchip third-party partner  Microchip Consultant Program Member