0% found this document useful (0 votes)
279 views20 pages

Binary Code and Classification Book

This document discusses digital circuits and binary number systems. It introduces digital data as consisting of only 0s and 1s, which are used to represent letters, numbers, and other characters through binary codes. These binary codes are used in computers and other applications to process and transmit digital information. Common operations on binary numbers like addition, subtraction, and conversion between decimal, binary, octal, and hexadecimal systems are also covered.

Uploaded by

Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
279 views20 pages

Binary Code and Classification Book

This document discusses digital circuits and binary number systems. It introduces digital data as consisting of only 0s and 1s, which are used to represent letters, numbers, and other characters through binary codes. These binary codes are used in computers and other applications to process and transmit digital information. Common operations on binary numbers like addition, subtraction, and conversion between decimal, binary, octal, and hexadecimal systems are also covered.

Uploaded by

Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

DIGITAL CIRCUII

2
8. (b)
.(a
17,@ 18 (b) 19. (a
16(b 27. 1b)
28. (a)
29. tb
ANSWERS
26. d
25 a

E
1L 12
o sUPPLEMENTARY P R O
ARY PROBLEM
is
equvalent
octal

)
a n d binary

(73.89)10
BINARY CODES
namberto
Convert
the
foliowing
decimal

tb) (236.45)10 decimal


AND CLASSIFICATION.
(a) (5432)10 number
systems
tois
equivalant
(123.11) () (11011.101)
Coavert the foliowing 6) (278.45
2
(a) (543.26 hexadecimal

(e) (2FA.4616 octal and


binary
numbers to
(c)(10.1101102 2.0 INTRoDUCTION
Express the following data which is n
bistable. All the digital circuits and conputers process
3. (a)(101111100101 )(10110.11012
form.
to is 2's complement The nature of digital electronic circuits is
is equal data which nay de
namber which are required to handle
method the data consists of 0's and 1's only. But actually, these circuits
4 Caiculate the four bit l's complement binary form ie., stored and then transmitted
in
numbers using
the folowing binary letters, numerals or special characters. Usually, the digital data is represented,
5. Subtract (101010% alphabetic used to represent letters of alphabets,
many
6) 110000,- bits known as binary code or digital code. The binary code is
(a) (10000) -(011} method groups of binary These codes are used in
&Suberat the following using
2s complement numerals. Binary codes are used in computers for various applications.
(c) (00101)> -
(01100), (d) (1010),h-(110. special characters and mobile communications,
(a) (10110%-O1101) b)(1010%-(10011) various other applications such as military applications,
communications, wrist watches, calculators,
banking
divisien audio-video systems, medical applications,
7. Perforzn the following binary cameras, digital compact discs, digital
digital home appliances, digital
(b) (1010)% +(10 used in our daily life.
(a) (1101101+(1 railways, nano-technology, robotics and many-many more applications
& Perform the folowing binary mutiplication
(c) (101002 x (0.1)>
2.1 ADVANTAGES OF BINARY CODES
b) (10101), x (d.1%
(a) (1lx(1.)
9. Mulaipiy he octal numbers the implementation of
basic digits called as bits i.e. 0 and 1. Thus
1. Binary codes make use of only two types of and
(a) (15% x (10g b) (231 x (26b taken to design any binary code
the user. Combination of 0's and 1's are
10. Find the vatue of 's' if binary codes and their use is easy for
(35), + (24), =
(103 is easier to use.
11. Convert A936H to otal
Thus are useful in computers for various applications.
12. Perform sobtraction
using 2's compiement methods 2. Binary codes are the language used for computers. codes.
(a) (69)1o-(13)10 and design of digital circuits depends
on binary
) (234)0-(621ho 3. All digital circuits works on binary codes. Thus analysis
13. Cakcuiate the base y' of the to do for users.
following 4. Representation, storage and
transmission of binary codes are easy
(a (193), =
(623) b) 152 =
(211), for making new circuits are more compact, thereby reducing
size anc

14. Perform the subtraction


using 1's compkement method
c) {(11),}2 (1000), (d) (341) (225),
= =
5. By using binary codes, the IC's designed
(a)
(10110%-(100001), (b) weight of the complex analog circuits.
15.
Perform te foäowing subration(110010) (1110100))
-

magnitude form using 1l's and 2's complement methods 45 +(-17). sult in s 22DISADVANTAGES OF BINARY CODES
16. Using 2's complement method unwanted signals called noise signals
are get added to it.
(a) (156)10-(9);0 perfom: 1. During transmission and reception,
17. Give
difference tby(16)10-5)10 '1' changeto0' dueto noise.
between Is 2'may change to '1' and may
18. Specify the maximum and complement, 2's complement and Larger data or information in binary
codes is difficult for the user to understand directly.
minimum 4-bit sign with suitable amples 3.
(a) sign
magninude form bl's
muaniber that can be magnitude Tor 91
complement form represented in
c) 2's
complement form
DIGIIAl RCUITS & LOGIC DESIGN
92 BINA
2.3 Various
CLASSIFICATION OF VARIOUS BINARY (DIGITAL)coDES
binary codes are classified as 2.3.1.1 BCD Code (Binary Coded DecimalCODES AND CLAssIFICATION
Code) 3
BCD represent each of
( a ) Binary digital clocks, calculators,decimal
as its
digit as a 4 bit
binary code. It is also known as 8421
output is always
from to 9. code(weighted code). it 1s
Weighted Codes
(i.e., 8421,
Tt takes decimal digit
separately and convert each into0 1Ou
5211, 5311, 2421, 3321,
5421, 6311, 4221
EXAMPLE Obtain BCD of binary coded form.
( 6 ) BCD 2.1
7421 sOLUTION: Convert 3 to binary(399)10
Non-weighted Codes
( a ) Excess-3
7421,8421) code using 8421
(3)10 (0011)pCD
code, we have
6)Gray Code Similarly,
910= (1001)BCD
(¢) Five bit BCD codes
9)10 (1001)BCD
a ) Excess-3 (399)10 (0011 1001 1001)gCD
=

Reflected Codes 6 ) 2421 EXAMPLE 2.2 Convert


(333)g to (?)BCD
( ) 5211 sOLUTION (333)5 =(3x54 +3x5+ 3x5)10
Binary- =
(75 + 15
Codes +3) 10
( a ) Excess-3
or
(93)10
Digital Sequential Codes (93)10 (1001 0011)BCD
Codes ( 6 ) 8421 2.3.1.2 BCD Addition

+(a) ASCI Steps for BCD addition are


() Add two numbers similar to binary addition.
(6) EBCDIC
Alphanumeric Codes (i) If the sum is equal to or less than 9' than it is valid BCD.
+(¢) ISCI (ii) If the sum is greater than "9' or carry
generated, then add 6 i.e., (0110), to the sum.
(d) Hollerith EXAMPLE 2.3 Obtain BCD addition of (5)10 and
sOLUTION:
(3)10
()Parity (5)10> (0101)BcD
Error Detecting and (310 (0011)pcD
Correcting Codes
(6) Hamming (1000)BCD 810
which is less than 9 hence it is correct.
2.3.1 Weighted Codes EXAMPLE 24 Obtain BCD addition of
(710 and
to their positions. i.e, each (7)10
Inweighted codes it is possible to assign weights to the binary bits or digits according SOLUTION
digit position of the number represents a specific weight. For example, the weights in the 4-bit straight binary code are 10 (0111)BCD
4,2, 1. Also, decimal system,
in if the number is 782 then weight of 7 is 100, weight of 8 is 10 and weight of 2 is l. (10 (01ll)gcD
The codes 8421, 2421, 3321, 4221, 5211 ete. all are weighted codes.
(1110)BCD
Table 2.1 shows the weighted codes with decimal equivalent for 4 bit codes Which is invalid BCD group as (1110) does not exist in 4 bit BCD
group.
TABLE 2.1 To get the correct or valid result add
(O110), to the invalid BCD group. It is as showa

3321 2421 84217421 (1110)Invalid BCD


Decimal 7421 6311 5421 5311 5211 4221
+ (0110)gcD
0000 0000
O000 0000 0000 0000 0000 0000
0000 0000 o111
0001 0001 0111 10100
0001 0001 0001 0001 0001 0001
0110 o110 Hence
2 0010 0011 0010 0011 0011 0010 0010 0010
0101
(0111)pcD+(0111)pcD (0001 0100 )BCD
0011 0101
3 0011 0100 0011 0100 0101 0011 0011
0100
0100 2,3.2 Non-Weighted Codes
4 0100 0101 0100 0101 0111 1000 0101 0100
0101 0111 1000 1000 1000 0111 1010 1011 1011
1010
In non-weightedthecodes it isnumber
acn position within
not possible to assignweightsto the binary bits or digits according to their positions ie
is not value
assigned a specific weight.
101 binary or
0110 1000 1001 1100 1010
1001 1001 1100 1100 100 Examples of non-weighted codes are excess-3 code and gray code.
1000 1001 1010 1101 1101 1001
1011 1011 1101
1001 1011 1000
1011 1100 1101 1110 1110 1110
1010 1100 1111
10
1100 1101 1111 1111 1111 1111
DIGITAL CIRCUITS & LOGIC DESIGN BINARYCODES AND CLASSIFICATION 5
94 2.3.2.1 Excess-3 Code (XS-3) coe one Dit
when compared a row with the
change occurs adjacent row after an
i
BCD. Excess-3 code is related to BCD 8421 o d a Here, in gray s ee O1y
This is obtain by addition of
three
ie. (0011)2 ton the
an exceSS3 code IS equal to a specific decimal digit e s e in the decimal number. Une bit change is marked by a circle as shown in table 2.2
nature ie. the group of tour bits
binary coded decimal
EXAMPLE 25 Obtain Excess-3 code of (1 companng decimal 5 and 6,
For example,
on we get

SOLUTION: Convert Binary Code Gray Code


Decimal
( 1 0 to BCD
0101
(6)10(0110)pcD
01110
0111
Addition of (O1 10pCD and (0011)2 is given a s : 010Ji
0110 urdy
same. T bus,
Here, the second bits last or decimal S and 6 for Gray code changes and all other remaining bits are
0011 code and is
called as gut distance a cyelic code.
(1001) excess-3 code is also
Property of a Gray Code
EXAMPLE 26 Obtain Excess-3 code of (48)10 23.22.1 Refective we
bits for 2-bit, 3-bit and 4-bit Gray equivalent of binary number in sequence.
On comparing least significant
code
sOLUTION: (43)10 0100 1000 PpcD as shown in table 2.3.
miror image
+0011,0011 get a

(0111 1011)excess-3 TABLE 2.3


Note: Excess-3 code is self complementing code as 1's complement of an excess-3 code is an excess-3 for yy
complement of the decimal. Gray Code
Decimal Binary
EXAMPLE 2.7 Show fthe self complement nature of excess-3 code.
Equivalent Equivalent 2-bit 3-bit 4-bit
sOLUTION: Lets take the decimal (6)10 l's complement of()10 (0110)>=(1001)2. It's excess-3 codeis 100J
and the 1's complement of (1001> is (0110)2
0 0 0 0 0 0 Miror 0 0
Which is the excess-3 of 9's complement of (0110).
O0 1 of_
23.2.2 Gray Code
Gray codes are the codes when successive coded characters differ in only one bit position.Gray codes are refiecte 0
codes. These codes are usefui for input-ouput devices, A/D coBverters, K-maps, shaft position encoder for angularpositin 0 11
of shaft. compact discs (i.e, CD's) ete. Gray codes are non-weighted codes.
Table 22 shows one bit change at a time in the adjacent code for a gray code when each time a decimal number i
incremented by one. 0 10 1
TABLE 2.2 6

Gray Code 0 1 1 1
Decimal Number Binary Equivalent -- -----.
10 0 0
0 0 0 0 0 0 0
0 9 0
0 0 0 1
oo l0
2 0 0 1 0
o 0 1 1 11 1 1 1
12
o100 110 0
O101 13
o 14
0 1 1 11
15 1 111
I 0 0 0
I 0 0 1
10
10 1 0 1 11
DIGITAL CIRCUITS & LOGIC DESIGN
BINARY CODES AND CLASSIFICATION|
23.222 Advantages of Gray Code bits and gray code bits are as s

For a 3-bit binary code in


a rotating disc the position of binary
hown in fig2 Case II.
Next adjacent bit
is added

and(b). Represent 1 C d
Binary Number

Represent 0 101 Gray Code


101 110
111 2
a+b discard it.
I f carry comes,

110/ Similarly, d Binary Number


00 111 100
a (atb) (b+c) (c+d) Gray Code
XOK gate.
Brush 1 Brush 1 it uses m o d u l o - 2
addition or output of two input
3rush 2 Brush 2 In any ofthe addition t carty
it. Simply,
comes number >
discard
a binary
-Brush 3 010 Brush 3 be more
clear by considering
011 000 Tt will N= (abcd)2 = (1101)>2
/000 Ley
MSB Binary Number
011 001 MSB as it is
Case L Drop
010 001 Rotating Discs
Gray Code
(b) Gray code pattemn
(a) Binary code pattem
IL. Next adjacent bit is added
Case
Fig. 2.1 1
low signal i.e., '0.
Here, the black portion represents high
signal i.e., '1' and white portion represents
to enter the sector O00. At this instant if one hma
3 a r e on the sector 111
and are ready
Now if the brushes 1, 2 and indicated would be '011' instead of I (1+1)
"

number 3, then the position


ahead of the other, for instant let it be brush e v e n notice it. It is because in binan 1+1=
is slightly and the u s e r would not
o c c u r s in the disc position Discard Carry
an error of 18O will always be present
o r 000'. Hence, their values and also s o m e error
of time number of digits can change
codes, at a given instant any

the edges of the sectors. o n e bit changes at a time wit


because in gray codes only
This problem can be eliminated by using gray codes, o c c u r due to one bit position only and the
Similarly,
number each time. Thus,
for 3-bit code error may 66%. If dalai
increment in adjacent decimal in a 3-bit code is 33% or will reduced upto
of error
bits are error free. Therefore, the probability
other two
75%.
or will reduced upto
4-bit then it will be 25%
Code a code-wo
2.3.2.23 Applications of Gray encodes basically produces
A shaft position
used in shaft position encoders. Similarly,
1. Gray code is mainly ofshaft
which represents the angular position
discs to produce an appropriate
binary code.
the optical
2. Gray codes a r e used in
Conversion
2.3.2.2.4 Blnary to Gray Code Code by considering
following steps:
converted into its equivalent Gray Binary Number
The binary numbers can be Code.
remains same in Gray
of the binary number the cany
u

( ) The MSB (Most Significant Bit) c o m e s neglect


or discard
each adjacent pair of binary digits, if carry Gray Code
MSB to LSB and add
Move firom
write the sum as next Gray Code digit
Hence, (1101)% = (1011)Gray Code
Generalized form for Binary to Gray code conversion
>
to Gray Code
Let the binary number be EXAMPLE 2.8 Convert (10110110)2 LSB
(abcd where, ab cdis any 4-bit binary number SOLUTION:
MSB
0 1 1 0 Binary Number
Its gray code is Case I. Drop MSB as it is 0 11
MSB LSB Gray Code
Case I. Drop MSB as it is b C d Binary Number

+Gray Code
DESIGN
DIGITAL CIRCUITS & LOGIC
for gray code. Discard the carry
bit ry iif comes.
|BINARY CoDES AND CLASSIFICATION 99
bt and write the next
bit to M S B
98 Case I . Add
the adjacent
Case I . Gray Code
+ Binary Number
Binary Number

Gray Code
(1)
Cary T Carry 1s Discard the carry
discardedd
discarded

Hence, (10110110% (11101101)Gray Code


=

Conversion
Code to Binary
2.3.2.2.5 Gray umber by considering following steps
can be converted
into its equivalent binary 0 (0+0)
The Gray Code
remains s a m e in binary number.
of the Gray Code
(Most Significant Bit)
(1) The MSB bit of the gray code, if cary comes discard thecan
generated to the next significant ary and
(2) Add each binary digit bit. Gray Code
write the sum a s next binary
Conversion
to Binary
Generalized form for Gray Code Similary, we have
Binary Number
Let the Gray Code be [Where, (ABCD) is any 4-bit Gray Code number]
(ABCDGray Code
Its binary number is Hence, (11011010)Gray Code (10010011)2
MSB LSB
B C D Gray Code 2.3.3 Reflective Codes
it is
Case I. Drop MSB as
reflective if the code for 9 is the complement for the code for 0,
the code for 8 is the complement
The code is said to be code for 3
Binary Number code for 6 is the complement for the
the code for 7 is the complement for the code for 2, the
A for the code for 1,
for the code for 4.
and the code for 5 is the complement
of reflective codes are
when the 9's complement must be found. The examples
Gray Code The reflectivity is desirable in a code
C D
excess-3 code.
Case 2421, 5211 and

A (AtB)
Binary Number 2.3.4 Sequential Codes
discard it. of data. In these codes each succeeding
code is one binaryy
I f carry comes
Sequential codes make use of mathematical manipulation
codes are 8421 and excess-3.
number greater than its preceding code. The examples of sequential
Similarly,
Gray.Code
2.3.5 Alphanumeric Codes
(i.e.,
data ietters, symbols and numbers). Thetelegraph which
Case IlL B It isspecial code which represents all alphanumeric
a
Other
which Hollerith code are the examples of alphanumeric codes.
use Morse Code in 1's and 0's and punched cards use
Binary Number
A (A+B)=Y (Y+C)=Z (Z+D) alphanumeric codes as ASCI, EBCDIC and ISCl.

discard it. 2.3.5.1 ASCII Code (American Standard Code For Information Interchange)
Ifcarry comes

consists of bits for all alphanumeric data used in


binary
It is American Standard Code For Information Interchange. It 7
EXAMPLE 2.9 Convert a given Gray Code to
is added for Table 2.4 shows the ASCII Code with their abbreviations.
parity.
computer input/output systems. Bighth bit
(11011010) Gray Code converted to ASCIl code and then computer starts processing.
After that
sOLUTION :
When key is pressed on keyboard, it is and
for display on monitor. The table 2.4 is read as 3-bits first i.e., MSB's
Case I. Drop MSB as it is l code is converted to standard language
then 4-bits ie., LSB's, such as DLE has code
MSB
L.SB 001000
Gray Code
10 1 1 0 10
Binary Number
TABLE 2.4
ARY
MSB's CODES AND CLASSIFICATION
Code (Extended
inary Coded Decimal 101
001 ( 010 (2) 011 (3
23.5.2 EBCDIC Interchange Code)
LSB's 000 100 14) 101 (5) codeand decimal
110 6) 11 It is an 8 bit .
digits are represented by 8421 BCD code. No
the EEBCDIC codes.. The format of an
ows the
shows parity bit is used in
EBCDIC codes.

0000 (0) NUL DLE SP Table 2.5 EBCDIC code EBCDIC code of
P from table 2.5 as shown belo Code have positions (01234567).
have bit (01234567). The
1De
r
ns is 00, 10,0000, elow.
0001 (1) SOH
DC A TABLE 2.5
0010 (2) STX DC2 B Bit
00
position 01 10 1
0011 (3) ETX DC C 0, 1

0i00 (4) EOT DC D Bit


00 01 10 11 00 01 10 11 00 01 1011 00 01 1 0 1
position
0101 (5) ENQ NAK E U 2,3
0110 (6) ACK SYN NUL DS SP &
F Bit
4,5,6,7
0111 (7) BEL ETB G W 0000
W

1000 (8) 3S CAN H h 0001 SOS J

1001 (9) HT EM 9 Y 0010 FS B K


2
0011 TM cI t c L T 3
1010 (A) LF SUB
M U 4
PF RES BYP PN D
1011 (B) VI ESC K
0100 dm
0101 T NL LF RS en NV5
1100 (C) FF FS L
0110 LC BS EOB UC W F O w
1101 (D) CR GS M
GP
0111 DL LPRE EOT| 8P
1110 (E) SQ RS N D
1000
H Y8
1111 (F) S US DEL R
Z
1001

Abbreviations 1010 CC SM
ACK Acknowledge FS Form Seperator
1011 $
BEL Bell GS Group Seperator
HT Horizontal ab 1100
BS Backspace
LF Line feed
CAN Cancel 1101
CR Carriage Return NAK Negative acknowledge
1110 +

DC -DC4 NUL Null


Direct Control
DEL Delete idle RS Record Seperator 1111 CUi CU2 CU3|11
DLE Data link escape SI Shift in Abbreviations
End of transmission PRE Prefix
EOT
DM End of Medium SO Shift out BS Backspace RES Restore
FS Field Seperator
ENQ Start of Heading BYP Bypass RS Reader top
Enquiry SOH HT Horizontal
EOT Start Text CC Cursor control M Set mode
End of transmission STX L Idle
CU1 Customer use SP Space
ESC Substitute Lowercase
Escape SUB CU2 Customer use LC
Linefeed TM Tape mark
ETB End of transmission block Synchronous idlle LF
SYN CU3 Customer use
New Line UC Uppercase
ETX End text DL Delete NL
US Unit sepereator Punch off
FF DS Digit select PF
Fom feed VT Vertical tab Punch on
EOB End of block PN
sylboIs
Meaning or
unraminlar

ODES ANDD CLASSIFICATI


Vertical bar: logical OR 6 Error Detecting And Correcting Codes 103
Logical NOOT
or may occur when the aigita information in
onal having O may Cnange toI or vice-versa.binary form is transmitted to
Hyphen or minus sign inary form transmitted from one circu
circuit to another. Due
noise

ror in the data.


data. Thus.
Thus, erTor
in the Extra bits are addedi to allow
allow the detection andd s o m e times
Underline (O1 10,1101 correction
or error
detecting and
correcting codes are used.
Example ofcode format:
nding data from sender (ransmitter) to
While sendin;
receivers, there
then we say that this particular data chances of data getting
are

01234567 Bit positions


data gets corrupted,

contains errors. Thus, corrup


data is referred to as eroIS.
reliable communication these errors must be detected and corrected. corrupted
11000110 is F
of Errors
Types
Code For Information Interchange) 2.3.6.1
2.3.5.3 ISCII Code (lndian Script EM (electro-magnetic) wave
tlOws from transmitter
anetism and some form ot electricity. Due to this the shapereceiver, it can undergo unpredictable
inteTTeren from
to
It is an 8-bit code whose lower 7-bits, 128 characters are same as ASCI code and other 128 char:
of the signal changes sometimes and we know nat uc
Indian Scripts based on the ancient Brahmi Scripts. Table 2.6is shown for ISCII code. The ISCIl codare for all hea, n is present in the shape of analog signal and hence the data
Kists witten information gets changed.
informat or

English language, make feasible to use Indian Seripts with English from table 2.6, 11000110 is F For example:
TABLE 2.6 Sine wavve:
10V-

Sin 0 30 5 60 0
Hex Dec 016|32 48 64 80 96 112 123 144| 160|176|192 |208 |224 2 Time
0 NUL DLE SP
P EXT
-10V-

Table 2.7
sOH DC A Fig. 2.2 Sine Wave
STX DC2 2B R From the table 2.7 we conclude that this shape is of sine wave as shown in fig. 2.2, hence we come to know about the
values at diferent points ie. at 0', 30, 45, 60, 90° etc. Similar examples for cosine wave can be considered.

s3ETXDca 3 cS s Now if this analog data is encoded into binary form, than a change in single bit can change the enture meaning or
information. Thus, the errors are categorised as
4EOT DC4S4 D T d
Erors
ENQ NAK s EU
66 ACK SYN | & 6 F Vf Single bit error Burst erTOr

2.3.6.1.1 Single Bit Error


7

BEL ETB 7 GW Here only 1 bit of given data unit (e.g. byte packet, word etc.) is changed from 1' to "0' or 0' to 'l'.
88 BS CAN H X For example : Let data at sender side be 10010001 as shown with data received

9 9 HT EM Y INV
A10 LF SUB Error
Data
B11 VTESC K ceived 1 1 1 0 o o
C 12 F FS a
These errors
occurs mostly in parallel transmission. For example If
at the same time and
using 8 wires to send all of the 8-bits
: we are o

byteWhereas in serial data transmission, the occurrence of these types of errors is very
that one of the wires is
imagine noisy,
therefore that bit will be corrupted in each byte.

D13 R GS M
For
rare.
example : Suppose a data is sent at 1 Mbps.
E 14 SO RS
This means that every bit lasts tor seconds or we can say 1 us. Therefore, for single bit error to occr
F15 S1US ? o DEL ATR 10.00,000
m u s t have a duration
of only 1 4s, which is very rare as noise normally lasts much longer.
104
2.3.6.1.2 Burst Error
Here two or more bits in the data unit changes from 0 to 1 or from 1 to 0.
For example: Data at sender 8Ide 18 as shown with received data in two exumplcs, one with : BINARY AND CLASsIFICATION
another with 6-bits burst error. one with S-bUH The most cominon.y Used mcthod for error d

burM crrs pariuy Dit. Parily bit can be 195


vord known
wor
as
" or"1 depente
ndngarity method. In this an bit is attached
extra to each code
ooo oo oo odd.
method is uscd totu make the
arlty method
Even parity
upon the number of 1's in the code make
to
evo them n or

Error are three l's in the codc, wnich will number of l's in the
coxde 'cven'. For
Therecode group includingtuthe parity bit willgive
aroup including odd number of l's.
So an cxtra '1' bit example,
1 to
is addedtne even.
1nub, the
make it even. Thus,
Received o
data
new
odd parlty methoa ueto nake
is
be 1011 100X).
number
This is called even
parity method.
u
hen the parity
bit is choKen as 0. So thatthe of l's in the code
'odd'. For example, if the code group is
bits 6 bits
the number of
1'a remains odd in
the new code.
J0
Length of burst orror is 5 bits Table 2.8 shows the BCD code (8421) with
Here length of burst parity bits
error is 6
In this fig. 2.3, thegenerating function generates some redundant bits which
is transmitted from the sender side over the link to receiver.
are
appended along with the bits
TABLE 2.8
data Even (E) Parity
Sender Recelver Odd (O) Parity
BCD (8421)
BCD (8421)
1010 1001 1001 1101 (Even Parity bit) P
Odd Parity blt)
0000
0000
Generating
ACcept 0001
0001 (O
0010
Function Checking
Function 0010
0011
0011
0100
Reject 0101
0100
1001 001 0110
0101
Redundant bits 0110
0111
0111
1000 1
1000
1001
100100110101001 1001101 0 1001
The parity bit can be attached either at the end or at the
Fig.2.3 Transmitting data from sender to recelver beginning of the code
design used. It is clear from the table that the number of l's are always even for group.
It depends on the type of system
Now the entire stream is passed through a checking function at the receiver side which decides whether the d always odd for odd parity. even and the number of l's
parity are

should be accepted or rejected. An error using parity bit can be detected for
single bit only but it cannot check for two errors at a time. Thus, only
2.362 Error Detecting Codes single error can be detected. To illustrate lets take an example
Data or entire bit stream is checked or detected by the following methods of error detection Let the code transmitted including the even
bit is parity given by
. VRC 2. LRC CRC 4. Checksum
0101
Error Detection
Even parity bit BCD code
Lets assume that the error is occured in LSB ie., (the last bit "1' becomes
'0') as shown
LRO VRC CRC Check Sum B i t error

Longitudinal Vertical Cyclic ,0100


Redundancy Redundancy Redundancy
Check Check Check
Even parity bit BCD code
3621 VRC (Vertical Redundancy Check) or Parity Checking method Thus, when this code is received at the receiver, the
parity check circuit finds a single '1' i.e., odd number of total l's
an
ee ie acual aim is to make even or odd
the redundant bit which is parity. In case of even parity. If the number of in the data are a
n
the code, whereas for even parity it should be even number of 1's. Thus, an eror is detected in the code at the receiver
nty.
to be
applied to every data unit should be zero, otherwise it should be one to end.
DIGTAL CIRCUITS& LOGICDESIGN
Two bit eor BINARY coDES AND CLASSIFICATION 107
discussng Jor pari, bu some systems 5 5
VK odd-parity. The priaciple
even
zere we are may use

Drawbacks of VRC
Even pariy b BCD code 23621.2
nunber
VRC method fals the beip of an erare
when
A e r end he a chek cituit fits o eTr becase te mumber of !'s are
fl's are appear
even
of bits are
changed This can be understood =ih

t be e e a i h i s s the
daauck of parity bit nethods. zppearer Een ir
as sbown in fig
puriy Thus e eror
Sender's deta Pamy r
uaer thingrve hee s i s ess that eos o r in aonsecuzive biss. The k D-DDD DDDDe
mesued f n he i s a p e i bt D e 2st carped mbee m g t be possbe t a some bits are
These aror os R y aT e a i Tasssaoa, as the d s i o n of noise is normaliy l n
lcege han te 3100
1000
236211 Camcept of Redndanc Recee -oe
Fan
One mettcd f r emr dnetice is a Evey daa sbruid bese c . o that the receiver can compae
t e d a nd y dhange i t wouid resuk m error eeeton. a t i s mehod is very time consu re
tie coS g
Rg. 2.5 VRC method fails in this example
S s onciacei t r e a d at endng zL e bts. scme sthorer TDY f bits should be applied at d
a Ts s caled s Redndang a e e m bes e d n i t to omation and these arr disceriedas The inportat poini 0 TOEE ere 5 tar eror occers2Ipositiozs ie. bt D 2ai iD- Tbe esar g s c g e d
so. t e wll da2 s corec bough i 3 2O
bet parity remains ac s
even. reever
e folowng data:
z2smisE s denerminei
Las p p o e =e wat o
an eac
11991009 VRC method can detect singie ba error. I can also dsea burs errors if the toazd xnba of errors n
data unt a odd.

uminer's and gpiies e psriy bir ( r I anis czse) io e a d Noa he otal mumber of 1's becomes evea
23622 LRC Longitndinal Redundancy Check)
Here instead ofsending a block of 32 bits. e make a tabie of for oms and eigt coiumns. So, the par
Receeer calculased for each colamm and bence a new row is created of eighs bits tich re the perity bits for i s whole block
Party r added to the wboie
Bock parity is the arrangemet of bits imo rOms and a redundent row of bits ie. pariry bits are

biock For example


7 Bit ASCI Code Evee Parit Bits
aT NTDE
S
Serez MSB LSB

F 24 a Addition of parity bit using parity generator.


Fr siaie f saz is 10120101, we hev

1011019 0-1010 G

0 1

Receiver
cecng me numb
f one s e q a io e e n
Cereraor acceps 2 s cored dza

Fi 2.4 b) For data 10110101.


1 1
112101 o 1101101
Even Parity Bits
The bit transmission sequence from the above block is given as

Fanty 10001000 10010011 10001110 10010011


I S erampie. party bir is 0, as the number of 1's are areany
10101001 10000010 10011001 10110100
ie 2.4 (c For data 11011011.
DIGITAL CIRCUTS& L0GIC DESIGN
# e ngee i a e e wils betasike d kngtedinal party eheck in ene BIMAYCRs AND CAAsAFKKIVm
mdhid alsa Jla hER ETE nLnI in
ueh a
wny, thud the parity sah wn renains E

99

1993193

Receved d a

kantangs.
9991191

1 3119 111i 11911 19101519

14111149 99119
dea 1o be corect, sttwwh the ds vnaisaerr
1991 199
19191919 2362.3 CRC Cydhe Redundaney Chek)
CRCis basd n biary divissn, wdiks VR ard 1 E whh ase besed n itarn Here a seqnz d sehatda
99191919 bits called CKCIEnAder is appied 1o the ed d daa unit o that tie tesuitng detz isnes de vissti vy a preeterm

Paray sock seaed tr eah reportive sow binary nunber. On the receiver side, the data is divided by e sane nuzet aus it te remaiuór t m e s r , t a dda
isaseumed to be coret ad is aeped
w, tas sedundatt biok d ists it akied o the whle tick and is sent to the eoeiverin the forsal ss sónws Sremainder ther than e o Cmes, then it is asned thal data has t u snruprd n tbetwe

s0191399 o9101910 2.36.2.31 eps tw tollow for CRC


11i1 1100110 10191019
1. Asiring ofn number of zero's sbould be applied to the data. This number n stould be one less thas the predeternaned
Parity beock di'visor which is taken as n +1 bits,
Fls l e l r k is seat so 2. The total data is now divided by the divison. The remainde obaised is CRE.
te secciverad suppose the data seceived a the receiver side is given by:
Division here is a modulo-2 division. Also for hat we have to take XOR function of two variables.
1911 9J001199 10191910
afior saicaiaing tie
pariey, we have Truth table of XORfunctionis given as
011191 A BXOR
Sane value of bits produces binary vero.
19119099 Altermate value produces binary one
91991i00
10101010
1he reeived datu beoEs:
11101191 3. On the receiver side, the remainder obuained or
CRCa the small side is applied to the data instead of zero.
Note: CRC may also be of all zeros.
10119 19110000 910110 10101010 11101101 4. Now, thetotaldata at thereceiverside is again divided by the same divisor which was used to find the CRC remainder
eror biis Parity block
DIGTAL CIRCUITS & LOGIC DESIGN
110 5. ii now, the remaindet cenes ut to be z2eto, then the data is asaed to te cusrect, otherwie

block diagram as shown in fig. 2.6


A BINARY CcODES AND CLASSIFICATION 111
These eps can be explaised with the heip f a

Selection of a Divisor for CRC


2.3.6.2.3.2
Divisor should be an algebraic polynomial rather than continuous zero's or one's,

Deta00
Drso Dta Cac For example:
lf a polynomial is seiected such as

ntets

CRC Remainder o'10110iii ot X


powers
The zero's are marked for missing
divisor should be selected such as the powers
Now the
zero* orect are missing
should be treated as binary 0 i.e. , and
Non zero * of x which
reject 1.
and rest as binary
of polynomial selection are given by
The properties
Sender Receiver not be divisible by x.
1. It should
Flg. 2.6 Blockdiegram of sender-receiver for CRC llastration. 2. It should
be divisible by x + 1.
Check if there are any errors in this,
if the divisor is
10101.

have EXAMPLE 21 The data received s 1100 1001 o1011.


For example At sender side, we

sOLUTION
divisor- 101)t0GI 0 bitsof zero'sadded to the 111110001
10101)1 100100101011
data Note that divisor is a+1.
1101 10101
110000
101 10101
11010

10101
11111
10101
10101
10101
When Left most bit -0 0 0 00 00000-Remainder

then divide it by 0000 in the data received.


meant there are no errors
remainder is zero, it
rather than by originai As
divisor
00 -CRC Remainder 2.3.6.2.4 Checksum of redundancy.
also based on the concept
This method is used for higher
layer protocols and is
each of n-bits. complement and
unit into K section arithmetic. The s u m is
At receiver side, we have The sender divides the
I101)1 o01 0 0001 Data Received CRC. added. Then sum is obtained using 1's complement
Then all the sections are with data.
checksum is also sent along
1101 borrows checksum. Now the
which has been divided into K sections
each of n-bits. All
sections are added together

data is accepted,
otherwise it is
the unit result is zero,
The receiver receives is also complemented.
If the
arithmetic and the sum
one's complement
using
010 rejected.
101 Suppose data is
1010 1010 0011 0011

1101 Now, we have


10101010

00 0 0 +001 10011

110
11011101
Sim
00100010

000 Checksum

Remainder zero means


112 Now suppose receiver receives the patern
BINARYCODES AND
1010 1010 0011 0011 0010 0010
the format M3, Ms. Mg and
M7 Tepresents the CLASSIFICATION
Similarly, for 15 bit Hamming code the format is message or
data bits. 13
Now receiver add these sections together, it will get all Is, whch after complement is all 0's and h
eTo
10101010 Ms M4 Mi3| Mi2 M1 M1o M, P, MMsMs P M P2P
+00110011 Here, the message bItS are "1l in number.

00100010 2211+k+1
ie., 2 2 12 ++k
The minimum value of k is given by

Compkement 00000000
24212+4
Hence, there is no eToT i.e. 16 16
k = 4

23.6.3 Eror Correcting Codes Thus, the parity bits are 4 ' in number.

There are two ways to handie eror correction Their positions are given by

1. The receiver should retransnit the entire data. For P2"=1 ie. 1st Position.
ForP 2 2 ' = 2 ie. 2nd position.
2 For single bit enror, the receiver simply reverses the value of the corrupted bit.
An error comccting code is a binary code which will detect andcorrectsingle bit error occured during tanon: For P424 =4 ie, 4th position.
Thas, these are the codes which not only detect the error but also corect it. Example is Hamming code. ISmiSsKn For Pg2" 8 ie. 8h position.
=

2.3.6.3.1 Hamming code Bit numbers- 15 14 13|12 1 10987 6 432


Hamming Code is the most useful code for the detection and correction of errors. It is a linear block code in
pariry bits are inserted between the data bits.
whid Allocated for-
Mis M4M13 M12 Mu Mio M Ps M Mg Ms P Ms P2P
For generation of Hamming code having 'n'-bit of information and 'k' number of parity bits are added to form a c In the format M3. Ms, Mg, M7, Mg, M10, M11. M12, M13, M14. M15 represents the message or data bits.
of (n k) bits. Decimal value is assigned for each location of (n + k) bits within the code word. The MSB (ie, ms 2.3.6.3.2 Hamming Code Calculations
significant bit) is assigned the decimal value 1, similarly, the bits after MSB are assigned values 2, 3, 4.. on
Following points are useful to cTeate the code word for Hamming code
(+k) which is the last value assigned to LSB (i.e., least significant bit). The value of parity bit ie., k must be satistya
2 n +k++1. (a) Parity bitsare placed at each 2 bitposition. where m=0, 1,2,3. 1.So, for m =
0, 1. 2, 3 . h e positions
For 7-bit Hamming code the format of code words is as shown: of parity bits 2 =1,2 2, 24 4, 2 =8,.
are = =
. positions 1, 2, 4, 8, 16..
6) Message bits ordatabits are the bit positions other than the parity bit positions ie. positions 3,. 5, 6,7,9, 10..

C)The code word consisting of parity bits is used for the calculation of the sequency of bits that alternate check
M,M,M,P.M, B bits and skip bits.
For 1st position i.e. for
are

Here, P, P2 and P4 are the parity bits placed at 2m bit position, where m = 0, 1, 2, 3 -1. ( P
sucha way tht
For example, if the bit word to be transmitted is 4-bits wide. Then the value of k must be chosen in Skip Skip Skip Skip
1 bit bit l bit I bit
must satisfy as

2 2n+k+1
s
7 6 4 32
Check Check Check Check
Thus, for n =4 (* bit word is 4-bits wide in example) bit 1 bit Tbit 1 bit

we get, 2h2 4+k+1 Thus, for P considerbits 1, 3,5,7,9, 11, 13, 15,.. *******

(i) For 2nd position i.e., for P2


i.e., 2 5+k
From above the minimum value of k to be satisfied is 3 (i.e., 2325+3 or 8 = 8). Skip Skip
2 bits 2 bits
Hence, number of parity bits 'k = 3. Thus, w

Also, the parity bits P1, P2 and P4 are placed at 20, 2! and 22 i.e., at 1st, 2nd and 4th positions respectveiy
get the code format:
Check Check Check
2 bits 2 bits 2 bits
Bit numbers 6 Thus, for P consider bits 2, 3, 6, 7, 10, 11, 14, 15,..**
Allocated for- M| Ms Ms Pa MsPzP
DIGITAL CIRCUITS & LOGIC DESIGN BINARY cODES AND CLASSIFICATIONI 115
114 For 4th position ie, for P4 that the Dit at n posiaon is in we get unc
(ii) It is clear error. So, change the 4th bit i.e., complement it,
Skip 4 bits
Skip 4 bits Bit Positions

Received Code-
Check 4 bits Check 4 bits
Correct Code
consider bits 4, 5, 6, 7, 12, 13, 14, 15, 20, 21, 22, 23,...
Thus, for P
check bits and skip bits 1or positions 8, 16, 32.and so on
Similarly, there are altermate EXAMPLE 2.3 Assume data 1001101 as number of message bits or data bits without parity bits. Check
in the positions after checking comes odd, then set
(d) For even parity, the total number of l's
if et the parity bit error if any
the correct code.
and tind

otherwise set the parity bit to


*0'. : Data = 1001101
SOLUTION
total number of l's in the positions after checking comes even, then s e t
(e) For odd parity. if the
a

parityb Here n 7 as number


of data bits
otherwise set it to "0D',
Now to calculate K,
EXAMPLE 2.2 7-bt Hammngcode 0010001 ls recelved. Assume that even parity has been
code.
been used. Ched 2K 2n + K+ 1
error if any and find the corTect
Put K=3
SOLUTION: The received code is
2327+3+1 8211 which is not possible.
Bit Positions 2 So put K=4

Bits 2"27+4 +1 162 12 which is true.


Now, we have to add 4 parity or redundant bits.
Parity P The position for 4 parity bits are
First parity check iLe. Pj. 1,2, 4 and 8.
P checks the bit positions 1, 3, 5, 7. means P position 1 (20)
at
P2 at position 2 (21)
Bit positions
Pa at position 4 (22)
Bits Number of 1's are even. P4 at position 8 (23)
Thus, the purity bit P shows no error. So data becomes
Hence, the LSB C = '0°. 11 10 98 7 6 5 43 2 1
Second parity check ie., P2
P2 checks the bit positions 2, 3, 6, 7. To calculate
P1: Take one leave one.
Bit Powitions
The actual aim is to make even parity.
Bits There is no l's in the bits present. (ie, evnge =Take position numbers 1, 3, 5, 7,9 and 11
Thus, the parity bit P2 shows no emor.
Hence, the position C2= "0.
P-O10
Value of should be I to make it even parity.
P
Thirdparity check i.e., P P2: Take two leave two.
P checks the bit positions 4,5,6, 7. Starting from position 2.
Bit Positions Take position numbers 2,3,6,7, 10 and 11

Bits oo There are odd number of 1's. Thas,bep P21110


P2 should be 0 to make it even parity
bit P4 shows error.
Hence, the MSB C = '"T
The position of error bit is given by Pa: Take four leave four
C3 C2 C Starting from position 4.
(MSB) (LSB) Take position numbers 4, 5,6, 7
Thus, the error position code is
CCC 100=Decimal 4 [: (100)2 =(4)1ol
DIGITAL CIRCUITS &LOGIC DESIGN
116
PTake eight leave eight.
BINARYCODE AND CLASAIFICKTION 2
Starting from position
8. 28g-3 code:These arc the codes in which binary of decimal 3 is added in a
given simple binary nu
117
position numbers 8, 9, 10 and 11 COde : It iscodes.
a
unit distance code that differ in two adjacent numbers by one bit posiuon
Take
called as cyclic o
P 0 01 ming code : It is a linear block code in which parity bits are inserted data bits. It is usea tor
and correctuon
of erors. between d
Non-weighted codes: These are not assigned with any weight to each digit position thus, called as
non-welg
codes.
Numeric codes: Numeric coues are used for representation of numbers.
Putting values of Pi, P2» Pa and P4 in egn. (1), transmitting data becomes
11 109 8 7 Weighted codes: These codies have specific weights for each digit position
de for 27, 2 has weignt or 10 and 7 has weight of 1. For BCD or 8421
of the number. For example: decna
code each digit has a weight of 8,4, 2 and
code

Now, suppose -Error bit REVIEW EXERCSE


data received is
EK1Obtain (597)10 in BCD
Solution: 5> O101
9 1001
Here the error is in 8th bit 70111
Now again calculate values of P, P2 Pa and P4 from the received data. (597)10 (0101 1001 0111)BCD
For P: Take one leave one B2 Convert (11011), to excess-3 code
Solutlon: (11011)2 to Excess-3 code, we have
P-11O101 11011 Given number
=0 011 Add 3 i.e. (011)%
For P2: Take two leave two. 11110
Pa-11101 (11011)> = (11110)excess-3
P=0 E3Represent the decimal numbers (a) 27, 6) 396 and (c) 4096 in binary form () ASCI code,(i) Gray
4 leave 4.
code and (ii) Excess 3 code. (PUT, ECE, Dec. 2008, May 2008)
For Pa: Take
Solution: (a) (27)10 (27)10= (11011)2
P 0011
P3=0
For P: Take 8 leave 8. 61
P=0001
P41 () ASCII code
Now the binary sequence can be written as :
(27)10 (11011)%
2 Pi (27)10= 00100111 in BCD
0 Thus ASCII Code is given by
which is binary number and its decimal equivalent is 8. 0110010 0110111
Hence it states that the error is in bit 8 and it can be corected by simply reversing the value. () Gray Code
(11011)2 = (10110)Gray Code
GLOSSARY (ii) Excess 3 Code
(27)10
Alphanwmneric codes : These are the digital codes which consists of both numbers and alphabetic characte
ric
ASCIH code : It is known as American Standard Code for Information Interchange. It is a 7-bit alpnana
used by most computer manufacturers. 10
arate group
BCD:BCD is a binary coded decimal code in which each digit
of four binary bits.
of decimal number is represented by sep
a

0101 1010
Code: It is a representation
ofa
number or character in a unique way.
Excess 3 code
DIGITAL CIRCUTS & LOGIC DESIGN
BINARY CODES AND CLASsIFICATION j
LSE code > (4096) 10
ASCII
) 1001 0110- BCD
0100 0000
0110100 0110000 01i101 0110110 ASCI code

( ) Gray Code

(1 10 0 0 0 00 0 0
DGay Code
3 Code
Excess
(
(4096)10
3
MSB 2
(396)0= (1100011002
ASCHCode
(396) 1i000i100) 0111 0011 1100 1001 Excess 3 code

96)0= (0011 1001 OI10)BCD


E x p l a i n Error Detection Codes ?
bits called datawords. 'R' redundanat
011001 011i001 0110110 > ASCH code Solution : In case
of block
coding message is divided into blocks, each of K'are called code words. If the following
make =k+ R The resulting n-bit blocks
hits are added
to each block
to the length n
detecta change in the original codeword
the
(Gray Code coeditions are met, receiver can
valid codewords.
(1) The receiver has a list of
codeword has changed to an invalid code.
(1010 0 10I Oray Code (2) The original and procedures of
creates codewords out of datawords thai applies the rules
A generator used by the sender to
is
the valid code,
during transmission. If the received codeword is the same as that of
(ii) Excess 3 Code encoding. Each codeword may change
otherwise it is detected
it is accepted, detected
(396)10 This type of coding is used to detect only single
error. Two or more errors may remain undetected.
An error

3 those errors for which it is designed, other types of errors may remain
undetected.
code can only detect
12 Structure of encoder and decoder in e r r o r detection

0110 i100 1001 Excess 3 code


ENCODER DECODERR
(c) (4096)10 2 4096|
Dataword
2 2048 0 LSB Dataword
k-Bits k-Bits
2 1024 0
Extract
2 512 0
2 2560 Checker Discard
Generator
128
2

2 32 0 Codeword
Codeword Unreliable of
0 Transmission Bits
2 n-Bits

RECEVER
SENDER

MSB-
(4096)10 (1000000000000)2
DIGITAL CIRCUITS & LOGIC DESIGN
Círcuits.
and Hold
short note
on Sample BINARY cODES AND
CLASSIFICATION
120 I Ex.
Write a
and Hold circuits
are used to sample an analog signal at a particular
nstant ot
lirne verture t i m e Type of switeh
121
Solution : Sample andh
required Relay
sample as long
as
value of the control sígnal and the ho
Sampling instants
in
and Hold duration are
the circuit is being
which
Used.
determined by a logic d
interval depervda tm, In ma

50-100ns
FET
P'ast diode switche
application hold sample voltage. ns
CAPACITOR w
utilize a
These circuits the capacitor Acauisition time : t is
he shorlest tine after SAMPI. narnel has theen given tiat }1
a
a means 1or rapidly charging
a
controlled switch which provides (2) esult in cutput vollage vwhich approximaten
an
Itis an electronically can retain the desired voltage
the input voltage with cenary
Auta7
so that the capacitor
input sele
and then removing
the
circuit is shown with VA the analog
source and
R. the internal impedancr De3)
3) Settling time a »pecifiea epercentage
aal value, within onthe opening of the switch (0O.D) t the peoint when the tnutput has
scale.
A sample and Hold
Rate : This represent ire an"
Sample and Hold Circuit (4) Output Decay en the voltagc change acrs the capacitn during the HOLI
Switch controlled by Ve w
eruely proportional
capacitance s i n e dv,/dt m 1/¬:
the capacitor lcakage current.
where I is
It may arise
Bias current in an op-anp ) EAkage current through switch (e) Internal leakage in the capaciur.
VA
C. Vo (a)
Practical Circuit

der to achieve a low driving Circuit impedance and a high load impedance acros the holding circut, a pracuea
In o
Hold eircuits
are used.
sample and Circult with switch
Inverting Sample-Hold
also as shown. is as shown. It operatcs as follows
dealized waveforms are
Tts circuit
Voltage held is closed (SAMPIE), the circuit acts as a conventional op-amp RC filter. When switch (S) is openea,
When switch S
WIill h e l d on the capacitor.
Error the voltage Va
Circuit with switch is as shown
Inverting sample hold
R
Aperture
time
Sarmple
A
Sample

Hold

Aperture time und its effect


Point at which
Vo VH to
specifiedd
Accuracy op-amp

Acquisition
time Inverting Sample-Hold Circuit with FET's
Sample FET as a switch is shown in figure

Hold VA D
E the assumption RCS
Explanation: The switch is closed while the control logic waveform Vc is high and on
the output voltage will vary closely follow the input voltage and will be equal to it at the
instant that the controlng* Hold
sal,
goes low, opening the switch.
During the Hold interval, while the control signal is low, the switch is open and capacitor 'C' will hold the las HE b
vaiue.
Sample
Various Specifications
nd the i op-amp
(1) Aperture time : It is the maximum delay between the time that control logic tells the switch to open an
that it actually does. It determines the type of switch to be used.
LOGIC DESIGN
DIGTAL CIRCUTS & În this type of transistor.Creatiflows whn
wich sapchennel depiedon
FET.
m o r e negative. In this cin ut
BINARY cODES AND CLASSIFICATION
FETswach T. souroe o gaae voitage becomes the FET numbers in Excess-3 Code. (PTU. E C E ,
Dec. 2005)
es es a s the
eaarged
ot the nPut is changed
a s i n e poiangy opezu Add the following

soue
n d drain
T
(PTU,
and disadvantages ? (PTU, CSE, Dec.
De
2009, Mar
108 + 789
s
interz s
? Hhat a r e its advantages
FEL
W a t is a
BCD a d e
coaed dacinal
co e tor the rpresentation tal of igi (275+ 496
code
s e Dnay excess-a

Saluticn: BCD Code: BCD Solution: Add in


BCD code is given a s 108+ 789
decml umber t h a s
F72 is e
Fer e s p k : 2 7 5 + 496
convert (i08)10 and (789)1o excess-3 forn.
to we ge
Firstly 0001 0000 1000 0111 1000 1001
0011
(78910
(108)10 0011
0011 0011 0 0011
(01i1 0010)scD
O100 0011 1011 1010 1011 1100
0100 0011 1011
9 is required.
thes he binary equivalent of 0 Adding
to
mbe
L m e ese of oniyOw9 dec 4-bt binary equivalent.
1010 1011 1100
he d e c i a l amber system bt has 1110 1111 0111
2 s
Disaatges B C D cade subtract 0011
Dunber for representation in decimal L e c = U . then
bits then sipe binary If there is
no cany

L BCD e neeis m e m e of binary c o S LE. C = 1 . then add


0011. we get
= (00pCD
Ifthere is cary 1111 0111
Fer es e: Z = ( i 0of BCD make nse of difereat rues.
1110
sbeaction
2 A i e md
code ? Give eample.
PTU, ECE, May 2 - 0011-011
i t
7 youm yweghted
do s u m method ie., which obey the pi 1011 1 1010 89T10
a r e hose codes mtäch make s e ofweighted
SelstsomWeghand codes t e zunber has a specific weight
of
wegr in weighsed
ades each position 275)1o +(496)10
posiici into Excess-3 form, we have
nghed cades a Firsly coverting
0010 0111 0101
L Binary codes
0011 0011 0011
2421. 4221. 5311. 7421. 842+ esc.
(275)10
2 BCD codes Farezae:421. BCD and as a binary number.
PTU, ECE, Dec. 2
0101 1010
1000
decimal smmber 8629 in
I Rrsent e 0100 1001 0110
0011 0011 0011
(496)10 1001
0111 1100
8620 (8620)1o= Addition of (275) 10 + (496)10 is as shown
0101 1010 1000
R
0111 1100 1001
(0010 0001 1010 1100)
0001
1101 0111
MSD there is no carry i.e. c =
0, then subtract U0i
B62 = (1000 0110 0010 0000BCD
And if there is carry ie. c= 1, hen add 0011 to sum
= (1000011O101100 Dec. 2
(PTU, ECE, 1101 0111 0001
i Whre do me s e ASca, Esces-3 and Gray codes?
is a 7 bit code. In binary
language - 0011 + 0011 +0011
SolesiASCH:American mdrd code for information interchange
these two symbois between two comp
0100
i n 16 ptere enugh to commanicate using only 1mS a *
avalaie

1010 1010
a d semai. Numbers 0 to 9, punctuuation marks and many other symbols.
aASCH ade (1010 1010 0100)Exces-3 or (771)10
saa

basically produces
wrd wich grdesnainly
sth
sed in shaft position encoders. A position encoder
ngsia posiioe of the shaft
BINARY CODES AND CLASSIFICATION
DIGITAL CIRCUITS & LOGIC DESIGN do you
you mean by G
mean Gray code ? Convert the following numbers
125
Gray coae
following
numbers in BCD
PTU, ECE, May E13
What
6) (286)10
to

124 E Add the (a) (1101010)2

Code: code num


Gray code
396+ 273.7 Solution:Gray
Code:Gray numbers are the numbers which are different from preceding and su
ie.
code numbers are the numbers with Hamming distance equal to one. lt 15 2
Gray an unweighted code.
205.7+ 193.65 single
bit,
any number of bits or lengths as in case
273.7 y
a have of binary number system.
89.6 +
Solatioa : ) G r y d e is cyclic code and this coae 15 also known as reflected binary code.
1001 0110
1000
0010 0111 0011 O111 (a) (1101010)2

0010 111 I100 101


invalid Invalid Invalid
Vaid
BCD BCD BCD (1 01 1 11 DGray Code
BCD
invalid BCD numbers, we have (Discard Carry)
only the
Add (01 i0 to
1100 1101
0010 2 286|
0i10 0110
0000 0110 2 143 0 LSB
()(286)10 2 71 1
I
0011, 1001 2 35 1
L0110
3 2 17 1
3 6

(363.3eCD
2 0 5 . 7 + 193.65
2 40
0010 0000 0101 0111 0000 2 2 0
0011. 0110 0101
+ 0001 1001
MSB-
1000 1101
Invalid Valid (286)10=(1000111102

Valid Valid Valid code is


BCD BCD Its equivalent gray
BCD BCD BCD
have
invalid BCD numbers,
we
Add (0i10% to only 0101
1000 1101
0011 1001
0000. 0110 0000 (1 10 01 000 1Gay Code
+ 0000 0000
(Discard Carry)

1001 1001 0011 0101 4 W r i t e Code in ASCII for


C011 BIRTH
9 Solution: B-100 0010 E
(399 35)aCD Convert the binary
number 1010 -100 10011
is the importance and
applications of Gray code ? (PTU, ECE, May
2
R-101 0010 E
R what T-101 0100
E Gray code. bit will change each
time
W
special feature as only
one
is that it has a
very H-100 1000
mportance of gray codeDue to this reason it is also
known as uit distance code
Eal unber is incremented by *1'. 5 Write Code in ASCII for
Applicationsof Gray Code: FLOWER
1. These are used in the shaft position encoders. Solution: F-1000110
coue. L-10011000
Ibese
are used in the optical discs to produce an appropriate binary
o-1001111
(10100111h=(oay cod W-1010111
E-1000101
R-1010010

(i 1 110 1
0 0Gray Code
LOGIC DESIGN 127
DIGITAL CIRCUITS & BINARY CoDES AND CLASSIFICATION

ofbinary (1001), (1 101)


examples. 2010)
with is code CSE, Dec.
BCD code ofa decimal number
is ne code (PTU,
Gray
R
16Eplain
:
lf each digital four h S binary 87 in BCD code.

requiredequve
Decimal
Coded
digit c a n be as long a s aa four bits are Write
decimal

resultis
Soluion:

a
Binary

coded called
binary-coded
decimal.
Since a decimal

lo FEx 19
Solution: (87)10 = (?)BCD
such as 678 (decimal).
decimal numbers
digit. take a
the BCD code,
To illustrate
(1000 0111)BCD PTU, CSE,
Dec. 2010)

of ASCI and where do we use it ?


1000 (BCD) 20What is the full form the keyboard of
computers
l
0110 0111
representation
P Standard Code for Information Interchange. It is used in

let us change 951 to its


BCD-Code
Solution:
ASCI: American
Take another example, symbols etc.
Decimal) different
alphabets,

OBJECTIVE TYPE
0101 0001 (BCD)
1001 D O O O
Q U E S T I O N S

are
For illustration more examples
1001 (BCD) to its decimal equivalent.
Convert 0111 1000 0011 is
( in a self-complementing
code
- 9
s u m of weights

0111 1000 1001 1. The


(b) 10
(c) 12
9 10 (a) 9
8 01101 is
code for binary number i1000
to its equivalent decimal 2. The Gray (c) 0 101
0111 1100 0001 (BCD)
(b) 01011
Convert (a) 11001
(i)
225 in BCD code is given by 11101 1011011
011 100 011 0O01 3. Number
(b) 001000100101
c ) 000100100101

8 9 10 (a) 111011011010
( 10-bt code
code is a
c ) 7-bit code
BCD addition. 4. ASCII
Ex. 17Solve the following using ()9-bitcode
(6) 6-bit code

(a) (54)10 + (263)10 6) 45)10+ (36)10 (b) self-compiementing code


code is a
5. The XS-3
Solution: (a) (54)10 + (263)10 (a) error-correcting code above
0100 ()none of the
0101 ()cyclic code
0010
0011 6. EBCDIC and ASCII codes
are

codes (c) Aiphanameric


codes ( Gray codes

0111 codes (b) BCD


0111 (a) Error correcting
not a
7. BCD codes is b) 8421 code
= (77)10 coded decimai
code
(a) KS-3 code Binary
) (45)10 + (36)10 (c) Gray code
code is (Cyclic code
0100 0101 unit distance (c) Sequential code
8. The other n a m e of b) BCD code
0011 0110
(a) Self-complementing
code is d None of these
1011 Invalid BCDD distance of ASCI
Valid BCD 011 9. The minimum
6) 1
(c)3
BCD Add '6' ie.,
0110)
(a) 2
Add 0110 (To get the valid (d) Gray code
10. 8421 code is c)Weighted code
b)Alpha-numeric code
1000 0001 (a) non-weighted code
detection code must be
1 for 2-bit e r r o r (d) 4
8 T h e minimum
distance (e) 3
N = (81)10 (PTU, CSE, May b) 2
(a) 1 4-bit code is
B18 Convert binary number 1001 into gray. of a straight binary
12. The minimum distance (c) 2
Solution: (1001)2= 3
code (?)aray (a) 0 in 1-bit poasition is
dBCD code
characters differ only (c) Gray code
The code in whlch
3 (b) 8421 code
(a) XS-3 code

Gray Code
DIGITAL GRC OGIC DESIGN
the word kength of Hanming code is
14. To represent deeianat digiks
c) 7
i d

3
is not a setf cemplenenting code ?
.Which of the koklowing
fa) Ciray cod b) Eycic cede ic) Hahning code
d All the abse Output

ANSWERS
.t
12 13 tc
4.(e)
14. fe
.
15 d
9. NOT
ANELOGIC GATES
sUPPLEMENTARY PROBLEMS AND BOOLEAN ALGEBRA
.What is & seif-compiementary code
7
Explais briefly?
cod*. 3 . 0 INTRODUCTION
2. Wrs the steps nvoived is ceatsng a Harmening electronic circuit makes the logical decisions. Most common logic gates
which
used are AND, OR,
15 an

3. Write the procedure fox the comversion of the folaowing A logic gate
universal gates.
ti#y Gray code o binary coxde NOT. NAND, NOR, XOR. XNOR
gates. NAND and NOR gates are called certain input combinatuons
in Binary code to (iray code is High only for
have one or more inputs and only one output. The output
Logic gates are or
boolean variables. Boolean
functions
between even parity and oxdi parity expressions having
4. Esplaun the difference Boolean algebra
contains boolean function which are

?Convert ti0011011h to Gray code


5. what is the atvantage of using Giray-coie three types
boolean function
C i t v e he ASCIHcode for the foikowing ) Completely specified taken.
boolean variables are
having independent
combination
tb)D In this each
checksura. specified booean function
detected using biek parity arad (i) Incompletely
7. Explain how errors are boolean function is not
weli defined ie. don't care.

coie word tested and corected. In this output of


?
How is the Hamning
. What is Hamming code Minimal boolean
function
cxkes (il) (i.e. minterms or maxterms).
error detection and correcticm
minimum terms are present
9. Expiain In this boolean function

0. Write short notes os. (d Cycc code


GATES
I3.1 CLASSIFICATION OFLOGIC
(c) VRC
tb LRC
(u) CRC
axiditions in Escess-3 coe classified as
4. NAND
the folkowing decimal Logic gates
are

I. Perform eah of tc) (24)yo+ (613)jo 2. OR


3. NOT
t21 10 + (3)10
(a)(9 (2o (h AND
6. XOR
7 XNOR
distance conde brefiy. 5. NOR
2. EapBain unst

3. Differentiate between and Gray codes


tb} Excess-3 Logic Gates
non-weighted cades
(a) Weightesd and
and BCD ckkes
(ch Alphanumeric
codes
.Write spplications of ray BCD codes
Special Purpose Gates
decimal additions using Universal Gates
5. Porforn thhe foilowing c)(236)o +(512)jo Basic Gates
b)lo+(39)10
a) 57) (0}10
using 8421 coes.
(i84 (25)jofrom
. Subtract Ciray. BCD and
Excess-3 codes
XOR XNOR
Give differeae between Binary. NOR
7. NOT NAND
&. Wrste he atvantagesof Gray
codes
?
codes
Expiain with the help ot one
example. AND OR NOR are the
universal gates.
XOR and XNOR are the

whal aie reflective basic gates.


NAND and

0. Geve ciassilicatan od dinary codes. and NOT


are the three
OR
numbers to its equivaient Gray
code AND,
. Conver gives binary special purpose gates. 129
a) (10110 (b) (1011ot)
22. Adi the folkowing using BCD aidition ()(73.28)j0and (31.46)10

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy