SlideShare a Scribd company logo
1 of 17
Codes
By
Md. Fazle Rabbi
16CSE057
4.2
Codes
➔ Encoding is required for sending information over long
distances unambiguously
➔ Information needs to be decoded at the receiving end
to get back the original information
“Coding is the process of altering the characteristics of
information to make it more suitable for intended
application”
4.3
Codes
➔ Need to use coding of information for a variety of reasons
◆ Increase efficiency of transmission
◆ Make data error free
◆ Enable receiver to correct information if error occurred
◆ Inform the sender if error occurred in the received
information
◆ Limit the accessibility of information
◆ Standardize a universal code
4.4
Binary coding
➔ Use binary digits (0, 1) to code the elements of an
information set
➔ For example, suppose n is the number of bits in the
word to be coded and x is the number of uniquely
coded words
◆ if n = 1, then x = 2 (0, 1)
◆ if n = 2, then x = 4 (00, 01, 10, 11)
◆ if n = 3, then x = 8 (000, 001, 010, … , 111)
➔ So, if n = j then x = 2j and
◆ n = log2 x = 3.32 log10 x
4.5
Binary coding
➔ There are ten different symbols in the decimal number system
0, 1, 2, .. , 9
➔ We need at least four bits to represent them in binary form
8 -> 1 0 0 0
9 -> 1 0 0 1
➔ With 4 bit groups, we can have 16 four bit groups. As there are 10
digits in decimal notation, number of possible codes,
(16 C 10) x (10!)
➔ Most of these codes will not have any special properties that
would be useful in hardware design
4.6
Properties Of Codes
➔ Some of the desirable properties of codes
◆ Ease of coding
◆ Ease in arithmetic operations
◆ Minimum use of hardware
◆ Error detection property
◆ Ability to prevent wrong output during transitions
4.7
Properties Of Codes
Some of the most commonly used codes
1) Binary Coded Decimal Codes (BCD Codes)
2) Unit Distance Codes
3) Error Detection Codes
4) Alphanumeric Codes
4.8
Binary Coded Decimal Codes
➔ In a BCD/ Weighted Code, decimal value of a code is the algebraic sum of the
weights of 1’s appearing in the number
➔ More popularly used codes have the weights as,
w3 w2 w1 w0
8 4 2 1
2 4 2 1
8 4 -2 -1
4.9
Binary Coded Decimal Code (BCD Code)
➔ Two desirable properties
◆ Self-complementing Codes: Complement of a code number is also
its arithmetic complement
● Example: 2421 code of (4)10 is 0110
Complement of 0110 => 1001 => (5)10 = (9 - 4)10
◆ Reflective Codes: 9’s complement of the code word can be achieved
by taking the reflected BCD code
● Example:
Excess-3 is a reflective code
0 -> 0 0 1 1 -> 1 1 0 0 (complement) -> 9 (which is 9’s
complement of 0)
5 -> 1 0 0 0 -> 0 1 1 1 (complement) -> 4 (which is 9’s
complement of 5)
4.10
Binary Coded Decimal Code (BCD Code)
➔ Only 10 combinations are
utilized
➔ Remaining 6 combinations
are illegal
➔ They may be utilized for
error detection
4.11
The Excess-3 code is also called as XS-3 code.
It is non-weighted code used to express decimal
numbers.
The Excess-3 code words are derived from the
8421 BCD code words adding (0011)2 or (3)10 to
each code word in 8421.
Excess-3 code
4.12
Excess-3 code
4.13
It is the non-weighted code and it is not arithmetic
codes.
That means there are no specific weights assigned to
the bit position.
The gray code is called as a unit distance code.
The gray code is a cyclic code.
Gray code cannot be used for arithmetic operation.
Gray Code
4.14
Binary Code & Gray Code Conversion
4.15
Binary Code & Gray Code Conversion
4.16
Gray Code
4.17
Thank you

More Related Content

What's hot (20)

The BCD to excess-3 converter
The BCD to excess-3 converterThe BCD to excess-3 converter
The BCD to excess-3 converter
 
Codes
CodesCodes
Codes
 
Binary codes
Binary codesBinary codes
Binary codes
 
Fixed point and floating-point numbers
Fixed point and  floating-point numbersFixed point and  floating-point numbers
Fixed point and floating-point numbers
 
Decoders
DecodersDecoders
Decoders
 
Combinational circuits
Combinational circuitsCombinational circuits
Combinational circuits
 
Binary codes
Binary codesBinary codes
Binary codes
 
Codes
CodesCodes
Codes
 
Code conversion
Code conversionCode conversion
Code conversion
 
Decoders-Digital Electronics
Decoders-Digital ElectronicsDecoders-Digital Electronics
Decoders-Digital Electronics
 
Signed Binary Numbers
Signed Binary NumbersSigned Binary Numbers
Signed Binary Numbers
 
Chap ii.BCD code,Gray code
Chap ii.BCD code,Gray codeChap ii.BCD code,Gray code
Chap ii.BCD code,Gray code
 
What is Gray Code?
What is Gray Code? What is Gray Code?
What is Gray Code?
 
Bcd
BcdBcd
Bcd
 
Combinational circuits
Combinational circuits Combinational circuits
Combinational circuits
 
Multiplexers & Demultiplexers
Multiplexers & DemultiplexersMultiplexers & Demultiplexers
Multiplexers & Demultiplexers
 
Encoder and decoder
Encoder and decoderEncoder and decoder
Encoder and decoder
 
Weighted and Non Weighted Codes
Weighted and Non Weighted CodesWeighted and Non Weighted Codes
Weighted and Non Weighted Codes
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 
digital logic design number system
digital logic design number systemdigital logic design number system
digital logic design number system
 

Similar to 3.codes( binary code ,excess 3, gray code )

3F4ecc.ppt
3F4ecc.ppt3F4ecc.ppt
3F4ecc.pptAnnymus
 
Ch12- instruction sets- char & funct.pdf
Ch12- instruction sets- char & funct.pdfCh12- instruction sets- char & funct.pdf
Ch12- instruction sets- char & funct.pdfsaimawarsi
 
Digital electronics- BCD & Decoder
Digital electronics- BCD & DecoderDigital electronics- BCD & Decoder
Digital electronics- BCD & DecoderPritam Shil
 
Error Detection N Correction
Error Detection N CorrectionError Detection N Correction
Error Detection N CorrectionAnkan Adhikari
 
Lecture_Computer_Codes.ppt
Lecture_Computer_Codes.pptLecture_Computer_Codes.ppt
Lecture_Computer_Codes.pptMarlonMagtibay2
 
Lecture 5 binary_codes
Lecture 5 binary_codesLecture 5 binary_codes
Lecture 5 binary_codesKamran Zafar
 
9pL7F2E8XI0alXYT280.pptx
9pL7F2E8XI0alXYT280.pptx9pL7F2E8XI0alXYT280.pptx
9pL7F2E8XI0alXYT280.pptxAnSHiKa187943
 
2022_ITN_Module_5.pptx
2022_ITN_Module_5.pptx2022_ITN_Module_5.pptx
2022_ITN_Module_5.pptxDintlePhofu
 
Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2ISMT College
 
QuadIron An open source library for number theoretic transform-based erasure ...
QuadIron An open source library for number theoretic transform-based erasure ...QuadIron An open source library for number theoretic transform-based erasure ...
QuadIron An open source library for number theoretic transform-based erasure ...Scality
 
10 hexadecimal number system
10   hexadecimal number system10   hexadecimal number system
10 hexadecimal number systemLee Chadwick
 
Error detection enhanced decoding of difference set codes for memory applicat...
Error detection enhanced decoding of difference set codes for memory applicat...Error detection enhanced decoding of difference set codes for memory applicat...
Error detection enhanced decoding of difference set codes for memory applicat...Sherin Deena Sam
 

Similar to 3.codes( binary code ,excess 3, gray code ) (20)

3F4ecc.ppt
3F4ecc.ppt3F4ecc.ppt
3F4ecc.ppt
 
Ch12- instruction sets- char & funct.pdf
Ch12- instruction sets- char & funct.pdfCh12- instruction sets- char & funct.pdf
Ch12- instruction sets- char & funct.pdf
 
Binary and EC codes
Binary and EC codesBinary and EC codes
Binary and EC codes
 
Reed solomon codes
Reed solomon codesReed solomon codes
Reed solomon codes
 
Digital electronics- BCD & Decoder
Digital electronics- BCD & DecoderDigital electronics- BCD & Decoder
Digital electronics- BCD & Decoder
 
Error Detection N Correction
Error Detection N CorrectionError Detection N Correction
Error Detection N Correction
 
Computer-codes.pptx
Computer-codes.pptxComputer-codes.pptx
Computer-codes.pptx
 
Part 1.pptx
Part 1.pptxPart 1.pptx
Part 1.pptx
 
Lecture_Computer_Codes.ppt
Lecture_Computer_Codes.pptLecture_Computer_Codes.ppt
Lecture_Computer_Codes.ppt
 
MIC PROJECT.pdf
MIC PROJECT.pdfMIC PROJECT.pdf
MIC PROJECT.pdf
 
Lecture 5 binary_codes
Lecture 5 binary_codesLecture 5 binary_codes
Lecture 5 binary_codes
 
9pL7F2E8XI0alXYT280.pptx
9pL7F2E8XI0alXYT280.pptx9pL7F2E8XI0alXYT280.pptx
9pL7F2E8XI0alXYT280.pptx
 
1.1.2 HEXADECIMAL
1.1.2 HEXADECIMAL1.1.2 HEXADECIMAL
1.1.2 HEXADECIMAL
 
2022_ITN_Module_5.pptx
2022_ITN_Module_5.pptx2022_ITN_Module_5.pptx
2022_ITN_Module_5.pptx
 
Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2
 
Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
 
QuadIron An open source library for number theoretic transform-based erasure ...
QuadIron An open source library for number theoretic transform-based erasure ...QuadIron An open source library for number theoretic transform-based erasure ...
QuadIron An open source library for number theoretic transform-based erasure ...
 
03 ddl
03 ddl03 ddl
03 ddl
 
10 hexadecimal number system
10   hexadecimal number system10   hexadecimal number system
10 hexadecimal number system
 
Error detection enhanced decoding of difference set codes for memory applicat...
Error detection enhanced decoding of difference set codes for memory applicat...Error detection enhanced decoding of difference set codes for memory applicat...
Error detection enhanced decoding of difference set codes for memory applicat...
 

More from MdFazleRabbi18

5.programmable interval timer 8253
5.programmable interval timer 82535.programmable interval timer 8253
5.programmable interval timer 8253MdFazleRabbi18
 
4.programmable dma controller 8257
4.programmable dma controller 82574.programmable dma controller 8257
4.programmable dma controller 8257MdFazleRabbi18
 
3.programmable interrupt controller 8259
3.programmable interrupt controller 82593.programmable interrupt controller 8259
3.programmable interrupt controller 8259MdFazleRabbi18
 
Topic4 data encryption standard(des)
Topic4 data encryption standard(des)Topic4 data encryption standard(des)
Topic4 data encryption standard(des)MdFazleRabbi18
 
Topic2 caser hill_cripto
Topic2 caser hill_criptoTopic2 caser hill_cripto
Topic2 caser hill_criptoMdFazleRabbi18
 
Topic5 advanced encryption standard (aes)
Topic5 advanced encryption standard (aes)Topic5 advanced encryption standard (aes)
Topic5 advanced encryption standard (aes)MdFazleRabbi18
 
Topic1 substitution transposition-techniques
Topic1 substitution transposition-techniquesTopic1 substitution transposition-techniques
Topic1 substitution transposition-techniquesMdFazleRabbi18
 
9. hofman coding in DIP
9. hofman coding in DIP9. hofman coding in DIP
9. hofman coding in DIPMdFazleRabbi18
 
7. image enhancement using spatial filtering
7. image enhancement using spatial filtering7. image enhancement using spatial filtering
7. image enhancement using spatial filteringMdFazleRabbi18
 
5. gray level transformation
5. gray level transformation5. gray level transformation
5. gray level transformationMdFazleRabbi18
 
1. steps in image processing
1. steps in image processing1. steps in image processing
1. steps in image processingMdFazleRabbi18
 
5. convolution and correlation of discrete time signals
5. convolution and correlation of discrete time signals 5. convolution and correlation of discrete time signals
5. convolution and correlation of discrete time signals MdFazleRabbi18
 
4. operations of signals
4. operations of signals 4. operations of signals
4. operations of signals MdFazleRabbi18
 
2. classification of signals
2. classification of signals 2. classification of signals
2. classification of signals MdFazleRabbi18
 
1. elementary signals
1. elementary signals 1. elementary signals
1. elementary signals MdFazleRabbi18
 
4. random number and it's generating techniques
4. random number and it's generating techniques 4. random number and it's generating techniques
4. random number and it's generating techniques MdFazleRabbi18
 

More from MdFazleRabbi18 (20)

5.programmable interval timer 8253
5.programmable interval timer 82535.programmable interval timer 8253
5.programmable interval timer 8253
 
4.programmable dma controller 8257
4.programmable dma controller 82574.programmable dma controller 8257
4.programmable dma controller 8257
 
3.programmable interrupt controller 8259
3.programmable interrupt controller 82593.programmable interrupt controller 8259
3.programmable interrupt controller 8259
 
1.ppi 8255
1.ppi 8255 1.ppi 8255
1.ppi 8255
 
Topic4 data encryption standard(des)
Topic4 data encryption standard(des)Topic4 data encryption standard(des)
Topic4 data encryption standard(des)
 
Topic3 playfain
Topic3 playfainTopic3 playfain
Topic3 playfain
 
Topic2 caser hill_cripto
Topic2 caser hill_criptoTopic2 caser hill_cripto
Topic2 caser hill_cripto
 
Topic5 advanced encryption standard (aes)
Topic5 advanced encryption standard (aes)Topic5 advanced encryption standard (aes)
Topic5 advanced encryption standard (aes)
 
Topic1 substitution transposition-techniques
Topic1 substitution transposition-techniquesTopic1 substitution transposition-techniques
Topic1 substitution transposition-techniques
 
11. lzw coding
11. lzw coding11. lzw coding
11. lzw coding
 
9. hofman coding in DIP
9. hofman coding in DIP9. hofman coding in DIP
9. hofman coding in DIP
 
7. image enhancement using spatial filtering
7. image enhancement using spatial filtering7. image enhancement using spatial filtering
7. image enhancement using spatial filtering
 
5. gray level transformation
5. gray level transformation5. gray level transformation
5. gray level transformation
 
1. steps in image processing
1. steps in image processing1. steps in image processing
1. steps in image processing
 
5. convolution and correlation of discrete time signals
5. convolution and correlation of discrete time signals 5. convolution and correlation of discrete time signals
5. convolution and correlation of discrete time signals
 
4. operations of signals
4. operations of signals 4. operations of signals
4. operations of signals
 
3. systems
3. systems 3. systems
3. systems
 
2. classification of signals
2. classification of signals 2. classification of signals
2. classification of signals
 
1. elementary signals
1. elementary signals 1. elementary signals
1. elementary signals
 
4. random number and it's generating techniques
4. random number and it's generating techniques 4. random number and it's generating techniques
4. random number and it's generating techniques
 

Recently uploaded

power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 

Recently uploaded (20)

power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 

3.codes( binary code ,excess 3, gray code )

  • 2. 4.2 Codes ➔ Encoding is required for sending information over long distances unambiguously ➔ Information needs to be decoded at the receiving end to get back the original information “Coding is the process of altering the characteristics of information to make it more suitable for intended application”
  • 3. 4.3 Codes ➔ Need to use coding of information for a variety of reasons ◆ Increase efficiency of transmission ◆ Make data error free ◆ Enable receiver to correct information if error occurred ◆ Inform the sender if error occurred in the received information ◆ Limit the accessibility of information ◆ Standardize a universal code
  • 4. 4.4 Binary coding ➔ Use binary digits (0, 1) to code the elements of an information set ➔ For example, suppose n is the number of bits in the word to be coded and x is the number of uniquely coded words ◆ if n = 1, then x = 2 (0, 1) ◆ if n = 2, then x = 4 (00, 01, 10, 11) ◆ if n = 3, then x = 8 (000, 001, 010, … , 111) ➔ So, if n = j then x = 2j and ◆ n = log2 x = 3.32 log10 x
  • 5. 4.5 Binary coding ➔ There are ten different symbols in the decimal number system 0, 1, 2, .. , 9 ➔ We need at least four bits to represent them in binary form 8 -> 1 0 0 0 9 -> 1 0 0 1 ➔ With 4 bit groups, we can have 16 four bit groups. As there are 10 digits in decimal notation, number of possible codes, (16 C 10) x (10!) ➔ Most of these codes will not have any special properties that would be useful in hardware design
  • 6. 4.6 Properties Of Codes ➔ Some of the desirable properties of codes ◆ Ease of coding ◆ Ease in arithmetic operations ◆ Minimum use of hardware ◆ Error detection property ◆ Ability to prevent wrong output during transitions
  • 7. 4.7 Properties Of Codes Some of the most commonly used codes 1) Binary Coded Decimal Codes (BCD Codes) 2) Unit Distance Codes 3) Error Detection Codes 4) Alphanumeric Codes
  • 8. 4.8 Binary Coded Decimal Codes ➔ In a BCD/ Weighted Code, decimal value of a code is the algebraic sum of the weights of 1’s appearing in the number ➔ More popularly used codes have the weights as, w3 w2 w1 w0 8 4 2 1 2 4 2 1 8 4 -2 -1
  • 9. 4.9 Binary Coded Decimal Code (BCD Code) ➔ Two desirable properties ◆ Self-complementing Codes: Complement of a code number is also its arithmetic complement ● Example: 2421 code of (4)10 is 0110 Complement of 0110 => 1001 => (5)10 = (9 - 4)10 ◆ Reflective Codes: 9’s complement of the code word can be achieved by taking the reflected BCD code ● Example: Excess-3 is a reflective code 0 -> 0 0 1 1 -> 1 1 0 0 (complement) -> 9 (which is 9’s complement of 0) 5 -> 1 0 0 0 -> 0 1 1 1 (complement) -> 4 (which is 9’s complement of 5)
  • 10. 4.10 Binary Coded Decimal Code (BCD Code) ➔ Only 10 combinations are utilized ➔ Remaining 6 combinations are illegal ➔ They may be utilized for error detection
  • 11. 4.11 The Excess-3 code is also called as XS-3 code. It is non-weighted code used to express decimal numbers. The Excess-3 code words are derived from the 8421 BCD code words adding (0011)2 or (3)10 to each code word in 8421. Excess-3 code
  • 13. 4.13 It is the non-weighted code and it is not arithmetic codes. That means there are no specific weights assigned to the bit position. The gray code is called as a unit distance code. The gray code is a cyclic code. Gray code cannot be used for arithmetic operation. Gray Code
  • 14. 4.14 Binary Code & Gray Code Conversion
  • 15. 4.15 Binary Code & Gray Code Conversion