Search for notes by fellow students, in your own course and all over the country.

Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.

My Basket

Types of waves£1.50

Short Notes of Electrostatics£2.50

Total£4.00

Title: Digital Circuits - Codes
Description: Digital Circuits - Codes

Document Preview

Extracts from the notes are below, to see the PDF you'll receive please use the links above


Digital Circuits - Codes
A number or letter is considered to be encoded when a group of
symbols are utilized to represent it during coding
...
Digital data is represented,
stored, and transmitted using bit groups
...

There are two distinct categories of binary coding
...
It is
an unweighted code otherwise
...

Binary Codes for Decimal digits
The following table shows the various binary codes for decimal
digits 0 to 9
...
We need at
least 4 bits to represent these 10 digits in binary
...

We only have ten decimal digits, thus the other six zero-one
combinations are not necessary
...

• This code has all positive weights
...

• This
code
is
also
called
as natural
BCD BinaryCodedDecimalBinaryCodedDecimal code
...
This
number has 3 decimal digits 7, 8 and 6
...

∴ 78678610 = 011110000110011110000110BCD
There are 12 bits in BCD representation, since each BCD code of
decimal digit has 4 bits
...

• This code has all positive weights
...

• It is an unnatural BCD code
...

• It is a self-complementing code
...

Example
Let us find the 2421 equivalent of the decimal number 786
...
From the table, we can
write the 2421 codes of 7, 8 and 6 are 1101, 1110 and 1100
respectively
...

8 4 -2 -1 code
• The weights of this code are 8, 4, -2 and -1
...
So, it is a negatively weighted code
...




It is a self-complementing code
...

This number has 3 decimal digits 7, 8 and 6
...

Therefore, the 8 4 -2 -1 equivalent of the decimal number 786
is 100110001010
...
So, it is an unweighted code
...
Hence, it is called as Excess 3 code
...

Example
Let us find the Excess 3 equivalent of the decimal number 786
...
From the table, we
can write the Excess 3 codes of 7, 8 and 6 are 1010, 1011 and
1001 respectively
...


Decimal
Number

Binary Code

Gray Code

0

0000

0000

1

0001

0001

2

0010

0011

3

0011

0010

4

0100

0110

5

0101

0111

6

0110

0101

7

0111

0100

8

1000

1100

9

1001

1101

10

1010

1111

11

1011

1110

12

1100

1010

13

1101

1011

14

1110

1001

15

1111

1000

This code doesn’t have any weights
...

• In the above table, the successive Gray codes are
differed in one bit position only
...

Binary code to Gray Code Conversion


Follow these steps for converting a binary code into its
equivalent Gray code
...

Compare the successive two bits starting from zero
...
Otherwise,
output is one
...


Example
From the table, we know that the Gray code corresponding to
binary code 1000 is 1100
...

Given, binary code is 1000
...

Step 2 − By comparing successive two bits of new binary code,
we will get the gray code as 1100
...
Therefore, noise may be injected when binary
data is being sent from one system to another
...

Thus, a bit 0 may turn into a 1 or a bit 1 could turn into a 0
...
However, by first identifying any
problems and then fixing them, we can restore the original data
...

• Error detection codes
• Error correction codes
Error detection codes − are used to detect the errorss present in
the received data bitstreambitstream
...
These codes detect the error, if it is occurred
during
transmission
of
the
original
data bitstreambitstream
...

Error correction codes − are used to correct the errorss present
in the received data bitstreambitstream so that, we will get the

original data
...
Example − Hamming code
...

Parity Code
It is easy to include appendappend one parity bit either to the
left of MSB or to the right of LSB of original bit stream
...

Even Parity Code
The value of even parity bit should be zero, if even number of
ones present in the binary code
...
So
that, even number of ones present in even parity code
...

The following table shows the even parity codes corresponding
to each 3-bit binary code
...

Binary Code

Even Parity bit

Even Parity Code

000

0

0000

001

1

0011

010

1

0101

011

0

0110

100

1

1001

101

0

1010

110

0

1100

111

1

1111

Here, the number of bits present in the even parity codes is 4
...





If the other system receives one of these even parity
codes, then there is no error in the received data
...

If the other system receives other than even parity
codes, then there will be an errorss in the received
data
...


Therefore, even parity bit is useful only for detection of error in
the received parity code
...

Odd Parity Code
The value of odd parity bit should be zero, if odd number of ones
present in the binary code
...
So that,

odd number of ones present in odd parity code
...

The following table shows the odd parity codes corresponding
to each 3-bit binary code
...

Binary Code

Odd Parity bit

Odd Parity Code

000

1

0001

001

0

0010

010

0

0100

011

1

0111

100

0

1000

101

1

1011

110

1

1101

111

0

1110

Here, the number of bits present in the odd parity codes is 4
...






If the other system receives one of these odd parity
codes, then there is no error in the received data
...

If the other system receives other than odd parity
codes, then there is an errorss in the received data
...


Therefore, odd parity bit is useful only for detection of error in
the received parity code
...

Hamming Code
Hamming code is useful for both detection and correction of
error present in the received data
...

The minimum value of 'k' for which the following relation is
correct validvalid is nothing but the required number of parity
bits
...


Let
the Hamming
code is bn+kbn+k−1
...
b3b2b1 & parity
bits pk,pk−1,
...
p1
...
In remaining bit positions, we can
place the ‘n’ bits of binary code
...
But, the same parity
technique should be used in order to find whether any error
present in the received data
...









Find the value of p1, based on the number of ones
present in bit positions b3, b5, b7 and so on
...

Find the value of p2, based on the number of ones
present in bit positions b3, b6, b7 and so on
...

Find the value of p3, based on the number of ones
present in bit positions b5, b6, b7 and so on
...

Similarly, find other values of parity bits
...



Find the value of c1, based on the number of ones
present in bit positions b1, b3, b5, b7 and so on
...

Find the value of c2, based on the number of ones
present in bit positions b2, b3, b6, b7 and so on
...

Find the value of c3, based on the number of ones
present in bit positions b4, b5, b6, b7 and so on
...

Similarly, find other values of check bits
...
Just
complement the value present in that bit position
...

Example 1
Let us find the Hamming code for binary code, d4d3d2d1 = 1000
...

The number of bits in the given binary code is n=4
...

2k≥n+k+12k≥n+k+1
Substitute, n=4 in the above mathematical relation
...

Hence, we require 3 parity bits p1, p2, and p3
...
We have to place the parity bits
and bits of binary code in the Hamming code as shown below
...
Now, let us find the parity bits
...

Example 2
In the above example, we got the Hamming code
as b7b6b5b4b3b2b1=1001011b7b6b5b4b3b2b1=1001011
...

Now, let us find the check bits
...

c3c2c1=(011)2=(3)10c3c2c1=(011)2=(3)10
Therefore, the error present in third bit (b3) of Hamming code
...


Digital Circuits - Boolean Algebra
Boolean Algebra is an algebra, which deals with binary numbers
& binary variables
...
A mathematician, named George Boole had
developed this algebra in 1854
...

The range of voltages corresponding to Logic ‘High’ is
represented with ‘1’ and the range of voltages corresponding to
logic ‘Low’ is represented with ‘0’
...
These are useful in
minimizing Boolean functions
...
Either the Boolean variable or complement of
it is known as literal
...

x+0=x
x+1=1
x+x=x
x + x’ = 1
Similarly, the four possible logical AND operations among those
literals and binary numbers are shown below
...
1 = x
x
...
x = x
x
...
We can verify these
postulates easily, by substituting the Boolean variable with ‘0’ or
‘1’
...
i
...
, x′x′’=x
...





Commutative law
Associative law
Distributive law

Commutative Law
If any logical operation of two Boolean variables give the same
result irrespective of the order of those two variables, then that
logical operation is said to be Commutative
...
y = y
...
Similarly, the
symbol ‘
...
Commutative law obeys for logical OR & logical AND
operations
...
The logical OR & logical AND
operations of three Boolean variables x, y & z are shown below
...
y
...
z = x
...
y
...

Distributive Law
If any logical operation can be distributed to all the terms
present in the Boolean function, then that logical operation is
said to be Distributive
...

x
...
y + x
...
zy
...
x+zx+z
Distributive law obeys for logical OR and logical AND operations
...
We can verify these
laws easily, by substituting the Boolean variables with ‘0’ or ‘1’
...

Duality theorem
• DeMorgan’s theorem
Duality Theorem


This theorem states that the dual of the Boolean function is
obtained by interchanging the logical AND operator with logical
OR operator and zeros with ones
...

Let us make the Boolean equations relationsrelations that we
discussed in the section of Boolean postulates and basic laws
into two groups
...

Group1

Group2

x+0=x

x
...
0 = 0

x+x=x

x
...
x’ = 0

x+y=y+x

x
...
x

x + y+zy+z = x+yx+y + z

x
...
zy
...
yx
...
z

x
...
y + x
...
zy
...
x+zx+z

In each row, there are two Boolean equations and they are dual
to each other
...

DeMorgan’s Theorem
This theorem is useful in finding the complement of Boolean
function
...

DeMorgan’s theorem with 2 Boolean variables x and y can be
represented as
x+yx+y’ = x’
...
yx
...
Similarly, we can apply DeMorgan’s theorem for more
than 2 Boolean variables also
...
Now, let us simplify some Boolean functions
...

Method 1
Given Boolean function, f = p’qr + pq’r + pqr’ +pqr
...
So, take the common terms by
using Distributive law
...
The terms present in second parenthesis can
be simplified to ‘1’ using Boolean postulate
⇒ f = p⊕qp⊕qr + pq11
Step 3 − The first term can’t be simplified further
...

⇒ f = p⊕qp⊕qr + pq
Therefore, the simplified Boolean function is f = p⊕qp⊕qr + pq
Method 2
Given Boolean function, f = p’qr + pq’r + pqr’ + pqr
...
That means, the
Logical OR operation with any Boolean variable ‘n’ times will be
equal to the same variable
...

⇒ f = p’qr + pq’r + pqr’ + pqr + pqr + pqr
Step 2 − Use Distributive law for 1st and 4th terms, 2nd and
5th terms, 3rd and 6th terms
...

⇒ f = qr11 + pr11 + pq11
Step 4 − Use Boolean postulate, x
...

⇒ f = qr + pr + pq
⇒ f = pq + qr + pr
Therefore, the simplified Boolean function is f = pq + qr + pr
...
Functionally, those two
Boolean functions are same
...

Example 2
Let us find the complement of the Boolean function, f = p’q +
pq’
...

Step 1 − Use DeMorgan’s theorem, x+yx+y’ = x’
...


⇒ f’ = p′qp′q’
...
yx
...
{p’ + q′q′’}
Step3 − Use the Boolean postulate, x′x′’=x
...
{p’ + q}
⇒ f’ = pp’ + pq + p’q’ + qq’
Step 4 − Use the Boolean postulate, xx’=0
...



Title: Digital Circuits - Codes
Description: Digital Circuits - Codes