A3. Data Representation
Learning Outcomes:
- Distinguish between analog and digital data. State applications or situations where conversion of analog to digital data is required, or vice versa.
- Explain why IT uses digital data
- The relationship between the number of bits and number of patterns/combinations available should be mentioned (e.g. three bits can be used to represent eight colours).
- Convert integers from denary numbers to binary numbers or hexadecimal numbers, or vice versa.
- Adopt two’s complement for the representation of negative integers.
- Perform simple calculations (addition and subtraction only) on binary numbers and analyse overflow errors.
- In understanding errors, minimum and maximum numbers an n-bit can hold (maximum 2 bytes) should be considered.
- Know how characters are represented by using common international standards such as American Standard Code for Information Interchange (ASCII), the Big-5 code, the Guobiao (GB) code and the Unicode.
- The relationship between the size of the character set and the representation should be explained. Recall of specific codes is not required.
- Know briefly how different multimedia elements are digitised. Convert them into different file formats and compare them for storing the same data.
- Elementary file conversion is required but not the editing of a file. Students should be given the experience in creating various file formats such as wav vs. mp3, bmp vs. jpg, and avi vs. mpeg2.
Bits vs combinations
No. of bits |
Possible combinations |
Calculation of combinations |
1 bit |
0,1 |
21=2 |
2 bits |
00,01,10,11 |
22=4 |
… |
… |
… |
n bits |
|
2n |
Representation of negative integers
Use 2’s complement method in modern computer
Suppose we use 4 bits to represent number: first bit is the
sign (+/-) and remaining bits are the size
For 0 and positive numbers, the sign bit is 0
number |
In binary form |
|
number |
In binary form |
0 |
0000 |
|
4 |
0100 |
1 |
0001 |
|
5 |
0101 |
2 |
0010 |
|
6 |
0110 |
3 |
0011 |
|
7 |
0111 |
For negative numbers, we can derive the binary form from the
positive number using 2’s complement method
-1:
|
steps |
|
Positive number |
|
0001 |
1’s complement |
1à0,
0à1 |
1110 |
2’s complement |
+1 |
1111 |
number |
In binary form |
|
number |
In binary form |
-1 |
1111 |
|
-5 |
1011 |
-2 |
1110 |
|
-6 |
1010 |
-3 |
1101 |
|
-7 |
1001 |
-4 |
1100 |
|
-8 |
1000 |
So, the range of numbers represented by 4 bits is -23
to 23-1.
I.e. the range of numbers represented by n bits is -2n-1 to 2n-1-1
Overflow errors
- For 2 numbers with different signs, their sum will not overflow.
- If the 2 numbers have same signs, overflow may happen. i.e. when the result has different sign bit, overflow has occurred.
- e.g. 1111 + 1000 = (1)0111 = 0111 (overflow error)
Character representation
- ASCII (American Standard Code for Information Interchange), 7 bits for each character
- Big-5 code: Traditional Chinese, 2 bytes for each character
- GB (Guobiao) Code: Simplified Chinese, 2 bytes for each character
- Unicode: Characters of different languages (If you need to use traditional and simplified Chinese at the same time, use Unicode), 1 to 4 bytes for each character
Multimedia elements
- Images/graphics
File size depends on:
- Resolution: dots per inch
- Color depth: bits per pixel (determines the range of possible colours)
- File formats:
- BMP: Bitmap. Uncompressed format à large file size
- JPEG: Joint Photographic Experts Group. Lossy compression à small file size, commonly used in the internet and supported by most browsers
- GIF: Graphics Interchange Formats. Supports animation and transparency. 256 colours only à not good for photos
- PNG: Portable Network Graphics. Lossless compression à file size bigger than JPEG. Support more colour than GIF à better image quality than GIF
- Audio
File size depends on:
- Bit depth/sample resolution: number of bits used in each sample
- Sampling rate: number of samples per second (Hz)
- Duration
- File formats:
- Uncompressed format:
- WAV: WAVeform audio file. Useful for further editing.
- Compressed format:
- MP3: MPEG-1 Audio Layer 3.
- WMA: Windows Media Audio.
- Video
File size affected by:
- Resolution ~image size
- Color depth: number of bits per pixel
- Frame rate – frame rate per second fps
- Duration
- File formats:
- Uncompressed: better video quality
- AVI: Audio Video Interleave
- Compressed: smaller file size
- MP4: MPEG layer 4: support streaming, store other data such as subtitles, scene descriptions
- WMV: Windows Media Video
- Digitising multimedia elements
Reasons:
- Online access
- searching
- preservation of the originals
- allow further editing
- Compression of file/files
Reasons:
- Reduce file size – less storage space and faster transmission in network
- Sending multiple files as one single file, file structure maintained
- Encryption – security
Relevant past paper:
DSE ICT Paper 1B(SP-2017): PP 1c. 2012 3dii,4aii,5abii,iii.
2013 2a,3d. 2014 1b,4di. 2015 5di. 2016 1abc,5bi. 2017 1bc,2ai,b,4c.
References:
http://www.cwu.edu/~borisk/311/lecture/311-lec8.html
https://www.tutorialspoint.com/multimedia/multimedia_images_graphics.htm
https://support.biamp.com/General/Video/Video_Basics
https://www.apowersoft.com/what-is-mp4-format.html
http://www.micrographics.co.nz/why-digitise/
https://officeorbiter.com/what-is-file-compression/
Learn more:
Example of audio header - https://www.codeproject.com/Articles/8295/MPEG-Audio-Frame-Header
No comments:
Post a Comment