0% found this document useful (0 votes)
3 views

DLD Week 2 Class 2 (3)

Uploaded by

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

DLD Week 2 Class 2 (3)

Uploaded by

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

Week 2 Class 2

2/6/2023 Lec Md Shadman Aadeeb, Dept. of CSE 1


Alphanumeric Codes

2/6/2023 Lec Md Shadman Aadeeb, Dept. of CSE 2


Why do we need alphanumeric codes?
Addresses 8 bit locations
000
001
010
011
100
101
110

Fig: RAM
Lec Md Shadman Aadeeb, Dept. of CSE
2/6/2023
3
Why do we need alphanumeric codes?
Addresses 8 bit locations
000
001
010 0101 1001
89 Dec2Bin

011
100
101
110

Fig: RAM
Lec Md Shadman Aadeeb, Dept. of CSE
2/6/2023
4
Why do we need alphanumeric codes?
Addresses 8 bit locations
000
001
010
89 BCD
011 1000 1001

100
101
110

Fig: RAM
Lec Md Shadman Aadeeb, Dept. of CSE
2/6/2023
5
Why do we need alphanumeric codes?
Addresses 8 bit locations
000
001
010 0000 1000
89 BCD
011 0000 1001

100
101
110

Fig: RAM
Lec Md Shadman Aadeeb, Dept. of CSE
2/6/2023
6
Why do we need alphanumeric codes?
Addresses 8 bit locations
000
001
010
Hi BCD
011
?
100
101
110

Fig: RAM
Lec Md Shadman Aadeeb, Dept. of CSE
2/6/2023
7
American Standard Code for Information Interchange

Introducing ASCII (American Standard Code for Information


Interchange)

• We have seen coding in last class (mapping binary number to


elements)
• The same principle will be applicable here

Lec Md Shadman Aadeeb, Dept. of CSE 8


2/6/2023
American Standard Code for Information Interchange

American Standard Code for Information Interchange

Lec Md Shadman Aadeeb, Dept. of CSE 9


2/6/2023
American Standard Code for Information Interchange

Printing characters (94):


26 uppercase letters
E.g. : A,C
26 lower case letters
E.g. : a,c
10 numbers
E.g. : 1,2
32 special characters
Lec Md Shadman Aadeeb, Dept. of CSE
E.g. : @,$ 10
2/6/2023
American Standard Code for Information Interchange
Addresses 8 bit locations
000
001
010 01001000
Hi BCD
011 0110 1001

100
101
110

Fig: RAM
Lec Md Shadman Aadeeb, Dept. of CSE
2/6/2023
11
American Standard Code for Information Interchange

• What about the rest of the items in the table?

These are called control


characters

Lec Md Shadman Aadeeb, Dept. of CSE 12


2/6/2023
American Standard Code for Information Interchange

There are three kinds of control characters:


1.Format effectors
HT- If the computer finds this character in the memory (in binary form)
It will provide a horizontal tab. Addresses 8 bit locations
000
001
0100 1000(H)
H i 010
0000 1001(HT)
011
0110 1001(i)
100
101
110
Lec Md Shadman Aadeeb, Dept. of CSE
2/6/2023 Fig: 2/6/2023
RAM 13
American Standard Code for Information Interchange

There are three kinds of control characters:


2.Information effectors
FS – file separator. Helps in separating multiple files
1000 0100
0000 1100
1010 1101
FS (0001 1100)
1000 0100
0000 1100
1010 1101

Lec Md Shadman Aadeeb, Dept. of CSE 14


2/6/2023
American Standard Code for Information Interchange

There are three kinds of control characters:


3.Communication Control Characters
STX – Start of text Note: The corresponding binary
numbers are being sent
ETX – End of text Wants to say “Hi!”

STX

Lec Md Shadman Aadeeb, Dept. of CSE 15


2/6/2023
American Standard Code for Information Interchange

There are three kinds of control characters:


3.Communication Control Characters
STX – Start of text Note: The corresponding binary
numbers are being sent
ETX – End of text Wants to say “Hi!”

Lec Md Shadman Aadeeb, Dept. of CSE 16


2/6/2023
American Standard Code for Information Interchange

There are three kinds of control characters:


3.Communication Control Characters
STX – Start of text Note: The corresponding binary
numbers are being sent
ETX – End of text Wants to say “Hi!”

Lec Md Shadman Aadeeb, Dept. of CSE 17


2/6/2023
American Standard Code for Information Interchange

There are three kinds of control characters:


3.Communication Control Characters
STX – Start of text Note: The corresponding binary
numbers are being sent
ETX – End of text Wants to say “Hi!”

Lec Md Shadman Aadeeb, Dept. of CSE 18


2/6/2023
American Standard Code for Information Interchange

There are three kinds of control characters:


3.Communication Control Characters
STX – Start of text Note: The corresponding binary
numbers are being sent
ETX – End of text Wants to say “Hi!”

ETX

Lec Md Shadman Aadeeb, Dept. of CSE 19


2/6/2023
Unicode

Problem 1
• ASCII is well suited for English language
• It can represent a total of 256 characters
• But what about this case?

• There are about 50,00 Chinese characters


• An ordinary Chinese person knows about 8000

Lec Md Shadman Aadeeb, Dept. of CSE 20


2/6/2023
American Standard Code for Information Interchange

Problem 2
• You can develop your own coding scheme (mapping) for your own
language

BSCII (in your computer) ASCII


ক= 0100 0001 A= 0100 0001

Lec Md Shadman Aadeeb, Dept. of CSE 21


2/6/2023
American Standard Code for Information Interchange

You type an amazing poem in But your friend’s computer uses


Bangla . Your computer encodes it ASCII.
in the RAM using BSCII. He will get something gibberish.
For example ক will be
You send it to your friend misrepresented as A.

Lec Md Shadman Aadeeb, Dept. of CSE 22


2/6/2023
Unicode

We need a coding scheme that can cover all the language


characters.

Also emojis.

Solution? :
Unicode

Lec Md Shadman Aadeeb, Dept. of CSE 23


2/6/2023
Unicode

Grapheme
• A single unit of human writing system.
• “J” , “ক”, “ 大”
Codepoint
• Values assigned to the Graphemes (just like they did for ASCII)
“J” = 74 “ক”= 2453 “ 大” = 12233

Lec Md Shadman Aadeeb, Dept. of CSE 24


2/6/2023
Unicode

• So there are variable number of digits.


• We know that the computer stores data in compartments of 8 bits.
• How will it understand where it starts and where it ends?

• “J” = 74 (100 1010)


• “ক”= 2453 (1001 1001 1001)
• “ 大” = 12233 (101111 11001001)

Lec Md Shadman Aadeeb, Dept. of CSE 25


2/6/2023
Unicode

UTF – 8
“J” = 74 (100 1010)
“ক”= 2453 (1001 1001 1001)
“ 大” = 12233 (101111 11001001)

No. of bits Representation


7 0xxx xxxx (J=0100 1010)
11 110x xxxx 10xx xxxx (ক= ‘cant be rep’)
16 1110 xxxx 10xx xxxx 10xx xxxx ক= 1110 0000 10 100110 10
011001
21 11110xxx 10xx xxxx 10xx xxxx 10xx xxxx

Lec Md Shadman Aadeeb, Dept. of CSE 26


2/6/2023
Unicode

UTF 32
• “J” = 74 (100 1010)
• “ক”= 2453 (1001 1001 1001)
• “ 大” = 12233 (101111 11001001)
UTF 32 does not use variable number of bits.
Each character(grapheme) is converted into codepoints as usual (see
above)
Then 4 bytes are assigned for each character:
J= 00000000 00000000 00000000 01001010
Lec Md Shadman Aadeeb, Dept. of CSE 27
2/6/2023
Unicode

• UTF 8 – 1 to 4 bytes (see the given table)


• UTF 32 – 4 bytes (see the example in previous slide)
• UTF 16 – 2 bytes or 4 bytes (similar to utf 8, but no 1 byte or 3 byte
representation)

Lec Md Shadman Aadeeb, Dept. of CSE 28


2/6/2023
Thank You

2/6/2023 Lec Md Shadman Aadeeb, Dept. of CSE 29

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy