Hello Readers:
I have started this blog to show you Embedded C programming for 8051 family microcontroller using KEIL compiler. The KISS philosophy is used to write this tutorial. What is KISS? Keep It Simple, Stupid!
1.1 Introduction to Numbers & Coding Systems
Note:
- For detailed explanation of numbers and coding systems refer any Digital Communications book or google search the net.
- For finding equivalent numbers or converting between decimal, binary and hexadecimal number systems, use Windows calculator.
Start Menu->All Programs->Accessories->calculator.
Decimal Number Systems:
Humans are having ten fingers, hence he uses decimal number system. This number system uses 10 as its base number, as it is having ten digits 0 to 9.Fig 1.1.1 shows how four digit decimal numbers is formed with the help of their position value. The Left Most Digit [i.e., 4] is referred as Least Significant Bit, as it carries least weightage [i.e., 100=1]. The Right Most Digit [i.e., 1] is referred as Most Significant Bit, as it carries highest weightage [i.e., 103=1000].
Binary Number Systems:
Computer or Microcontroller is made of electronic circuits and having only two states: ON and OFF. These two states are represented by numbers 1 and 0. Hence it is called as binary [bi-two] number systems and having 2 as its base number.
Hexadecimal Number Systems:
Let us see memory map of on-chip ROM of three microcontrollers, as shown in Table 1.1.3.In Table 1.1.3, the last column, is having address range in binary. Suppose you write that column values two-three times in each page can you figure-it out exactly what that number means, without any error?
The hexadecimal number system uses 16 as its base as it is having 16 numbers. It is shown in Table 1.1.4. Note that first 10 numbers are decimal only [0-9], but next 6 digits are alphabets [A-F]. Thus in hexadecimal number system nibble [4-bits] is represented by 16 single numbers/characters. Note that hexadecimal numbers are suffix with letter ‘h’, e.g., 0FFF h.
First Thing Last:
There is an apartment with 5 floors and each floor is having 10 flats. How you number them?The Apartment Flat Numbering Diagram in deciaml method is shown in Fig 1.1.8. So now we can say that:
Apartment is having 50 flats and address range is 1 to 50.
Note that Floor I is numbered from 1 to 10, where first nine numbers are single digit and last number is two digits [i.e., 10]. The Floor II is numbered from 11 to 20, where first nine numbers are having 1 as their MSB and last number [i.e, 20] is having 2 as its MSB. Same thing can be observed for Floor III, IV & V also.
In digital electronics every bit is counted and it comes with cost. That means every bit-information is stored in its own memory cell, which is constructed by electronics components. So to store large amount of bit information, such as Apartment Flat Numbers there must be some logic and order is needed. So in digital electronics numbering is started from ZERO and not from ONE. The other reason for using Zero as first number is binary number system has ZERO as its one state.
The new Apartment Flat Numbering Diagram with binary method is shown in Fig 1.1.9. So now we can say that:
Apartment is having 50 flats and address range is 00 to 49 [50-1].
...till next post bye-bye & take care.
No comments:
Post a Comment