0% found this document useful (0 votes)
13 views10 pages

Ascii

Uploaded by

krkrwassim7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views10 pages

Ascii

Uploaded by

krkrwassim7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

6.

Coding and Representation α


numeric
1- ASCII code
 ASCII (American Standard Code For Information
Interchange) is a computer coding standard developed in
the 1960s.

 This code defines 128 characters represented on 8 bits.

1
The letter M is located at the
intersection of line 4 and column
D.

its code is 4D in hexadecimal.


Le Code ASCII
Its representation is : 0100 1101 in
ASCII code

Control characters

2
 Exercise: (TD)
1/ In ASCII code, (41)16 is 'A' and (30)16 is '0'.
Without using the ASCII code table, deduce the
encoding of the following message: STRM1
A= 41 B= 42 …. I= 49 J= 4A K= 4B…. O=4F P=50
0= 30 1=31 …
STRM1 = ????

2/ Decode the following message:


57454C434F4D4520494E20434F4D50555442055253434
9454E4345

3
2. BCD code (Binary Coded Decimal )

applies to base 10 digits

Only Each decimal digit is


represented directly by its
binary value on a 4-bit format

Examples :

(13)10=(0001 0011) BCD


( 987 )10 = ( 1001 1000 0111 )BCD

4
3. Gray code

In pure binary code, the transition from one number to the


next is expressed by a change of one or more bits. A change
from 3 to 4 in decimal gives 011 to 100 in binary. All three bits
change simultaneously. This sometimes has disadvantages

invented at Bell
Labs by engineer
Frank Gray and
patented in 1953

Gray's code is a binary code that allows you to go from an integer


N to the next number (N+1) by changing a single bit.

5
1- Conversion binary-gray To obtain Gray's code from pure binary, we
retain the first bit of pure binary, i.e. the
+ + + first bit of pure binary remains the first
Bn-1Bn-2 Bn-3 ..B1B0 bit of Gray's reflected binary. The first bit
of pure binary is added to the second bit
of pure binary to obtain the second bit of
reflected binary. The second bit of pure
binary is then added to the third bit of
Gn-1Gn-2 Gn-3 ..G1G0 pure binary to obtain the third bit of
reflected binary, and so on.

Addition
Example: without
(11001)2= (?)gray carry
+ + + +
1 1 0 0 1

1 0 1 0 1
(11001)2=(10101)gray
6
2- Conversion gray-binary
To obtain the binary code from the Gay code,
we retain the first Gray bit, i.e. the first Gray
Gn-1Gn-2 Gn-3 ..G1G0 bit remains the first binary bit. The first binary
bit is added to the second pure Gray bit to
obtain the second binary bit. The second
+ + + binary bit is then added to the third pure Gray
bit to obtain the third binary bit, and so on.
Bn-1Bn-2 Bn-3 ..B1 B0
Addition
without
carry

Example:
(10111)gray=(?)2

1 01 1 1
+
1 10 1 0 (10111)gray=(11010)2
7
Table of gray codes

8
The code for ê is 00EA
4. UNICODE code
its UNICODE representation
is 0000 0000 1110 1010

9
‫‪ is‬جؐ ‪The code for the letter‬‬
‫‪062C‬‬

‫‪its representation is 0000 0110‬‬


‫‪ Arabic characters‬‬ ‫‪0010 1100‬‬
‫‪0‬‬ ‫‪1‬‬ ‫‪2‬‬ ‫‪3‬‬ ‫‪4‬‬ ‫‪5‬‬ ‫‪6‬‬ ‫‪7‬‬ ‫‪8‬‬ ‫‪9‬‬ ‫‪A‬‬ ‫‪B‬‬ ‫‪C‬‬ ‫‪D‬‬ ‫‪E‬‬ ‫‪F‬‬
‫‪060‬‬ ‫؀‬ ‫؁‬ ‫؂‬ ‫؃‬ ‫‪؄‬‬ ‫‪؅‬‬ ‫‪؆‬‬ ‫‪؇‬‬ ‫‪؈‬‬ ‫‪؉‬‬ ‫‪؊‬‬ ‫‪؋‬‬ ‫‪،‬‬ ‫؍‬ ‫؎‬ ‫؏‬
‫‪061‬‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫ؖ‬
‫سؐ‬ ‫ؗ‬
‫سؐ‬ ‫سؐ‬
‫ؘ‬ ‫سؐ‬
‫ؙ‬ ‫ؚسؐ‬ ‫؛‬ ‫‪ALM‬‬ ‫؞‬ ‫؟‬
‫‪062‬‬ ‫ؠ‬ ‫ء‬ ‫آ‬ ‫أ‬ ‫ؤ‬ ‫إ‬ ‫ئ‬ ‫ا‬ ‫ب‬ ‫ة‬ ‫ت‬ ‫ث‬ ‫ج‬ ‫ح‬ ‫خ‬ ‫د‬
‫‪063‬‬ ‫ذ‬ ‫ر‬ ‫ز‬ ‫س‬ ‫ش‬ ‫ص‬ ‫ض‬ ‫ط‬ ‫ظ‬ ‫ع‬ ‫غ‬ ‫ػ‬ ‫ؼ‬ ‫ؽ‬ ‫ؾ‬ ‫ؿ‬
‫‪064‬‬ ‫ـ‬ ‫ف‬ ‫ق‬ ‫ك‬ ‫ل‬ ‫م‬ ‫ن‬ ‫ه‬ ‫و‬ ‫ى‬ ‫ي‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬
‫‪065‬‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬
‫‪066‬‬ ‫‪٠‬‬ ‫‪١‬‬ ‫‪٢‬‬ ‫‪٣‬‬ ‫‪٤‬‬ ‫‪٥‬‬ ‫‪٦‬‬ ‫‪٧‬‬ ‫‪٨‬‬ ‫‪٩‬‬ ‫‪٪‬‬ ‫‪٫‬‬ ‫‪٬‬‬ ‫٭‬ ‫ٮ‬ ‫ٯ‬
‫‪067‬‬ ‫سؐ‬ ‫ٱ‬ ‫ٲ‬ ‫ٳ‬ ‫ٵ‬ ‫ٶ‬ ‫ٷ‬ ‫ٸ‬ ‫ٹ‬ ‫ٺ‬ ‫ٻ‬ ‫ټ‬ ‫ٽ‬ ‫پ‬ ‫ٿ‬
‫‪068‬‬ ‫ڀ‬ ‫ځ‬ ‫ڂ‬ ‫ڃ‬ ‫ڄ‬ ‫څ‬ ‫چ‬ ‫ڇ‬ ‫ڈ‬ ‫ډ‬ ‫ڊ‬ ‫ڋ‬ ‫ڌ‬ ‫ڍ‬ ‫ڎ‬ ‫ڏ‬
‫‪069‬‬ ‫ڐ‬ ‫ڑ‬ ‫ڒ‬ ‫ړ‬ ‫ڔ‬ ‫ڕ‬ ‫ږ‬ ‫ڗ‬ ‫ژ‬ ‫ڙ‬ ‫ښ‬ ‫ڛ‬ ‫ڜ‬ ‫ڝ‬ ‫ڞ‬ ‫ڟ‬
‫‪06A‬‬ ‫ڠ‬ ‫ڡ‬ ‫ڢ‬ ‫ڣ‬ ‫ڤ‬ ‫ڥ‬ ‫ڦ‬ ‫ڧ‬ ‫ڨ‬ ‫ک‬ ‫ڪ‬ ‫ګ‬ ‫ڬ‬ ‫ڭ‬ ‫ڮ‬ ‫گ‬
‫‪06B‬‬ ‫ڰ‬ ‫ڱ‬ ‫ڲ‬ ‫ڳ‬ ‫ڴ‬ ‫ڵ‬ ‫ڶ‬ ‫ڷ‬ ‫ڸ‬ ‫ڹ‬ ‫ں‬ ‫ڻ‬ ‫ڼ‬ ‫ڽ‬ ‫ھ‬ ‫ڿ‬
‫‪06C‬‬ ‫ۀ‬ ‫ه‬ ‫ۀ‬ ‫ة‬ ‫ۄ‬ ‫ۅ‬ ‫ۆ‬ ‫ۇ‬ ‫ۈ‬ ‫ۉ‬ ‫ۊ‬ ‫ۋ‬ ‫ی‬ ‫ۍ‬ ‫ێ‬ ‫ۏ‬
‫‪06D‬‬ ‫ې‬ ‫ۑ‬ ‫ے‬ ‫ۓ‬ ‫۔‬ ‫ە‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫۝‬ ‫۞‬ ‫سؐ‬
‫‪06E‬‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫ۥ‬ ‫ۦ‬ ‫سؐ‬ ‫سؐ‬ ‫۩‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫سؐ‬ ‫ۮ‬ ‫ۯ‬
‫‪06F‬‬ ‫‪٠‬‬ ‫‪١‬‬ ‫‪٢‬‬ ‫‪٣‬‬ ‫‪۴‬‬ ‫‪۵‬‬ ‫‪۶‬‬ ‫‪٧‬‬ ‫‪٨‬‬ ‫‪٩‬‬ ‫ۺ‬ ‫ۻ‬ ‫ۼ‬ ‫۽‬ ‫۾‬ ‫ۿ‬
‫‪10‬‬

You might also like