power point presentation regarding the number system conversions, representation of negative numbers and various codes of representations and error detection and correction codes.
1. The negative number has two representations:
a. complement representation
b. sign magnitude representation
Complement representation:
There are two ways of representing complement
numbers:
a. 1’s Complement
b. 2’s Complement
2. 1’s complement of a binary number is obtained simply
by replacing each 1 by 0 and each 0 by 1. Alternately,
1’s complement of a binary can be obtained by
subtracting each bit from 1.
Example: Find 1’s complement of (i) 011001 (ii)
00100111
Solution. (i) Replace each 1 by 0 and each 0 by 1
0 1 1 0 0 1
↓ ↓ ↓ ↓ ↓ ↓
1 0 0 1 1 0
So, 1’s complement of 011001 is 100110.
3. (ii) Subtract each binary bit from 1.
1 1 1 1 1 1 1 1
–0 0 1 0 0 1 1 1
1 1 0 1 1 0 0 0 ← 1’s complement
one can see that both the method gives same
result.
2’s Complement
2’s complement of a binary number can be obtained
by adding 1 to its 1’s complement.
Example 1. Find 2’s complement of (i) 011001 (ii)
0101100
6. Before using any complement method for subtraction
equate the length of both minuendand subtrahend by
introducing leading zeros.
1’s complement subtraction following are the rules for
subtraction using 1’s complement.
1. Take 1’s complement of subtrahend.
2. Add 1’s complement of subtrahend to minuend.
3. If a carry is produced by addition then add this carry to the
LSB of result. This is called as end around carry (EAC).
4. If carry is generated from MSB in step 2 then result is
positive. If no carry generated result is negative, and is in
1’s complement form.
7. Example. Perform following subtraction using
1’s complement.
(i) 7 – 3 (ii) 3 – 7
Solution. (i) 7 – 3:
binary of 7 = (0111)2
binary of 3 = (0011)2
both numbers have equal length.
Step 1. 1’s complement of (0011)2 = (1100)2
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18. In a broad sense we can classify the codes into
five groups:
(i) Weighted Binary codes
(ii) Non-weighted codes
(iii) Error–detecting codes
(iv) Error–correcting codes
(v) Alphanumeric codes.
19. In weighted binary codes, each position of a number
represents a specific weight. The bits are multiplied by the
weights indicated; and the sum of these weighted bits gives
the equivalent decimal digit.
(a) Straight Binary coding is a method of representing a
decimal number by its binary equivalent.
20. In BCD codes, individual decimal digits are coded in
binary notation and are operated upon singly. Thus
binary codes representing 0 to 9 decimal digits are
allowed. Therefore, all BCD codes have at least
four bits (∵ min. no. of bits required to encode to
decimal digits = 4)
For example, decimal 364 in BCD
3 → 0011
6 → 0110
4 → 0100
364 → 0011 0110 0100
21. There are many binary coded decimal codes
(BCD) all of which are used to represent decimal
digits. Therefore, all BCD codes have atleast 4
bits and at least 6 unassigned or unused code
words.
Some example of BCD codes are:
(a) 8421 BCD code, sometimes referred to as the
Natural Binary Coded Decimal Code (NBCD);
(b)* Excess-3 code (XS3);
(c)** 84 –2 –1 code (+8, +4, –2, –1);
(d) 2 4 2 1 code
22.
23. Example: Lowest [643]10 into XS3 code
Decimal 6 4 3
Add 3 to each 3 3 3
Sum 9 7 6
Converting the sum into BCD code we have
9 7 6
↓ ↓ ↓
1001 0111 0110
Hence, XS3 for [643]10 = 1001 0111 0110
24. The excess 3, 8 4–2–1 and 2421 BCD codes are also known
as self complementing codes.
Self complementing property– 9’s complement of the
decimal number is easily obtained by changing 1’0 to 0’s
and 0’s to 1’s in corresponding codeword or the 9’s
complement of self complementing code word is the same
as its logical complement.
Example. The decimal digit 3 in 8.4–2–1 code is coded as
0101. The 9’s complement of 3 is 6. The decimal digit 6 is
coded as 1010 that is 1’s complement of the code for 3. This
is termed as self complementing property.
25. These codes are not positionally weighted.
This means that each position within a binary
number is not assigned a fixed value.
Excess-3 codes
Gray codes
are examples of nonweighted codes.
26. Gray code (Unit Distance code or Reflective code)
There are applications in which it is desirable to represent
numerical as well as other information with a code that
changes in only one bit position from one code word to the
nextadjacent word.
This class of code is called a unit distance code (UDC).
These are sometimes also called as ‘cyclic’, ‘reflective’ or
‘gray’ code.
These codes finds great applications in Boolean function
minimization using Karnaugh map.
27.
28. Binary information is transmitted from one device to
another by electric wires or other communication medium.
A system that can not guarantee that the data received by
one device are identical to the data transmitted by another
device is essentially useless.
Yet anytime data are transmitted from source to destination,
they can become corrupted in passage. Many factors,
including external noise, may change some of the bits from
0 to 1 or viceversa.
Reliable systems must have a mechanism for detecting and
correcting such errors.
29. In a single bit error, a 0 is changed to a 1 or a 1 is
changed to a 0.
In a burst error, multiple (two or more) bits are
changed.
The purpose of error detection code is to detect such bit
reversal errors.
Error detection uses the concept of redundancy which
means adding extra bits for detecting errors at the
destination.
30. Four types of redundancy checks are used:
Parity check or vertial redundancy check(VRC)
longitudinal redundancy check (LRC)
cyclic redundancy check (CRC) and
checksum
31. For a single bit error detection, the most common way
to achieve error detection is by means of a parity bit
A parity bit is an extra bit (redundant bit) included with
a message to make the total number of 1’s transmitted
either odd or even.
32. In LRC, a block of bits is organised in rows and columns
(table). For example, a block of 16 bits can be organised in
two rows and eight columns as shown in Fig.
We then calcualte the parity bit (even parity/odd parity, here
we are using even parity) for each column and create a new
row of 8 bits, which are the parity bits for the whole block.
33. CRC is most powerful of the redundancy checking
techniques.Cyclic redundancy check is based on
binary division.
A sequence of redundant bits called CRC or CRC
remainder is appended to the end of a data unit.
After adding CRC remainder, the resulting data
unit becomes exactly divisible by another
predetermined binary number.
At the destination this data unit is divided by the
same binary number. If there is no remainder,
then there is no error.
34. The CRC generator and CRC checker are
shown in Fig.(a) and Fig.(b) respectively.
Fig.(a) Fig.(b)
35.
36. The mechanism that we have covered upto this
point detect errors but do not correct them. Error
correction can be handled in two ways.
In one, when an error is encountered the receiver
can request the sender to retransmit entire data
unit.
In the other, a receiver can use an error correcting
code, which automatically corrects certain errors.