Character sets – ASCII code and Unicode
The ASCII code system (American Standard Code for Information Interchange)
was set up in 1963 for use in communication systems and computer systems.
A newer version of the code was published in 1986. The standard ASCII
code character set consists of 7-bit codes (0 to 127 in denary or 00 to 7F in hexadecimal) that represent the letters, numbers and characters found on a
standard keyboard
Extended ASCII uses 8-bit codes (0 to 255 in denary or 0 to FF in hexadecimal). This gives another 128 codes to allow for characters in non-English alphabets and for some graphical characters to be included:
ASCII code has a number of disadvantages. The main disadvantage is that it does not represent characters in non-Western languages, for example Chinese characters.
For this reason, different methods of coding have been developed over the years. One coding system is called Unicode.
Unicode can represent all languages of the world, thus supporting many operating systems, search engines and internet browsers used globally. There is overlap with standard ASCII code, since the first 128 (English) characters are the same, but Unicode can support several thousand different characters in total.
ASCII uses one byte to represent a character, whereas Unicode will support up to four bytes per character.
Representation of sound:
Soundwaves are vibrations in the air. The human ear senses these vibrations and
interprets them as sound.
Sound waves vary continuously. This means that sound is analogue. Computers cannot work with analogue data, so sound waves need to be sampled in order to be stored in a computer. Sampling means measuring the amplitude of the sound wave. This is done using an analogue to digital converter (ADC). To convert the analogue data to digital, the sound waves are sampled at regular time intervals. The amplitude of the sound cannot be measured precisely, so approximate values are stored.
Figure 1.9 shows a sound wave. The x-axis shows the time intervals when the sound was sampled (1 to 21), and the y-axis shows the amplitude of the sampled sound to 10. At time interval 1, the approximate amplitude is 10; at time interval 2, the approximate amplitude is 4, and so on for all 20 time intervals. Because the amplitude range in Figure 1.9 is 0 to 10, then 4 binary bits can be used to represent each amplitude value (for example, 9 would be represented by the binary value 1001). Increasing the number of possible values used to represent sound amplitude also increases the accuracy of the sampled sound (for example, using a range of 0 to 127 gives a much more accurate representation of the sound sample than using a range of, for example, 0 to 10). The number of bits per sample is known as the sampling resolution (also known as the bit depth). So, in our example, the sampling resolution is 4 bits.
Sampling rate is the number of sound samples taken per second. This is measured in hertz (Hz), where 1 Hz means ‘one sample per second’. So how is sampling used to record a sound clip?
» the amplitude of the sound wave is first determined at set time intervals (the
sampling rate)
» this gives an approximate representation of the sound wave
» each sample of the sound wave is then encoded as a series of binary digits.
Using a higher sampling rate or larger resolution will result in a more faithful representation of the original sound source. However, the higher the sampling rate and/or sampling resolution, the greater the file size.
CDs have a 16-bit sampling resolution and a 44.1 kHz sample rate – that is 44 100 samples every second. This gives high-quality sound reproduction.
Representation of (bitmap) images Bitmap images are made up of pixels (picture elements); an image is made up of a two-dimensional matrix of pixels.
Each pixel can be represented as a binary number, and so a bitmap image isstored in a computer as a series of binary numbers, so that:
» a black and white image only requires 1 bit per pixel – this means that each pixel can be one of two colours, corresponding to either 1 or 0.
» if each pixel is represented by 2 bits, then each pixel can be one of four colours (22 = 4), corresponding to 00, 01, 10, or 11
» if each pixel is represented by 3 bits then each pixel can be one of eight colours (23 = 8), corresponding to 000, 001, 010, 011, 100, 101, 110, 111. The number of bits used to represent each colour is called the colour depth. An 8 bit colour depth means that each pixel can be one of 256 colours (because 28 = 256). Modern computers have a 24 bit colour depth, which means over 16 million different colours can be represented With x pixels, 2x colours can be represented as a generalisation. Increasing colour depth also increases the size of the file when storing an image. Image resolution refers to the number of pixels that make up an image; for example, an image could contain 4096 × 3072 pixels (12 582 912 pixels in total). The resolution can be varied on many cameras before taking, for example, a digital photograph. Photographs with a lower resolution have less detail than those with a higher resolution. For example, look at Figure 1.11:
Image ‘A’ has the highest resolution and ‘E’ has the lowest resolution. ‘E’ has become pixelated (‘fuzzy’). This is because there are fewer pixels in ‘E’ to represent the image. The main drawback of using high resolution images is the increase in file size.
As the number of pixels used to represent the image is increased, the size of the file will also increase. This impacts on how many images can be stored on, for example, a hard drive. It also impacts on the time to download an image from the internet or the time to transfer images from device to device. A certain amount of reduction in resolution of an image is possible before the loss of quality becomes noticeable.