Lecture 1 - Introduction to Logic Circuits
Lecture 1 - Introduction to Logic Circuits
Design
Introduction to Logic Circuits
Introduction to Logic Circuits
2
Lecture I
The phrase implies that almost all quantities to be measured and manipulated or controlled
are all analog. Thus, any digital system cannot be implemented with such quantities. To make
analog quantities to be used on digital system or the other thing, conversion is necessary. An analog
quantity is converted to digital by means of an Analog-to-Digital Converter (ADC) or a digital
quantity can be made analog by using a Digital-to-Analog Converter (DAC). Conversion from analog
to digital or vice versa has different techniques and will be discussed in Signal Processing.
3 Number Systems
Since digital systems use discrete data, numbers and alphanumeric characters are common
symbols that can be easily understood. Numbers comes in patterns of small increment of symbols
and obviously changes in discrete intervals (e.g. 1, 2, 3, 4, etc ...) the alphabet changes in discrete
interval too. Thus, the alphanumeric codes are the best to be used to represent any digital quantity.
Where:
N is the value of the number
n is the place value of a digit of the number
r is the radix of the number
D is the value of a coefficient of the number
The radix or base of a number system is the amount or number of symbol used for that
number system.
Numbers also come in subscript indicating their radix. An exemption to this is the decimal
system which may not use subscript.
3
Introduction to Logic Circuits
number is 7 one hundreds, 2 tens, 3 ones and 4 one-tenths. Using the previous definition of a
number, the number 723.4 is equal to 7 x 10 2 + 2 x 101 + 3 x 10° + 4 x 10- 1 .
It is now clear how the values of a decimal numbers are known; similar ways are used to
other number systems. A prominent number system used in computers is the binary system. It uses
two symbols; 0 and 1, thus it has a radix of 2. The use of two symbols make the binary system very
popular to computers since it can represent an on or off, a presence or absence of current, a high or
low voltage which are the primary phenomenon inside a computer. Take the number 1001.01 2,
3 2 1 1
which is defined as 1 x 2 + 0 x 2 + 0 x 2 + 1 x 2° +Ox 2- + 1 x 2- . 2
3.3.1 Advantages
Logic operations are the backbone of any digital computer, although solving a problem on
computer could involve an arithmetic operation too. The introduction of the mathematics of logic
by George Boole laid the foundation for the modern digital computer. He reduced the mathematics
of logic to a binary notation of 'O' and 'l'. As the mathematics of logic was well established and had
proved itself to be quite useful in solving all kinds of logical problem, and also as the mathematics of
logic (also known as Boolean algebra) had been reduced to a binary notation, the binary number
system had a clear edge over other number systems for use in computer systems.
Yet another significant advantage of this number system was that all kinds of data could be
conveniently represented in terms of Os and ls. Also, basic electronic devices used for hardware
implementation could be conveniently and efficiently operated in two distinctly different modes.
For example, a bipolar transistor could be operated either in cut-off or in saturation very efficiently.
Lastly, the circuits required for performing arithmetic operations such as addition,
subtraction, multiplication, division, etc., become a simple affair when the data involved are
represented in the form of O's and l's.
The smallest unit of information in a binary system is called a 'bit', which is short for a
binary digit. A byte is a string of eight bits. The 'byte' is the basic unit of data operated upon as a
single unit in computers. A computer word is again a string of bits whose size, called the 'word
length' or 'word size', is fixed for a specified computer, although it may vary from computer to
computer. The word length may equal one byte, two bytes, four bytes or be even larger. Another
unit is a 'nibble' in which it is a string of four bits or half-byte long. Large memories are often in
Megabytes, Gigabytes or sometimes Terabytes, the conversion is 1 kilobyte (kB) = 1024 bytes,
l Gigabyte (GB) = 1024 Megabytes and so on.
Similar to decimal and binary systems, the octal and the hexadecimal system follow the
same summation definitions only a different radix. The octal and the hexadecimal systems are also
employed in computers, for the reason that the binary system is not that strong.
The octal system uses eight symbols; 0, 1, 2, 3, 4, 5, 6 and 7. It has a radix of 8. Example is
456.38 is equal to 4 x 8 + 5 x 8 + 6 x 8° + 3 x s- . Hence the hexadecimal system uses sixteen
2 1 1
4
Lecture I
since 10-15 will have two symbols the letters are chosen instead. FACE.OF 16 is equal to F x 16 3 +
AX 162 + C X 161 +EX 16° + 0 X 16- 1 + F X 16-2.
Example 1
Consider an arbitrary number system with independent digits as 0, X and Y. What is the radix of this
number system? List the first ten numbers in this number system.
Solution
• The radix is three since there are three independent symbols used.
• The first ten numbers would be 0, X, Y, XO, XX, XY, YO, YX, YY and XOO.
1. llOlz
11012 = 1 X
3
2 +1X 2 1
2 + 0 X 2 + 1 X 20 = 13
2. lllOlz
111012 = 1 X 24 + 1 X 23 + 1 X 2 2 + 0 X 21 + 1 X 20 = 29
3. 1001.0lz
1001.01 2 = 1 X 23 + 0 X 2 2 + 0 X 21 + 1 X 20 + 0 X 2- 1 + 1 X 2- 2 = 9.25
5
Introduction to Logic Circuits
3. FACE.F16
FACE. F16 = 15 X 16 3 + 10 X 16 2 + 12 X 161 + 14 X 16° + 15 X 16-1 = 64206.9375
3.6 Decimal to Other Base Conversion
To convert a decimal number to another number system, just do a continuous division on
the number and the succeeding quotients until the last quotient is zero. List all the remainders
employing the first remainder as the least significant digit and the last remainder as the most
significant bit. This is for decimal numbers greater than one. For decimal numbers less than one,
employ the reverse process which is multiplication.
12 = 11002
6
Lecture I
2. 425
Quotients Remainders
0 1
2 1 1
2 3 0
2 6 1
2 13 0
2 26 1
2 53 0
2 106 0
2 212 1
2 425
425 = 1101010012
3. 9.3125
For 9
Quotients Remainders
9 = 10012
For 0.3125
Product
Product Excess
without Excess
2 0.3125
2 0.625 0.625 0
2 0.25 1.25 1
2 0.5 0.5 0
0.0 1.0 1
0.3125 = 0.0101 2
Thus, 9.3125 = 1001.01012
3.6.2 Decimal-to-Octal Conversion
1. 12
Quotients Remainders
12 = 148
7
Introduction to Logic Circuits
2. 425
Quotients Remainders
0 6
~~~
8~
425 = 651 8
3. 9.3125
For9
Quotients Remainders
9 = 118
For 0.3125
Product
Product Excess
without Excess
8 0.3125
8 0.5 2.5 2
0.0 4.0 4
0.3125 = 0.248
Thus, 9.3125 = 11.248
3.6.3 Decimal-to-Hexadecimal Conversion
1. 425
Quotients Remainders
0 1
16 ~ lO➔A
16 26 9
16 425
425 = 1A916
2. 2640
Quotients Remainders
0 lO ➔A
16 10 5
16 165 0
16 2640
2640 = A5016
8
Lecture I
3. 24.1640625
For 24
Quotients Remainders
0 1
16u:==s
16~
24 = 1816
For 0.1640625
Product
Product Excess
without Excess
16 0.1640625
16 0.625 2.625 2
0.0 10.0 lO ➔A
0.1640625 = 0.2A16
Thus, 24.1640625 = 18.2A 16
1. 100101010101110b
Octal
10010101010111012 = 001001010101011101
..___, ..___, .___, .___, .___, = 1125358 '-...-'
1 1 2 5 3 5
Hexadecjmal
1001010101011101 2 = ..__.....__.......__.....__...
1001010101011101 = 955D 16
9 5 5 D
2. 11101010101011012
Octal
1110101010101101 2 = 001110101010101101
. _ _ _ , '-_,_.I . . _ _ , . . _ _ , ' - . . . - ' ..___,
= 165255 8
1 6 5 2 5 5
Hexadecjmal
1110101010101101 2 = ..__......___...__.......__.....
111010101010 1101 = EAAD 16
E A A D
3. 101011010.1011112
Octal
101011010.101111 2 = 101011010
,.,__., ..___, ,.___, . 101111
..___, ..___, = 532.578
5 3 2 5 7
9
Introduction to Logic Circuits
Hexadecimal
101011010.101111 2 = ---.--
000101011010 .10111100
---.-----.-- ---.------.-- = 15A. BC16
1 5 A B C
It is the same as the previous, one octal digit is three binary digits and one hexadecimal digit
is four binary digits.
Octal
1. 1675a
1675 8 = y
1 y6 y7 y5 = 1110111101 2
001110 111101
2. 754a
7548 = 7 ....,
...., 5 ....,
4 = 111101100 2
111101100
3. 513.53a
513.53 8 = y5 y1 y3 . y5 y3 = 101001011.101011 2
101 001 011 101 011
Hexadecimal
1. 9AB16
9AB 16 = 9
...., A
...., B
...., = 100110101011 2
10011010 1011
2. FlA816
F1A8 16 = F
y y
1 y
A y
8 = 1111000110101000 2
1111000110101000
3. A73.ED16
A73 . ED16 = y 7 y
A y 3 . y D = 101001110011.11101101 2
E y
1010 0111 0011 1110 1101
The conversion of this number system is done by converting it first to binary and then the
binary equivalent is then converted.
Octal to Hexadecimal
1. 1675a
16758 = y1 y6 y7 y5 = 1110111101 2 = -001110111101
--.-----.-- ---.--
= 3BD16
001110111 101 3 B D
2. 754a
7548 = 7 5 4 = 111101100 2 = 00011110 1100 = 1EC16
'-,J 1...,-1 y ---.-----.-----.--
111101100 1 E C
ID
Lecture I
3. 513.53a
513.53 8 = 5 1 3 . 5 3
'-,,.I '-,,.I '-,,.I '-,,,J 1..,.,1
= 101001011.101011 2 = 00010100 1011.1010 1100 = 14B.AC16 ..__......__......__......__......__....
101 001 011 101 011 1 4 B A C
Hexadedmal to Octal
1. 38D16
3BD16 = 3
'-,,,.I
B
y
D
y
= 1110111101 2 = 001110 111101 = 16758 ..___, ..___, ,.___, ,.___,
0011 1011 1101 1 6 7 5
2. lEC16
1EC16 = 1
'-,,,J
E
'-,,,J
C
'-,,,J
= 111101100 2 = 111101100 = 7548 ,.___,,.___,.___.
00011110 1100 7 5 4
3. 14B.AC16
14B.AC16 = y
1 4
.._.,
B
'-,,.I
. A
1...,-1
C
'-,,,J
= 101001011.101011 2 = 101001 011. 101011 ,.___, \ _ , _ I ,.___, ,.___, ..___,
Assume an arbitrary number system having a radix of 5 and 0, 1, 2, L and M as its independent
digits. Determine the decimal equivalent of 12LM.Ll
Solution:
12LM.Ll 5 =l X 53 +2 X 5 2 + (L = 3) X 51 + (M = 4) X 5o + (L = 3) X 5- 1 +l X 5- 2 = 194.64
Example3
Assume a radix-32 arbitrary number system with 0-9 and A-Vas its basic digits. Express the mixed
binary number 110101.001 2 in this arbitrary number system.
Solution:
32 =2 5
thus, 5 bit binary is one symbol in this number system
110101.001 2 = 0000110101.
----,.......... ----,.......... 00100
----,.......... = ll. 4 32
1 21=L 4
4 Complements
Complements are used in digital computers for simplifying the subtraction operation for
logical manipulation. There are two types of complements for each base-r system: the radix
complement and the diminished radix complement. The first is referred to as r's complement and
the second as (r-l}'s complement
Given a number Nin base r having n digits, the (r-l}'s complement of N is defined as
( r n l) - N. For decimal numbers,
- = 10 and l = 9, so the 9's complement of is r r - N
II
Introduction to Logic Circuits
12
Lecture I
6 Binary Codes
Codes are used to represent data in a computer and it must be in binary so that the
computer can understand. To take note binary codes are used not to change the meaning of the
quantity it represents but only to change the symbol for the convenience of computing.
13
Introduction to Logic Circuits
Example4
Represent the number 154 into its corresponding BCD code. How many bytes of register are
required to store this number, if the system stores this number as packed BCD? How about if
unpacked?
Solution
For packed BCD, each digit is 1 nibble only
------------
154 = 0001 0101 0100
1 5 4
154 is a 12-bit data in packed BCD, thus 2 bytes are required to store 154
14
Lecture I
7 1000
8 1001
9 1010
15
Introduction to Logic Circuits
The 84-2-1 code is a weighted code where the weights of the bits are 8, 4, -2 and -1 starting
from the MSB to the LSB. This is also a self-complementing code, wherein changing the value of the
bit will result to the 9's complement of the number. This is also a reflected code, wherein if the
frequencies of the number 0-9 are of the same frequency then the bits 0 and 1 will be equal in
frequency.
Table 8: Decimal to 84-2-1 Code Conversion
Decimal 84-2-1 Code
0 0000
1 0111
2 0110
3 0101
4 0100
5 1011
6 1010
7 1001
8 1000
9 1111
16
Lecture I
2 0101
3 0110
4 0111
5 1000
6 1001
7 1010
8 1011
9 1100
17
Introduction to Logic Circuits
Table 12 : Dec1m
• al to B"1c umary Cd
o e Convers1on
Decimal Biquinary Code
0 01 00001
1 01 00010
2 01 00100
3 01 01000
4 0110000
5 10 00001
6 10 00010
7 10 00100
8 10 01000
9 10 10000
18
Lecture I
3 0001000000
4 0000100000
5 0000010000
6 0000001000
7 0000000100
8 0000000010
9 0000000001
Examples
Solution
Form Table 2 to Table 14
5 9 2 1
NBCD 0101 1001 0010 0001
5421 code 0101 1100 0010 0001
7421 code 0101 1010 0010 0001
5311 code 1000 1101 0011 0001
4221 code 0111 1111 0010 0001
2421 code 1011 1111 0010 0001
84-2-1 code 1011 1111 0110 0111
XS3 code 1000 1100 0101 0100
XS11 code 10000 10100 01101 01100
2-out-of-5 code 01100 11000 00110 00101
Biquinary code 1000001 1010000 0100100 0100010
Rev. Biquinary
001001 100001 000100 000011
code
1-out-of-10 code 0000010000 0000000001 0010000000 0100000000
The Gray code was designed by Frank Gray at Bell Labs and patented in 1953 for the
application for an optical shaft encoder. It is an unweighted binary code in which two successive
values differ only by 1 bit. Owing to this feature, the maximum error that can creep into a system
using the binary Gray code to encode data is much less than the worst-case error encountered in
the case of straight binary encoding. Table 15 lists the binary and Gray code equivalents of decimal
numbers 0-15. An examination of the four-bit Gray code numbers, as listed in Table 15, shows that
the last entry rolls over to the first entry. That is, the last and the first entry also differ by only 1 bit.
This is known as the cyclk property of the Gray code. Although there can be more than one Gray
code for a given word length, the term was first applied to a specific binary code for non -negative
integers and called the binary-reflected Gray code or simply the Gray code.
19
Introduction to Logic Circuits
20
Lecture I
6.2.3 Applications
1. The Gray code is used in the transmission of digital signals as it minimizes the occurrence of
errors.
2. The Gray code is preferred over the straight binary code in angle-measuring devices. Use of the
Gray code almost eliminates the possibility of an angle misread, which is likely if the angle is
represented in straight binary. The cyclic property of the Gray code is a plus in this application.
3. The Gray code is used for labeling the axes of Karnaugh maps, a graphical technique used for
minimization of Boolean expressions.
4. The use of Gray codes to address program memory in computers minimizes power
consumption. This is due to fewer address lines changing state with advances in the program
counter.
5. Gray codes are also very useful in genetic algorithms since mutations in the code allow for
mostly incremental changes. However, occasionally a one-bit change can result in a big leap,
thus leading to new properties.
Seven-segment displays (Figure 1) are very common and are found almost everywhere,
from pocket calculators, digital clocks and electronic test equipment to petrol pumps. A single
seven-segment display or a stack of such displays invariably meets our display requirement. There
are both LED and LCD types of seven-segment display. Furthermore, there are common anode-type
LED displays where the arrangement of different diodes and pin assignments, designated a, b, c, d,
e, f and g, is as shown in Figure l(a), and common cathode-type displays where the individual
diodes are interconnected as shown in Figure l(b). Each display unit usually has a dot point (DP).
The DP could be located either towards the left (as shown) or towards the right of the figure '8'
display pattern. This type of display can be used to display numerals from Oto 9 and letters from A
to F. Table 16 gives the binary code for displaying different numeric and alphabetic characters for
both the common cathode and the common anode type displays. A '1' lights a segment in the
common cathode type display, and a 'O' lights a segment in the common anode type display. Figure
2 shows the different characters displayed given the codes from Table 16.
g f AN a b g f CA a b
D D
e d AN c DP e d CA c DP
(a) (b)
21
Introduction to Logic Circuits
-
I
c::::::::::::J
I D
c::::::::::::J
c::::::::::::J
I -- --
D I D I
DJ
0 -
I o.D
□ c::::::::::::J
I DJ
□ -
D o.D
□ -
I
- --
c::::::::::::J
I I I D I -- - D D c::::::::::::J
I
DP
□
D I DP D I DJ I D DP I
□ -
c::::::::::::J □ c::::::::::::J
□ -
-- --
I I I I I-- - I
c::::::::::::J
I D
DJ I DP D I DJ I DJ I
□ - □ -
□ c::::::::::::J
□ -
I- -
c::::::::::::J
D D
c::::::::::::J
I -- --
I D I D
DJ
□ -
D DJ
□ -
I DJ
□ -
DDJ □ c::::::::::::J
D
Figure 2: Coded Seven-Segment Display
22
Lecture I
23
Introduction to Logic Circuits
X I 10111
y 6 10101
,,
z 10001
Figure Shift 11111
Letter Shift 11011
Space 00100
Line Feed (LF) 01000
Blank (Null) 00000
Example6
Solution
From Table 17
11111
___...
Figure Shift
-----
11001 00100
2
..__... 11011
___...
space Letter Shift
1001101100010101001010100
___... ___... ___... ___... ..___,,_.,
B I R D S
The ASCII (American Standard Code for Information Interchange), pronounced 'ask-ee', is
strictly a seven-bit code based on the English alphabet. ASCII codes are used to represent
alphanumeric data in computers, communications equipment and other related devices. The code
was first published as a standard in 196 7. It was subsequently updated and published as ANSI X3.4-
1968, then as ANSI X3.4-l 977 and finally as ANSI X3.4-l 986. Since it is a seven-bit code, it can at the
most represent 128 characters. It currently defines 95 printable characters including 26 upper-case
letters (A to Z), 26 lower-case letters (a to z), 10 numerals (0 to 9) and 33 special characters
including mathematical symbols, punctuation marks and space character. In addition, it defines
codes for 33 nonprinting, mostly obsolete control characters that affect how text is processed.
24
Lecture I
With widespread use of computer technology, many variants of the ASCII code have evolved
over the years to facilitate the expression of non-English languages that use a Roman-based
alphabet. In some of these variants, all ASCII printable characters are identical to their seven-bit
ASCII code representations. For example, the eight-bit standard ISO/IEC 8859 was developed as a
true extension of ASCII, leaving the original character mapping intact in the process of inclusion of
additional values. This made possible representation of a broader range of languages. In spite of the
standard suffering from incompatibilities and limitations, ISO-8859-1, its variant Windows-1252
and the original seven-bit ASCII continue to be the most common character encodings in use today.
0110 - I '
% - > ?
0111 : # @ ' = "
1000 a b C d e f g h i
1001 j K I m n 0 p q r
1010 ~ s t u V w X y z
1011
1100 { A B C D E F G H I
1101 } J K L M N 0 p Q R
1110 \ s T u V w X y z
1111 0 1 2 3 4 5 6 7 8 9
25
Introduction to Logic Circuits
Example7
Solution
Since ASCII is a 7-bit code, just add another bit, in this example we use 'O'
From Table 18
01010100 01101000 0110010100100000 0100011101101110 011011110110110101100101
T h e Space(SP) G n 0 m e
Example8
Solution
From Table 19
1110001110001000 10000101010000001100011110010101100101101001010010000101
T h e Space (SP) G n 0 m e
6.4.4 Unicode
Unicode, developed jointly by the Unicode Consortium and the International Organization
for Standardization (ISO), is the most complete character encoding scheme that allows text of all
forms and languages to be encoded for use by computers. It not only enables the users to handle
practically any language and script but also supports a comprehensive set of mathematical and
technical symbols, greatly simplifying any scientific information exchange. The Unicode standard
has been adopted by such industry leaders as HP, IBM, Microsoft, Apple, Oracle, Unisys, Sun, Sybase,
SAP and many more.
26
Lecture I
__11[_
MSB Os Is MSB
0
Os __11[_
Is
04 0
l4
03 0 '3
02 12
__11[_
01 0
11
LSB Oo lo LSB
Station A Station B
Figure 3: Parallel Transmission
0 0
Output i---..:...____:;;;;;;;;;;;;:_____:;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:____,:;;;;;;;;;;;;;;;:-i In put
Station A Station B
Figure 4: Serial Transmission
27
Introduction to Logic Circuits
6. 7 Error Detection
Error detection is the process of monitoring data transmission and determining when
errors have occurred. Error detection techniques neither correct nor identify which bit are in error
- they indicate only when an error has occurred. The purpose of error detection is not to prevent
errors from occurring but to prevent undetected errors from occurring.
The most common form of error detection is Redundancy Checking Duplicating each data
for the purpose of error detection is called Redundancy While, adding bits for the sole purpose of
error detection is called Redundancy Check
There are other forms of parity such as Marking Parity in which the parity bit is always '1', No
Parity in which the parity bit is not sent to the receiver and Ignored Parity in which the parity bit is
always 'O'.
6.7.2 Checksum
Checksum is another relatively simple form of redundancy error checking where each
character has a numerical value assigned to it. The characters within the message are combined
together to produce an error checking character (checksum), which can be as simple as the
arithmetic sum of the values of all characters in the message. The checksum is appended at the end
of the message. The receiver replicates this method and determines its own checksum. The receiver
compares this to the received checksum, if they are the same it is assumed that no error has
occurred.
28
Lecture I
As seen from Table 21 the original frame/block for the word 'LOGIC' using even parity VRC
is 11001100 11001111 01000111 11001001 11000011 which is a 5-byte data, and
L O G I C
appending the block check character the block check sequence is now a 6-byte data
11001100 11001111 01000111 11001001 11000011 10110001
L 0 G C BCC
The number of bits in the CRC code is equal to the highest exponent of the generator polynomial.
Example9
Determine the BCS for the following data and CRC generating polynomials:
Data G(x) = x + x + x + x + x + x = 10110111
7 5 4 2 1 0
29
Introduction to Logic Circuits
CRC P(x) =x 5 4
+x +x +x 1 0
= 110011
Solution
First, multiply G(x) by the number of bits in the CRC code, which is 5 from x 5. Or just simply add 5
bits at the end of the message. Then use modulo-2 division
1 1 0 1 0 1 1 1
1 1 0 0 1 1 1 0 1 1 0 1 1 1 0 0 0 0 0
1 1 0 0 1 1
1 1 1 1 0 1
1 1 0 0 1 1
0 1 1 1 00 1
1 1 0 10 1
0 10 10 0 0
10 01 1 1
0 11 1 1 0
1 01 0 1 1
1 1 1 0 1 0
1 1 0 0 1 1
0 1 0 0 1 --+CRC
Now, the CRC is appended to the data and give the following data stream
10110111 01001
BCS = ---..---
data CRC
At the receiver, the data stream is again divided by P(x) to check if there were any errors.
1 1 0 1 0 1 1 1
1 1 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 0 1
1 1 0 0 1 1
1 1 1 1 0 1
1 1 0 0 1 1
0 1 1 1 0 1 0
1 1 0 0 1 1
0 1 0 0 1 1 0
1 1 0 0 1 1
1 0 1 0 1 0
1 1 0 0 1 1
1 1 0 0 1 1
1 1 0 0 1 1
0 0 0 0 0
Remainder= 0, th en there were no
transmission error
30
Lecture I
Note: the sender and the receiver must have an agreement, that's why standards has been used, on
what generating polynomial shall they use for error detection
Error correction is the process of determining when an error has occurred and what to do
with it. In the modern data communications world two error correction methods are widely used:
Retransmission and Forward Error Correction.
6.8.1 Retransmission
Retransmission, as the name implies, is when a receive station requests the transmit station
to resend a message ( or a portion of a message) when the message is received in error.
Retransmission is often called ARQ, which is an old radio term that means automatk repeat request
or automatk retransmjssjon request ARQ is probably the most reliable error correction method
although it is not necessary the most efficient. There are two basic types of ARQ: discrete and
continuous. Discrete ARQ uses acknowledgements. There are two types of acknowledgements:
positive and negative. Positive acknowledgement (ACK) is the destinations response to an error-
free message while negative acknowledgement (NAK) for messages with error. Continuous ARQ on
the other hand allows the destination to asynchronously request the retransmission of a specific
frame (or frames) of data and still be able to reconstruct the entire message once all frames have
been successfully transported through the system.
Forward Error Correction (FEC) is the only error correction scheme that actually detects
and corrects transmission errors when they are received without requiring a retransmission. The
most popular FEC is the Hamming code. The Hamming code was developed by Richard W.
Hamming. The Hamming code is an error-correcting transmission error in synchronous data
streams. However, Hamming code can only correct single bit errors. Hamming bits (or error bits)
are placed at random locations on the message. The sender and the receiver must agree on where
the Hamming bits are placed. Normally, Hamming bits are located on the 1, 2, 4, 8, and 16 ... bit
positions. To calculate how many Hamming bits are required for a code the expression to use is:
2n :2'. m + n + l
where n is the number of Hamming bits and m is the number of bits in a code.
To determine the state of each hamming bits, express all bit positions that contain a logic '1'
in their n-bit binary number and XOR them together.
Example 10
For a 16-bit string of 1100 0101 0011 0010, determine the number of Hamming bits required,
arbitrarily place the Hamming bits in the data string, determine the logic condition of each
Hamming bit, assume a single transmission error, and prove that the Hamming code will
successfully detect the error.
Solution
Substituting m = 16, for n = S
2 5
= 32 > 16 + S + 1 = 22
31
Introduction to Logic Circuits
Thus 5 Hamming bits are sufficient, and the total number of bits to be sent is 21 (16 + 5).
11 0 0 0 H l 0 1 0 0 l lH00lH0HH
32