ASCII and Number System

ASCII
ASCII (American Standard Code for Information Interchange), was developed from telegraph code. Work on the ASCII standard began on October 6, 1960.
They set a unique code for each character. Such as
A = 65
B = 66
Z = 90
a = 97
b = 98

In this way they have set a unique value for 128 characters.

Nul=0     SOH=1     SIX=2     ETX=3     EOT=4     ENQ=5     ACK=6     BEL=7     BS=8     HT=9     LF=10     VT=11     FF=12     CR=13     SO=14     SI=15     DLE=16     DCI=17     DC2=18     DC3=19     DC4=20     NAK=21     SYN=22     ETB=23     CAN=24     EM=25     SUB=26     ESC=27     FS=28     GS=29     RS=30     US=31     SP=32     !=33     "=34     #=35     $=36     %=37     &=38     '=39     (=40     )=41     *=42     +=43     ,=44     -=45     .=46     /=47   0=48      1=49     2=50     3=51     4=52     5=53     6=54     7=55     8=56     9=57     :=58     ;=59     <=60     =(equal to)=61     >=62     ?=63     @=64     A=65     B=66     C=67     D=68     E=69     F=70     G=71     H=72     I=73     J=74     K=75     L=76     M=77     N=78   O=79     P=80     Q=81     R=82     S=83     T=84     U=85     V=86     W=87     X=88     Y=89     Z=90     [=91     \=92   ]=93     ^=94     _=95     '=96     a=97     b=98     c=99     d=100     e=101     f=102     g=103     h=104     i=105     j=106     k=107     l=108     m=109     n=110     o=111     p=112     q=113     r=114     s=115     t=116     u=117     v=118     w=119     x=120     y=121     z=122     {=123     |=124     }=125     ~=126     DEL=127


Wow... We've got unique code for each characters. Now we need to convert this codes into 01 combination. So that we can pass through the cable.
01 combination Numbers are called Binary Number System and ASCII values are in Decimal Number System. We have to know how to convert Decimal to Binary.
That's why will learn a little about Number Systems.

Number Systems: 
Number Systems are the different format of a same number. Computer uses different types of Number Systems for its internal uses such as store, transmit.

There are 4 kind of number systems

1.      Decimal
2.       Binary
3.      Octal
4.       Hexadecimal

What we have learned mathematical term from our educational institute all in Decimal Format. So Decimal Number System is just well known and simple to us.
All ASCII values are in Decimal numbers. There are total 10 digits here. They are 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. 
Binary are 2 digits- 0 and 1. 
Octal is total 8 digits. They are 0, 1, 2, 3, 4, 5, 6 and 7. 
There are 16 digits in Hexadecimal. They are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F. Here, A=10 and F=15. So 10 means 16

3 number systems are important. They are Decimal, Binary and Hexadecimal. We have to know convert number from one number system to another.

Decimal – Binary:
Computer converts ASCII or any Decimal value into Binary. Such as A=65 converts into binary is:
2|65|1
2|32|0
2|16|0
2|  8|0
2|  4|0
2|  2|0
     1
So the binary of 65 or A is 1000001. There are 7 bits. If we want to think it as a Byte, then we can write 01000001. Cause we know 8-bit = 1 Byte. Computers do this conversion for their internal processing.

Binary to Decimal:
Binary: 01000001
= 0*27 + 1*26 + 0*25 + 0*24 + 0*23 + 0*22 + 0*21 + 1*20
= 0*128 + 1*64 + 0*32 + 0*16 + 0*8 + 0*4 + 0*2 + 1*1
= 0 + 64 + 0 + 0 + 0 + 0 + 0 + 1
= 65

All these are traditional way and it takes so much time for calculation. But we need to calculate so faster as we can using below power table

Decimal to Binary:
So we will build a power table that we can
128
64
32
16
8
4
2
1









Now will convert 222 into binary. So we will put 1 in 128. Cause 128 is less then 222.
128
64
32
16
8
4
2
1
1








128 + 64 = 192 is less than 222. So we will put 1 also in 64
128
64
32
16
8
4
2
1
1
1







192 + 32 = 224 is greater than 222 so we will put 0
192 + 16 = 208 is less than 222 so we will put 1
128
64
32
16
8
4
2
1
1
1
0
1





208 + 8 = 216 is less than 222 and we will put 1
128
64
32
16
8
4
2
1
1
1
0
1
1




216 + 4 = 220 is less than 222 and we will put 1
220 + 2 = 222 is equal to 222 and we will put 1 and rest of 0.
128
64
32
16
8
4
2
1
1
1
0
1
1
1
1
0

So Decimal 222 and binary is 11011110

Binary to Decimal:
11110011=128+64+32+16+0+0+2+1=243

Decimal to Hexadecimal:
Decimal=205
We will make it Binary first 11001101
We know in Hexadecimal number total digit is 16 and total bit of 16 is 1111 that means 4. So we will separate that binary number by 4 digits. So it will be 1100 and 1101. 1100 decimal value is 12 that means hexadecimal is C and 1101 decimal value is 13 and hexadecimal is D. So hexadecimal of (205)10 is (CD)16.

Hexadecimal to Decimal:
Hexadecimal: F1
Binary: 1111 0001
Decimal is: 241

Interesting is that, data stored in and supplied from computer as 0, 1 bits, called digital data.

Great. We have learned how to send data through cable. But at receiver end should also know the tricks to receive signal and convert into data in a same way. So there should be a certain rules for each computer. Set of rule is called Protocol. So we have to install protocols in each computer through NIC, so that both-end can send and receive data with same rules.
Now we will  learn little about Protocol.


to continue reading click on Next
Back      Next

Related Topics:
If you have more interest to know modulation and demodulation advance process you can read these topics too
* Signal
* Analog to Digital Data
* Digital Data to Digitally analog signal

Click image to go:
http://nadimall.blogspot.com/2013/10/turorial-list.html

http://www.facebook.com/nadimallblog?ref=aymt_homepage_panel

to share this page with your friends, select below

No comments:

Post a Comment