0% found this document useful (0 votes)
1K views

ASCII Codes PDF

ASCII is a 7-bit character encoding standard used to represent text and other information in digital form. It was developed in 1963 and assigns a unique numeric value to each letter, number, punctuation mark, and control code. Computers store text files using the ASCII numeric codes to represent each character, with one byte used per character. While humans view text as letters, internally computers handle all data as binary numbers and use ASCII to translate between character representations and their numeric codes.

Uploaded by

Rana M Umair
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)
1K views

ASCII Codes PDF

ASCII is a 7-bit character encoding standard used to represent text and other information in digital form. It was developed in 1963 and assigns a unique numeric value to each letter, number, punctuation mark, and control code. Computers store text files using the ASCII numeric codes to represent each character, with one byte used per character. While humans view text as letters, internally computers handle all data as binary numbers and use ASCII to translate between character representations and their numeric codes.

Uploaded by

Rana M Umair
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/ 16

ASCII and Unicode

From Bit & Bytes to ASCII


• Bytes can represent any
collection of items using a
“look-up table” approach
• ASCII is used to represent
characters

ASCII
American Standard Code for Information
Interchange
http://en.wikipedia.org/wiki/ASCII
ASCII
• It is an acronym for the American Standard Code for
Information Interchange.
• It is a standard seven-bit code that was first
proposed by the American National Standards
Institute or ANSI in 1963, and finalized in 1968 as
ANSI Standard X3.4.
• The purpose of ASCII was to provide a standard code
various to symbols ( visible and invisible symbols)
ASCII
• In the ASCII character set, each binary value
between 0 and 127 represents a specific
character.
• Most computers extend the ASCII character
set to use the full range of 256 characters
available in a byte. The upper 128 characters
handle special things like accented characters
from common foreign languages.
• In general, ASCII works by assigning standard
numeric values to letters, numbers,
punctuation marks and other characters such
as control codes.
• An uppercase "A," for example, is represented
by the decimal number 65."
Bytes: ASCII

• By looking at the ASCII table, you can clearly see a


one-to-one correspondence between each character
and the ASCII code used.
• For example, 32 is the ASCII code for a space.
• We could expand these decimal numbers out to
binary numbers (so 32 = 00100000), if we wanted to
be technically correct -- that is how the computer
really deals with things.
Bytes: ASCII

• Computers store text documents, both on disk and in


memory, using these ASCII codes.
• For example, if you use Notepad in Windows XP/2000 to
create a text file containing the words, "Four score and seven
years ago," Notepad would use 1 byte of memory per
character (including 1 byte for each space character between
the words -- ASCII character 32).

• When Notepad stores the sentence in a file on disk, the file


will also contain 1 byte per character and per space.
• Binary number is usually displayed as Hexadecimal to save
display space.
• Take a look at a file size now.
• Take a look at the space of your p drive
Bytes: ASCII

• If you were to look at the file as a computer


looks at it, you would find that each byte
contains not a letter but a number -- the
number is the ASCII code corresponding to the
character (see below). So on disk, the numbers
for the file look like this:
• Fourandseven
• 70 111 117 114 32 97 110 100 32 115 101 118
101 110
• Externally, it appears that human beings will use
natural languages symbols to communicate with
computer.
• But internally, computer will convert everything into
binary data.
• Then process all information in binary world.
• Finally, computer will convert binary information to
human understandable languages.
• When you type the letter A, the hardware
logic built into the keyboard automatically
translates that character into the ASCII code
65, which is then sent to the computer.
Similarly, when the computer sends the ASCII
code 65 to the screen, the letter A appears.
ascii
ASCII stands for American Standard Code for
Information Interchange
First published on October 6, 1960
ASCII is a type of binary data
Ascii part 2
ASCII is a character encoding scheme that
encodes 128 different characters into 7 bit
integers
Computers can only read numbers, so ASCII is
a numerical representation of special
characters
Ex: ‘%’ ‘!’ ‘?’
Ascii part 3
 ASCII code assigns a number
for each English character
 Each letter is assigned a
number from 0-127
 Ex: An uppercase ‘m’ has
the ASCII code of 77
 By 2007, ASCII was the most
commonly used character
encoding program on the
internet
revisit “char” data type
• In C, single characters are represented using
the data type char, which is one of the most
important scalar data types.
char achar;
achar=‘A’;
achar=65;
Character and integer
• A character and an integer (actually a small
integer spanning only 8 bits) are actually
indistinguishable on their own. If you want to
use it as a char, it will be a char, if you want to
use it as an integer, it will be an integer, as
long as you know how to use proper C++
statements to express your intentions.

You might also like