Computer system
1.3 Information Coding Scheme
SC015-COMPUTER SCIENCE
Chapter 1: Computer System
1.3 Information Coding Scheme
Learning Outcomes :
At the end of the lesson, students should be
able to:
a) Describe how computers encode characters using ASCII (8 bits),
EBCDIC, Unicode.
b) Calculate the total number of bits/bytes in a given word based on each
coding scheme. (clo1)
c) Differentiate the coding system based on number of bits and total
number of character represented. (clo3)
1.3 Information Coding Scheme
What is Information Coding Scheme?
Definition :
The combinations of 0s and 1s that represent characters
are defined by patterns.
Example:
Hey = 01001000 01100101 01111001
1.3 Information Coding Scheme
Type of coding systems
:
1.3 Information Coding Scheme
Example of coding system
:
1.3 Information Coding Scheme
ASCII
ASCII = American Standard Code for Information
Interchange.
ASCII uses 8 bits to represent a character.
The 8th bit in the ASCII code is a parity bit.
This is used to perform a parity check (used for error checking).
For example, the ASCII code for lower case z is 122 and is shown
below:
Parity 64 32 16 8 4 2 1
Bit
01111010
1.3 Information Coding Scheme
ASCII
There are two (2) ways for error checking:
Even parity: Where the 8th bit is set such that the total number of 1s
in the 8-bit code word is even.
01000001
Odd Parity: The 8th bit is set such that the total number of 1s in the 8-
bit code word is odd.
11000001
1.3 Information Coding Scheme
ASCII
• Most widely used to represent data.
• Sufficient for English and Western European character only
• Traditionally used with PCs.
• ASCII uses 8 bits to represent 1 character.
• ASCII provides codes for 256 characters
(28=256).
1.3 Information Coding Scheme
ASCII
Characters include:
• number :(e.g. 4,7,8)
• letter – uppercase and lowercase:(Y, y)
• punctuation mark (?, !), or other
• symbol (^, &)
• that is represented by a single byte in the
ASCII and EBCDIC coding scheme.
1.3 Information Coding Scheme
1.3 Information Coding Scheme ASCII
• Example :
COMPUTER
1 2 3 4 5 6 78
ASCII
8 characters involved in the word
8 bits per character
8 characters X 8 bits = 64 bits used in the
memory of the computer
64Byte= bits / 8 = 8 bytes
1.3 Information Coding Scheme ASCII
• Example :
C O M P U T E R.
1 2 3 4 5 6 7 89
ASCII
9 characters involved in the word
8 bits per character
9 characters X 8 bits = 73 bits used in the
memory of the computer
73Byte= bits / 8 = 9 bytes
1.3 Information Coding Scheme
• Example : ASCII
COMPUTER SCIENCE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
16 characters including space
ASCII
16 characters involved in the word
8 bits per character
16 characters X 8 bits = 128 bits used in the
memory of the computer
Byte= 128 bits / 8 = 16 bytes
1.3 Information Coding Scheme
EBCDIC
• The Extended Binary Coded Decimal Interchange
Code (EBCDIC) uses 8 bits (4 bits for zone, 4 bits for
digit) to represent a symbol in the data.
00000000
Zone Digits
EBCDIC allows 2 8 = 256 combinations of bits.
1.3 Information Coding Scheme
EBCDIC
• Extended Binary-Coded Decimal Interchange Code
• Developed by IBM
• Sufficient for English and Western European
• Primarily used on mainframes and high-end servers
• Uses 8 digit code (8 bits) for 1 character
• Can represent up to 256 characters - (28 = 256)
1.3 Information Coding Scheme
EBCDIC CODE
1.3 Information Coding Scheme EBCDIC
• Example :
COMPUTER
1 2 3 4 5 6 78
EBCDIC
8 characters involved in the word
8 bits per character
8 characters X 8 bits = 64 bits used in the
memory of the computer
64Byte= bits / 8 = 8 bytes
1.3 Information Coding Scheme EBCDIC
• Example :
C O M P U T E R.
1 2 3 4 5 6 7 89
EBCDIC
9 characters involved in the word
8 bits per character
9 characters X 8 bits = 73 bits used in the
memory of the computer
73Byte= bits / 8 = 9 bytes
1.3 Information Coding Scheme
• Example : EBCDIC
COMPUTER SCIENCE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
16 characters including space
EBCDIC
16 characters involved in the word
8 bits per character
16 characters X 8 bits = 128 bits used in the
memory of the computer
Byte= 128 bits / 8 = 16 bytes
1.3 Information Coding Scheme
Unicode
• Unicode is a 16-bit coding scheme that has
the capacity of representing all the world’s
current languages, as well as classic and
historical languages.
1.3 Information Coding Scheme
Unicode
• Unicode is a universal character encoding standard
for the representation of text which includes letters,
numbers and symbols in multi-lingual environments.
• Unicode codes can uniquely represent any
character or symbol present in any language
like Chinese, Japanese etc.
1.3 Information Coding Scheme
Unicode
• Can represent 65,536 characters and
symbols(216)
• Uses 16 digit code (16 bits) for 1 character.
• Implemented in several OS (Windows, Mac
OS & Linux).
1.3 Information Coding Scheme Unicode
Scan for more
Unicode
example
Click for more Unicode example
1.3 Information Coding Scheme
Unicode
Why uses Unicode is the most widely used coding
scheme?
ASCII and EBCDIC are limited to just the basic English
letters and common symbols.
Today computers use many different symbols
including letters from languages that don’t use
English letters (e.g. Hebrew, Chinese, etc) and
international symbols (e.g. the English pound sign).
Advantage
Can be used worldwide with consistent and
unambiguous results.
Modern programs are moving towards using Unicode
to store letters and symbols.
1.3 Information Coding Scheme Unicode
• Example :
COMPUTER
1 2 3 4 5 6 78
EBCDIC
8 characters involved in the word
16 bits per character
8 characters X 16 bits = 128 bits used in the
memory of the computer
Byte= 128 bits / 8 = 16 bytes
1.3 Information Coding Scheme Unicode
• Example :
C O M P U T E R.
1 2 3 4 5 6 7 89
EBCDIC
9 characters involved in the word
16 bits per character
9 characters X 16 bits = 144 bits used in the
memory of the computer
Byte= 144 bits / 8 = 18 bytes
1.3 Information Coding Scheme
• Example : Unicode
COMPUTER SCIENCE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
16 characters including space
EBCDIC
16 characters involved in the word
16 bits per character
16 characters X 16 bits = 256 bits used in the
memory of the computer
Byte= 256 bits / 8 = 32 bytes
1.3 Information Coding Scheme
Number of characters represented
ASCII EBCDIC Unicode
Represents Represents Represents
256 256 65,536
characters characters characters.
1.3 Information Coding Scheme
Number of bits used by a character.
ASCII EBCDIC Unicode
Uses 8 bits to Uses 8 bits to Uses 16 bits to
represent a represent a represent a
character character character
1.3 Information Coding Scheme
Context of use.
ASCII EBCDIC Unicode
used on particularly used on
many used on IBM many
different mainframe different
computer computer
system system
1.3 Information Coding Scheme
Represent different number of bits/bytes
used for each character..
ASCII 8 bits 1 byte
EBCDIC 8 bits 1 byte
Unicode 16 bits 2 bytes
1.3 Information Coding Scheme
ASCII 0 100000 1
Letter “A” = 1 byte
01000001
EBCDIC
Letter “A” = 1 byte
Unicode
0000000001000001
Letter “A” = 2 bytes
1.3 Information Coding Scheme
Represent different language.
ASCII EBCDIC Unicode
English & English & World’s current
Western Western languages,
languages languages classic &
historical
languages
1.3 Information Coding Scheme
Differences between ASCII, EBCDIC and Unicode.
Criteria ASCII EBCDIC Unicode
Number of bits used Uses 8 bits to Uses 8 bits to Uses 16 bits to
represent a represent a represent a
character character character
Number of Can represent 256 Can represent 256 Can represent
characters characters (28 = 256) characters (28 = 256) more than 65,536
represent characters and
Context of use symbols
used on many particularly used on used on many
different IBM different computer
computer system mainframe system
1.3 Information Coding Scheme
Q1. How many bits would it take to represent
the following phrase using ASCII code?
#I_Love Malaysia …
1.3 Information Coding Scheme
Q2. How many bits would it take to represent
the following phrase using EBCDIC code?
KMPP!!KMPP!! KMPP !
1.3 Information Coding Scheme
Q3. How many byte would it take to
represent the following phrase using Unicode
code?
KMPP is Awesome !!!
For summary click. Or scan
For video ASCII click.
Or Scan
©Computer science unit KMPP 2021