Detailed Notes on Character Sets, Sound, and Images

Character Sets

  • A character set is all the characters and symbols that can be represented by a computer system.

  • Each character is given a unique binary code.

  • Character sets are ordered logically.

  • The code for 'B' is one more than the code for 'A'.

  • A character set provides a standard for computers to communicate and send/receive information.

  • Without a character set, one system might interpret 01000001 differently from another.

  • The number of characters that can be represented is determined by the number of bits used by the character set.

  • Two common character sets are:

    • American Standard Code for Information Interchange (ASCII)

    • Universal Character Encoding (UNICODE)

ASCII

  • ASCII is a character set and was an accepted standard for information interchange.

  • ASCII uses 7 bits, providing 272^7 unique codes (128) or a maximum of 128 characters it can represent.

ASCII Code Examples:

/

  • Letter 'a': ASCII Code 097, Binary 01100001

  • Letter 'A': ASCII Code 065, Binary 01000001

  • Letter 'b': ASCII Code 098, Binary 01100010

  • Letter 'B': ASCII Code 066, Binary 01000010

  • Letter 'c': ASCII Code 099, Binary 01100011

  • Letter 'C': ASCII Code 067, Binary 01000011

ASCII vs UNICODE

Feature

ASCII

UNICODE

Number of bits

7-bits

16-bits

Extended ASCII

  • Extended ASCII uses 8 bits, providing 28=2562^8 = 256 unique codes, representing a maximum of 256 characters.

  • Extended ASCII provides essential characters such as mathematical operators and more recent symbols such as ©.

Limitations of ASCII & Extended ASCII

  • ASCII has a limited number of characters which means it can only represent the English alphabet, numbers, and some special characters (A, B, C, … Z, a, b, c, …, z, 0, 1, 2, …, 9, !, @, #, …).

  • ASCII cannot represent characters from languages other than English.

  • ASCII does not include modern symbols or emojis common in today's digital communication.

UNICODE

  • UNICODE is a character set and was created as a solution to the limitations of ASCII.

  • UNICODE uses a minimum of 16 bits, providing 216=65,5362^{16} = 65,536 unique codes, representing a minimum of 65,536 characters.

  • UNICODE can represent characters from all the major languages around the world.

ASCII vs UNICODE Comparison

Feature

ASCII

UNICODE

Number of characters

128 characters

65,536 characters

Uses

English language characters

Characters across the world

Benefits

Less storage space

Represents more characters, supports all common characters, can represent special characters such as emojis

Drawbacks

Limited to 128 characters, cannot store special characters

More storage space

Representing Sound

How Sound is Sampled & Stored
  • Measurements of the original sound wave are captured and stored as binary on secondary storage.

  • Sound waves begin as analogue, and for a computer system to understand them, they must be converted into a digital form.

  • This process is called Analogue to Digital conversion (A2D).

  • The process begins by measuring the amplitude of the analogue sound wave at a point in time, called samples.

  • Each measurement (sample) generates a value that can be represented in binary and stored.

  • Using the samples, a computer is able to create a digital version of the original analogue wave.

  • The digital wave is stored on secondary storage and can be played back at any time by reversing the process.

  • To make the digital wave look more like the analogue wave, the sample rate and bit depth can be changed.

Sample Rate & Sample Resolution
  • Sample rate is the amount of samples taken per second of the analogue wave.

  • Samples are taken each second for the duration of the sound.

  • The sample rate is measured in Hertz (Hz).

  • 1 Hertz is equal to 1 sample of the sound wave.

  • The higher the sample rate, the closer to the original sound wave the digital version looks.

  • The sampling rate of a typical audio CD is 44.1kHz (44,100 Hertz or 44,100 samples per second).

  • Sample resolution is the number of bits stored per sample of sound.

  • Sample resolution is closely related to the color depth of a bitmap image; they measure the same thing in different contexts.

Impact of Sample Rate and Sample Resolution

Sample rate

Sample resolution

Playback quality

File size

High

Low

Representing Images

Bitmap Images
  • A bitmap image is made up of squares called pixels.

  • A pixel is the smallest element of a bitmap image.

  • Each pixel is stored as a binary code.

  • Binary codes are unique to the color in each pixel.

  • A typical example of a bitmap image is a photograph.

  • The more colors and more detail in the image, the higher the quality of the image and the more binary that needs to be stored.

Resolution & Color Depth
  • Resolution is the total amount of pixels that make up a bitmap image.

  • The resolution is calculated by multiplying the height and width of the image (in pixels).

  • In general, the higher the resolution, the more detail in the image (higher quality).

  • Resolution can also refer to the total amount of pixels horizontally in a display, such as:

    • Computer monitors - 1440p means 1440 pixels horizontally compared to 4K which is 3840 pixels (roughly 4 thousand).

    • TVs - HD (high definition) channels have a resolution of 1080p, 1080 pixels horizontally compared to newer UHD (ultra high definition) channels with 3840 pixels (4K).

    • YouTube - The quality button allows a user to change the video playback resolution from 144p (144 pixels horizontally) up to 4K.

  • Color depth is the number of bits stored per pixel in a bitmap image.

  • The color depth is dependent on the number of colors needed in the image.

  • In general, the higher the color depth, the more detail in the image (higher quality).

Color Depth & Number of Colors
  • In a black & white image, the color depth would be 1, meaning 1 bit is enough to create a unique binary code for each color in the image (1=white, 0=black).

  • In an image with a color depth of 2, you would have 00, 01, 10 & 11 available binary codes, so 4 colors.

  • As color depth increases, so does the amount of colors available in an image.

  • The amount of colors can be calculated as 2n2^n (n = color depth).

Color Depth

Amount of Colors

1 bit

2 (B&W)

2 bit

4

4 bit

16

8 bit

256

24 bit

16,777,216 (True Color)

Impact of Resolution and Colour Depth
  • As the resolution and/or color depth increases, the bigger the size of the file becomes on secondary storage.

  • The higher the resolution, the more pixels are in the image, the more bits are stored.

  • The higher the color depth, the more bits per pixel are stored.

  • Striking a balance between quality and file size is always a consideration.