Download presentation
Presentation is loading. Please wait.
1
Some required material From ICT T529 CD
Three topics to be discussed in these slides: Numbering System Error Control Compression
2
Numbering System عدد الأرقام المستخدمة 2 0 ، 1 فقط
عدد الأرقام المستخدمة 2 النظام الثنائي Binary system Base-2 0 ، 1 فقط عدد الأرقام المستخدمة 4 النظام الرباعي Base-4 0 ، 1 ، 2 ، 3 فقط عدد الأرقام المستخدمة 3 النظام الثلاثيBase-3 0 ، 1 ، 2 فقط 44 43 42 41 40 256 64 16 4 1 34 33 32 31 30 81 27 9 3 1 24 23 22 21 20 16 8 4 2 1 أوزان الخانات عدد الأرقام المستخدمة 6 النظام السداسي Base-6 0 ، 1 ، 2 ، 3 ، 4 ، 5 فقط عدد الأرقام المستخدمة 5 النظام الخماسي Bas-5 0 ، 1 ، 2 ، 3 ، 4 فقط 64 63 62 61 60 1296 216 36 6 1 54 53 52 51 50 625 125 25 5 1 أوزان الخانات
3
Numbering System عدد الأرقام المستخدمة 10
النظام العشري Base-10 Decimal system (Denary System) أنظمة الأعداد بعد العشرة نحتاج لرموز (خانة واحدة) لما بعد التسعة . (يمكن استخدام الحروف بدءاً من A) عدد الأرقام المستخدمة مثال: النظام ذو 12 رقما Base-12 0 ، 1 ، 2 ، 3 ، 4 ، 5 ، 6 ، 7 ، 8 ، 9 عدد الأرقام المستخدمة 104 103 102 101 100 10000 1000 10 1 0 ، 1 ، 2 ، 3 ، 4 ، 5 ، 6 ، 7 ، 8 ، 9 ، A ، B 123 122 121 120 1728 144 12 1 النظام ذو ال16 رقم الستعشري Base-16 عدد الأرقام المستخدمة 0 ، 1 ، 2 ، 3 ، 4 ، 5 ، 6 ، 7 ، 8 ، 9 ، A ، B ، C ، D ، E ، F 163 162 161 160 4096 256 16 1
4
Converting التحويل لتحويل أي عدد من أي نظام إلى النظام العشري:
لتحويل أي عدد من أي نظام إلى النظام العشري: يتم ضرب كل رقم في وزن خانته جمع نتائج الخطوة الأولى للتحويل من العشري للثنائي طريقتان: القسمة أو الطرح أمثلة: (على السبورة)
5
Converting التحويل لتحويل من النظام الستعشري إلى النظام الثنائي:
Binary Hex Denary 1 2 3 4 5 6 7 8 9 A 10 B 11 C 12 D 13 E 14 F 15 لتحويل من النظام الستعشري إلى النظام الثنائي: يستخدم الجدول المجاور يمكن تذكر القيم بتذكر الأوزان الأربعة الأولى:
6
Converting التحويل لتحويل من النظام الستعشري إلى العشري:
لتحويل من النظام الستعشري إلى العشري: يمكن التحويل مباشرة بضرب الأرقام في الأوزان كما ذكر سابقا أو يمكن التحويل لثنائي ثم لعشري B H D 1 2 3 4 5 6 7 8 9 A 10 11 C 12 13 E 14 F 15 الطريقة الثانية قد تبدو أطول لكنه في الواقع قد تكون أسهل وأقصر!! مثال: حول EDA من الستعشري الى العشري بالطريقتين الاجابة 3802
7
How many numbers can be represented in x number of bits
Range Total numbers Number of bits 0-1 2 21 1 0-3 4 22 0-7 8 23 3 0-15 16 24 0-31 32 25 5 0-63 64 26 6 0-127 128 27 7 0-255 256 28 0-511 512 29 9 0-1023 1024 210 10
8
Activity 1.4 and Activity 2.1 (self-assessment / revision)
A bit is a binary digit. That is, it is either 1 or 0 A binary code is simply a group of ‘bits’, that is, of 1s and/or 0s A byte is a binary code with 8 bits long, (there are 8 bits in a byte) (e.g., ) an octet is another name for a byte. (The term ‘byte’ is more often used in computing contexts, the term ‘octet’ in communications contexts) Briefly state how each of the following can be represented as binary codes: (i) numbers Numbers are often represented as binary codes simply by converting the number to its binary equivalent. Thus 2 is 10 in binary code; 15 is 1111; 125 is ; and so on. Sometimes the binary code must be of a fixed length – say 8 bits. In this case zeros are inserted at the front to make up the 8 bits. So is ; is is
9
(ii) text Text is usually represented by a sequence of ASCII stands for American Standard Code for Information Interchange In its standard form of 7 bits it allows for 127 different characters, which is enough for the Latin alphabet, punctuation marks and numerals It has various extended forms (8 bits, 255 characters) to allow for accented characters, etc Each code representing either an individual letter or a character such as a space, an apostrophe or a digit
10
(iii) a full-colour picture
A full-colour picture can be represented by dividing the picture up into tiny squares called pixels or pels and then assigning to each pixel a binary code that describes its colour and brightness (iv) a line drawing A simple line drawing may be represented in the same way as a full-colour picture But a simpler way is to describe where the lines on the drawing are in some pre-defined way and convert this description to a binary code Some further information is needed, for instance line thickness and colour, and again this can be provided by use of binary codes
11
(v) sounds, both spoken words and music
Sounds, whether speech or music, can be represented by first taking short, equal duration samples of the sound and then using a code to represent the characteristics of each of these samples. (vi) computer instructions in a program Computer instructions in a program are represented by binary codes that have been laid down by the manufacturer of a particular processor at the time the processor was designed
12
Error Control This is done by transmitting more bits with every few data bits Using the extra bits for checking for errors. If error is detected we have two options: They are corrected by the receiver; or a retransmission is requested Examples: Two-out-of-five code Reptilian Code Parity Check Code Hamming (7,4) Code
13
Error Control Error Control can be classified into: Error detection:
It is a process whereby pieces of binary data are checked in order to discover whether an error has occurred, If an error is detected, a special action usually follows: for example a request for retransmission of the binary data, or the display of an error message Error correction: If an error is detected, the receiver will correct it. Error detection and correction used both for computer systems (e.g. data storage) and digital communication systems (transmission and reception of digital data)
14
Error Control: 2 out o 5 code
NOT required for the EXAM (Not in your official material) Digit Telecommunication 01236 POSTNET 74210 1 11000 00011 2 10100 00101 3 10010 00110 4 01010 01001 5 00110 01010 6 10001 01100 7 01001 10001 8 00101 10010 9 00011 10100 01100 11000
15
Parity Check Code What is meant by a ‘parity bit’? Example:
A parity bit is an additional bit put at either the beginning or the end of a binary code. In an even-parity system the parity bit is chosen so that it will make the total number of 1s in the binary code (including the parity bit) even In an odd-parity system, the parity bit is chosen to make the total number of 1s odd Example: In an even-parity system, which of the following bytes must contain an error? (i) (contains an error because it has an odd number of 1s) (ii) and (iii) (not contain an error) Does a parity check provide error detection or error correction? Error detection, because it is not possible to determine which bit is in error So More sophisticated methods are needed for error correction
16
7,4 Hamming code (general look)
The data is split to blocks of 4 bits each 3 parity bits (even or odd) need to be calculated Each one of the parity bits is a parity for 3 out of the 4 data bits How to choose 3 bits out of 4? (to calculate parity for them) We Have 6 different possibilities. But we need 3. 3 2 1
17
7,4 Hamming (transmitter job)
The data is split to blocks of 4 bits each 4 bits of data generating 1’st parity bit generating 2’ed parity bit generating 3’ed parity bit
18
7,4 Hamming (Receiver job)
No Error Error in 5 Error In 6 Error in 3 In 7 Error in 2 Error in 1 Error in 4 1 2 3 4 5 6 7
19
Hamming code (Re-explained using your book notation)
It is a simple technique that can be used for error correction The Hamming code uses redundant bits in such a way that when an error occurs the redundant bits indicate where it has occurred The bit stream is divided to blocks of 4-bits (A,B,C,D) Let us call them (A,B,C,D) The trick is to add three redundant bits, (let us call them) X, Y and Z, to each 4-bit pattern ABCD in such a way that if an error occurs in any one of the resulting seven bits the receiver can calculate where the error must have been. The receiver can therefore correct the error without any more help from the transmitter
20
The Job of the sender: Suppose that the message to be sent is (0010 in binary). Then A is 0, B is 0, C is 1 and D is 0 The four bits ABCD are taken in groups of three, BCD, ACD and ABD and an even parity check bit is calculated for each group Let X represent the parity check bit for BCD, Y the parity check bit for ACD and Z the parity check bit for ABD. The group BCD is 010 so the even parity bit X will be 1, Group ACD is 010, so Y will be 1 Group ABD is 000, so Z will be 0 So Bits X, Y and Z are now attached to the original code ABCD to form a seven-bit code word ABCDXYZ. In the example, the word is and this is the code word transmitted
21
The Job of the receiver When seven-bit code arrives, is to carry out even-parity checks on the groups BCDX, ACDY and ABDZ. The receiver checks whether each of the groups BCDX, ACDY and ABDZ has an even number of 1s. If none of the groups fail this parity check, then no error has occurred in transmission and the redundant bits can be ignored If all three parity checks fail, the source of the error must be bit D, since only bit D appears in all three parity-check groups The table in next slide below show the eight possible situations of the even-parity checks on BCDX, ACDY and ABDZ.
22
7,4 Hamming Decoding BCDX ACDY ABDZ Receiver Decision NO ERROR
ERROR in Z ERROR in Y ERROR in A ERROR in X ERROR in B ERROR in C ERROR in D
23
7,4 Hamming Code (example2)
What numbers were being transmitted (using EVEN parity) when the following two 7-bit patterns were received? (a) BCDX (i.e is even (no error) ACDY (i.e. 1010) is even (no error) ABDZ (i.e. 1010) is even (no error) So there are no errors and transmitted data was 1001 (b) BCDX (i.e. 0011) is even (no error) ACDY (i.e. 1011) is odd (error) ABDZ (i.e. 1011) is odd (error) So there is an error in bit A, the correct signal is therefore , and the number transmitted is 1101
24
7,4 Hamming Code (example2)
This Example is same as example1 BUT using ODD parity instead of EVEN Example What numbers were being transmitted (correct in ODD parity) when the following two 7-bit patterns were received? (a) BCDX (i.e. 0011) is even (error) ACDY (i.e. 1010) is even (error) ABDZ (i.e. 1010) is even (error) So there is an error in bit D, the correct signal is therefore , and the number transmitted is 1000 (b) ACDY (i.e. 1011) is odd (no error) ABDZ (i.e. 1011) is odd (no error) So there is an error in bit X, the correct signal is therefore , and the number transmitted is 1001
25
Compression (Activity 2.2)
Compression is a process that is often used when files are transferred across the Internet (and sometimes when they are stored, as well). What is compression and, in outline, what happens during the compression process? Compression is a process of reproducing binary data into a more compact form. During the compression process portions of redundant data are detected and removed (data reduction) Compression is widely used in multimedia, digital broadcasting, some forms of digital recording, and in virtually all commercial software delivery and storage. It is important in the Internet is to send large files (multimedia applications).
26
Compression (Activity 2.2)
There are two main reasons for using compression: 1- a compressed file takes up less storage space than the uncompressed version. Hence more data can be stored on a given disk or in a particular memory 2- a compressed file can be transferred more quickly. This may be important, for example, when loading files from the Internet, or when digital sound or video has to be transferred in ‘real time’ There are two main disadvantages of using compression: 1- Compression and decompression require additional hardware or software – at the very least, an additional coder and a decoder. 2- Compression and decompression also take time to perform, because of the necessary processing operations
27
Compression (Activity 2.2)
Compression and subsequent decompression require a coder and decoder
28
Compression (Activity 2.2)
(b) What is meant by (i) lossless compression Is a process which compresses the original binary data in such a way that it can be reconstructed exactly later on. (ii) lossy compression Is a process which compresses the original binary data in such a way that it cannot be reconstructed exactly later on. This means that some of the original data is lost, but this may well not matter in the particular application where lossy compression is being used What are their relative advantages and drawbacks? The relative advantage of lossy compression is that usually (though not always) it is possible to achieve greater compression of the data The advantage of lossless compression over lossy is that it is possible to reconstruct the original data exactly
29
Compression (Activity 2.2)
(c) Name some examples each of (i) a lossless compression method 1- Run-length encoding 2- Variable-length lossless codes 3- The LZ algorithm (as used in ZIP compression) 4- GIF (graphical interchange format) coding (ii) a lossy compression method 1- Block-based compression 2- JPEG (Joint Pictures Experts Group) For still images 3- MPEG (Motion Pictures Experts Group) coding For video 4- MP3 coding (For sound) 5- Compression of studio-quality TV for transmission
30
Compression Run-length Example
By using Run-length coding as a compression algorithms for a stream of 300 bits, the first 120 are 0s and the 100 that follows are 1s and the third 60 are again 0s, and the remaining are 1s. What is the compressed version of the message? What is the compression ratio in this transmission? Answer: In binary ( )0( )1( )0( )1 In decimal 120(0) 100(1) 60(0)20(1) The compression ratio is the number of bits in the original message divided by the number in the compressed message which is 300/36= 8.33
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.