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

Computer Codes

The document discusses different character coding systems used by computers to represent text and symbols numerically. It describes Binary-Coded Decimal (BCD) which represents decimal numbers using 4-bit binary, Extended Binary-Coded Decimal Interchange Code (EBCDIC) which is an 8-bit code, and the American Standard Code for Information Interchange (ASCII) which is a 7-bit code mapping letters, numbers, and symbols. It also discusses Unicode, the latest industry standard for encoding characters of different scripts, and how it can be implemented using UTF-8, UTF-16 and UTF-32 encodings.

Uploaded by

Aniqa Ashraf
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

Computer Codes

The document discusses different character coding systems used by computers to represent text and symbols numerically. It describes Binary-Coded Decimal (BCD) which represents decimal numbers using 4-bit binary, Extended Binary-Coded Decimal Interchange Code (EBCDIC) which is an 8-bit code, and the American Standard Code for Information Interchange (ASCII) which is a 7-bit code mapping letters, numbers, and symbols. It also discusses Unicode, the latest industry standard for encoding characters of different scripts, and how it can be implemented using UTF-8, UTF-16 and UTF-32 encodings.

Uploaded by

Aniqa Ashraf
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 22

Character codes

Aqsa Ali
SE-101

Character Codes

Binary-Coded Decimal
EBCDIC
ASCII
Unicode

Character codes
Codes are used to represent the letters and special characters (such as +,,*,$,&) in terms of 0s and 1s
Codes means writing program or give information of any type to computer
Weve gone over how digital computers use the binary system to
represent and manipulate numeric values, but have yet to consider how
these internal values can be converted to a form that is meaningful to
humans. This is done through a coding system used by the computer and
how the values are stored and retrieved.

BCD
Binary Coded Decimal (BCD) is very common in electronics,
particularly those that display numerical data, such as alarm clocks
and calculators.
BCD code is the simplest code to represent decimal numbers
In BCD code a decimal number is represented by four binary bits For
example, 3 is represented as 0011
4-bit binary form later extended to 6

Standard BCD codes


Decimal number

Standard BCD codes

0
1
2
3
4
5
6
7
8
9
10
11
12
13
56

0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
00010000
00010001
00010010
00010011
01010110
5

BCD example

Decimal
7
+2
9

BCD
0111
+0 0 1 0
1001

BCD Table
BCD

Decimal

Binary

0
1
2
3
4
5
6
7
8
9

0000 0000
0000 0001
0000 0010
0000 0011
0000 0100
0000 0101
0000 0110
0000 0111
0000 1000
0000 1001

0000 0000
0000 0001
0000 0010
0000 0011
0000 0100
0000 0101
0000 0110
0000 0111
0000 1000
0000 1001

0000 0000
0000 0001
0000 0010
0000 0011
0000 0100
0000 0101
0000 0110
0000 0111
0000 1000
0000 1001

10

0000 1010

0000 0001 0000 0000

0001 0000

11

0000 1011

0000 0001 0000 0001

0001 0001

Unpacked

Packed

EBCDIC

Extended Binary Coded Decimal Interchange Code (EBCDIC)


8-bit binary form, which represent 256 different characters.
1265 = 1111 0001 1111 0010 1111 0110 1101 0101
BCD extended from 6-bit code to 8-bit. So added 2-bits are
zone bits, expanding the zone to 4bits. Hence resulting code
called EBCDIC

EBCDIC
Extended Binary Coded Decimal Interchange Code,
EBCDIC was first developed by IBM and is a coding
method used by computers to present letters,
numbers, or other symbols in a binary language the
computer can understand.
Used mainly on IBM mainframe and IBM midrange
computer operating systems.

ASCII
American Standard Code for Information Interchange

A character-encoding scheme originally based on the English alphabet.

ASCII codes represent text in computers, communications equipment, and


other devices that use text.
ASCII is an industry standard, which assigns letters, numbers, and
other characters .
7-bit (27 =128)
8-bit (28 =256)

ASCII Types
The ASCII table is divided in 3 sections

Non printable, system codes between 0 and 31.

Lower ASCII, between 32 and 127. This table originates from the older, American
systems, which worked on 7-bit character tables.

Higher / Extended ASCII, between 128 and 255 (8 bit). This portion is
programmable; characters are based on the language of your operating system or
program you are using. Foreign letters are also placed in this section.

Printable / Non Printable ASCII

Extended ASCII

Hello, world Example

H
e
l
l
o
,
w
o
r
l
d

=
=
=
=
=
=
=
=
=
=
=
=

Binary
100 1000
110 0101
110 1100
110 1100
110 1111
010 1100
010 0000
111 0111
110 0111
111 0010
110 1100
110 0100

=
=
=
=
=
=
=
=
=
=
=
=

Hexadecimal
48
65
6C
6C
6F
2C
20
77
67
72
6C
64

=
=
=
=
=
=
=
=
=
=
=
=

Decimal
72
101
108
108
111
44
32
119
103
114
108
100

ASCII
The American Standard Code for Information
Interchange (ASCII) was created to better
transmit data between systems.
It is widely used in micro computers
Defines codes for 32 control characters, 10
digits, 52 letters (upper and lower-case), 32
special characters, and more.

ASCII Codes for characters


Alphabetic ASCII-8
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q

10100011
10100010
10100011
10100100
10100101
10100110
10100111
10101000
10101001
10101010
10101011
10101100
10101101
10101110
10101111
10100000
10110001

HEX

Numeric

ASCII-8

HEX

A1
A2
A3
A4
A5
A6
A7
A8
A9
AA
AB
AC
AD
AE
AF
B0
B1

0
1
2
3
4
5
6
7
8
9

01010000
01010001
01010010
01010011
01010100
01010101
01010110
01010111
01011000
01011001

50
51
52
53
54
55
56
57
58
59

18

Unicode
Unicode is a computing industry standard for the consistent encoding
Latest version of Unicode consists of more than
110,000 characters covering 100 scripts.
Unicode can be implemented by different character encodings like
Unicode Transformation Format

UTF-8 an 8-bit variable-width encoding which maximizes compatibility with ASCII.


UTF-16 a 16-bit, variable-width encoding
UTF-32 a 32-bit, fixed-width encoding

Unicode
16-bit base coding with the capacity to encode the majority of characters
used in every language of the world.
Unicode also defines an extension mechanism that will allow for the
coding of an additional million characters.
Unicode provides a unique number for every character, no matter what
the platform, no matter what the program, no matter what the language.
The Unicode Standard has been adopted by such industry leaders as
Apple, HP, IBM, Microsoft, Oracle, java

Arabic Unicode Table


5

U+060x

U+061x

U+062x

U+063x

U+064x

U+065x

U+066x

U+067x

U+068x

U+069x

U+06Ax

U+06Bx

U+06Cx

U+06Dx

U+06Ex

U+06Fx

Questions??

You might also like