Representation of non-numeric data in computer, Lecture notes of Computer Science

Representation of non-numeric data in computer

Typology: Lecture notes

2018/2019

Uploaded on 11/23/2019

manyawkal-adefris
manyawkal-adefris 🇪🇹

1 document

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Representation of non-numeric data in computer
A. Representation of alphanumeric data
There are 4 types of alphanumeric data: letters, digits, special
symbols and control characters.
The most common codes to represent alphanumeric data is
ASCII code
American Standard Code for Information Interchange (ASCII)
Each character uses 7 bits e.g.
‘A’ is represented by ‘1000001’ (65 in decimal)
‘a’ is represented by ‘1100001’ (90 in decimal)
‘1’ is represented by ‘0110001’ (49 in decimal)
‘?’ is represented by ‘0111111’ (63 in decimal)
Delete is represented by ‘1111111’ (127 in decimal)
B. Representation of Chinese characters
Chinese characters are non-alphanumeric characters
There are over ten thousand Chinese characters that are
commonly used
Since 16 bits can represent 216 (65536) patterns, 16 bits (2
bytes) are needed to represent a Chinese character.
Common code used to represent traditional Chinese characters
is BIG-5
Common codes used to represent simplied Chinese
characters is GB(Guobiao), used in Taiwan and HZ(Hanzi) used
in Mainland China.
C. Representation of non-alphanumeric characters
Unicode can represent characters of dierent languages and
is accepted globally. It includes Chinese (traditional and
simplied), English, French, Japanese, Korean and many others.
Exercise
1. Write down the ASCII codes (in decimal) of the following
message.
‘Hello! John’
2. Write down the message represented by the following ASCII
codes.
67 111 109 112 117 116 101 114 32 63
3. How many bits are used to represent a character in ASCII code?
4. How many bytes are used to represent a Chinese character in
BIG-5 code?
5. Write down the hexadecimal BIG-5 codes of the following Chinese
characters?
再叫古仔
6. Write down the binary BIG-5 codes of the following Chinese
characters?
再叫古仔
pf3
pf4

Partial preview of the text

Download Representation of non-numeric data in computer and more Lecture notes Computer Science in PDF only on Docsity!

Representation of non-numeric data in computer

A. Representation of alphanumeric data

  • There are 4 types of alphanumeric data: letters, digits, special symbols and control characters.
  • The most common codes to represent alphanumeric data is ASCII code
  • American Standard Code for Information Interchange (ASCII)
  • Each character uses 7 bits e.g.
  • ‘A’ is represented by ‘1000001’ (65 in decimal)
  • ‘a’ is represented by ‘1100001’ (90 in decimal)
  • ‘1’ is represented by ‘0110001’ (49 in decimal)
  • ‘?’ is represented by ‘0111111’ (63 in decimal)
  • Delete is represented by ‘1111111’ (127 in decimal)

B. Representation of Chinese characters

  • Chinese characters are non-alphanumeric characters
  • There are over ten thousand Chinese characters that are commonly used
  • Since 16 bits can represent 2 16 (65536) patterns, 16 bits ( bytes) are needed to represent a Chinese character.
  • Common code used to represent traditional Chinese characters is BIG-
  • Common codes used to represent simplified Chinese characters is GB (Guobiao), used in Taiwan and HZ (Hanzi) used in Mainland China.

C. Representation of non-alphanumeric characters

  • Unicode can represent characters of different languages and is accepted globally. It includes Chinese (traditional and simplified), English, French, Japanese, Korean and many others.

Exercise

  1. Write down the ASCII codes (in decimal) of the following message. ‘Hello! John’
  2. Write down the message represented by the following ASCII codes. 67 111 109 112 117 116 101 114 32 63
  3. How many bits are used to represent a character in ASCII code?
  4. How many bytes are used to represent a Chinese character in BIG-5 code?
  5. Write down the hexadecimal BIG-5 codes of the following Chinese characters? 再叫古仔
  6. Write down the binary BIG-5 codes of the following Chinese characters? 再叫古仔
  1. Convert the following BIG-5 codes to Chinese characters? A64E, A5FC, A5BF, A5A

A5E

A5F

0 1 2 3 4 5 6 7 8 9 a b c d e f

A

0

Representation of Graphics

Following are three pictures represented by 5 x 5 pixels bitmaps

Bitmap 00100 00100 11111 00100 00100

Bitmap Bitmap

(a) Complete the other 2 bitmaps

(b) Calculate the number of bits required in the bitmaps.

(c) Calculate the number of bits needed for (d) 640 x 480 bitmaps (e) 1024 x 768 bitmaps (f) 1280 x 1024 bitmaps