Week05 Lecture
Week05 Lecture
0100100001100101011011000110110001101111
H e l l o
! “ } + & ∪ ∩ α β ….
Ë ä Ő ∀ ∞ …
-5- -6-
• ASCII code does not support languages with more than Binary Files:
256 characters
• The term binary is used to refer to all representations
• Unicode uses 2 bytes (16 bits) – with maximum 65536 aside for ASCII and Unicode, such as graphics,
(216) possible characters programs in executable form, audio files (mp3), video
files (mpeg), etc. Special softwares are used to view,
Supports other languages with larger alphabets – Greek, edit, run or open these files.
Hebrew, Japanese, Chinese, etc.
• Programs: A program consists of a sequence of
E.g. “f” in ASCII and Unicode Æ instructions (commands). An instruction is represented
as a binary code (pattern).
01100110 0000000001100110
(ASCII) (Unicode) e.g.: 0110011001000011 Æ move R3, M(100)
1100000000010011 Æ add R3, 1
0101010000000000 Æ jump M(1024)
-7- -8-
• Images: Thus each pixel is stored as a 3-byte (24-bit) number.
A variety of formats are used. The simplest bitmap A picture partitioned into 1024 by 1024 grid consists
format partitions an image into a grid of tiny dots, of 1024 × 1024 × 3 bytes = 3,145,728 bytes of data.
called pixels (picture elements). The image is then The resolution of the image refers to the number of
stored in a file as an array of colors of the pixels (Fig). pixels used to make up the image. The resolution of
the above image is:
Each color of a pixel is represented by three numbers
corresponding to the RGB (red, green, blue) 1024 × 1024 = 1,048,576 pixels ≅ 1 (megapixels).
components of the color. Each number uses one byte to
represent the intensity of that component (0 ~ 255). The higher the resolution (i.e. the number of pixels),
the sharper and clearer the image, but the larger the
E.g.: red – (255, 0, 0), size of the image file. Therefore there is a tradeoff
black – (0, 0, 0), between the high-resolution and low-resolution
organge – (255, 165, 0) images.
-9- - 10 -
Binary Numbers:
- 11 - - 12 -
Decimal vs unsigned binary: • Unsigned binary to decimal conversion:
1 8 23 bits Range:
-2.2250738585072014 × 10-308 ~
Sign bit (1) Exponent (8) Fractional part (23) 1.7976931348623158 × 10308
- 17 - - 18 -