SlideShare a Scribd company logo
1 of 13
Weighted and Non weighted code
Weighted Code:- 
In weighted code, each digit position has a weight 
or value. The sum of all digits multiplied by a 
weight gives the total amount being represented. 
We can express any decimal number in tens, 
hundreds, thousands and so on. 
Eg:- Decimal number 4327 can be written as 
4327= 4000+300+20+7 
In the power of 10, it becomes 
4327= 4(10³)+3(10²)+2(10¹)+7(100) 
BCD or 8421 is a type of weighted code where each 
digit position is being assigned a specific weight.
Non-weighted code:- 
In non-weighted code, there is no positional 
weight i.e. each position within the binary 
number is not assigned a prefixed value. No 
specific weights are assigned to bit position in 
non –weighted code. 
The non-weighted codes are:- 
a) The Gray code b) The Excess-3 code
BCD or 8421 code:- 
It is composed of four bits representing the 
decimal digits 0 through 9. The 8421 indicates 
the binary weights of the four bits(2³,2²,2¹,20). 
Decimal 8421(BCD) 
0 0000 
1 0001 
2 0010 
3 0011 
4 0100 
5 0101 
6 0110 
7 0111 
8 1000 
9 1001
Convert following to BCD form 
a)47310 b) 31210 c) 25710 d) 11210 
Convert following BCD to their decimal equivalent 
a)10000110 b) 00110010.10010100 
Convert the following binary number numbers to 
their BCD equivalent. 
a)1101.012 b) 11.0112 
(Binary to decimal 
Decimal to BCD)
BCD addition 
Add two numbers as same as binary addition 
Case 1: If the result is less than or equals to 9 
and carry is zero then it is valid BCD. 
Case 2: If result is greater than 9 and carry is 
zero then add 6 in four bit combination. 
Case 3: If result is less than or equals to 9 but 
carry is 1 then add 6 in four bit combination.
Packed BCD 
The BCD numbers corresponding to decimal 
numbers beyond 9 are called as packed BCD 
Decimal (25) 0010 0101(Packed BCD)
9’s complement: 
9’s complement of a BCD number can be 
obtained by subtracting it from 9. 
10’s compliment: 
10’s compliment is obtained by adding 1 to 9’s 
compliment
Comparison of BCD with Binary 
1. BCD is less efficient than binary 
eg:- (78)10  (0111 1000)BCD 
 (1001110)2 
To encode the same decimal number , BCD needs 
more no. of bits than binary . Hence BCD is less 
efficient as compared to Binary 
2. BCD arithmetic is more complicated than binary 
arithmetic. 
3. Advantage of a BCD code is that the conversion 
from decimal to BCD or vice versa is simple.
The Gray code:- 
It is non weighted code in which each number 
differs from previous number by a single bit. 
Decimal Binary Gray code 
0 0000 0000 
1 0001 0001 
2 0010 0011 
3 0011 0010 
4 0100 0110 
5 0101 0111 
6 0110 0101 
7 0111 0100 
8 1000 1100 
9 1001 1101
Binary to gray conversion:- 
a)The MSB in the Gray code is same as the 
corresponding bit in the binary number. 
b)Going from left to right, add each adjacent pair of 
binary bit to get next gray code bit and discard 
carry 
Gray to binary conversion:- 
a)The MSB is the binary code is same as 
corresponding digit in the gray code. 
b)Add each binary digit generated to the gray digit 
in the next adjacent position and discard carry.
The Excess-3 code:- 
It is an important BCD code , is a 4 bit code and 
used with BCD numbers 
To convert any decimal numbers into its excess- 
3 form ,add 3 to each decimal digit and then 
convert the sum to a BCD number 
As weights are not assigned, it is a kind of non 
weighted codes.
Convert the following into Excess-3 number 
a)149 b) 2546 c) 152 d) 2694 
Add the following numbers in excess-3 code 
a) 108+789 b) 275+496

More Related Content

What's hot

Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes VandanaPagar1
 
Error detection & correction codes
Error detection & correction codesError detection & correction codes
Error detection & correction codesRevathi Subramaniam
 
Combinational circuits
Combinational circuitsCombinational circuits
Combinational circuitsSARITHA REDDY
 
Multiplexer and DeMultiplexer
Multiplexer and DeMultiplexerMultiplexer and DeMultiplexer
Multiplexer and DeMultiplexerEstiak Khan
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmeticgavhays
 
Design half ,full Adder and Subtractor
Design half ,full Adder and SubtractorDesign half ,full Adder and Subtractor
Design half ,full Adder and SubtractorJaimin@prt.ltd.
 
Combinational circuits
Combinational circuits Combinational circuits
Combinational circuits DrSonali Vyas
 
Complements of numbers
Complements of numbersComplements of numbers
Complements of numbersKiriti Varkur
 
Half adder & full adder
Half adder & full adderHalf adder & full adder
Half adder & full adderGaditek
 
Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.
Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.
Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.Satya P. Joshi
 
Encoders and decoders
Encoders and decodersEncoders and decoders
Encoders and decodersDeepikaDG1
 

What's hot (20)

Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes
 
Error detection & correction codes
Error detection & correction codesError detection & correction codes
Error detection & correction codes
 
Combinational circuits
Combinational circuitsCombinational circuits
Combinational circuits
 
What is Gray Code?
What is Gray Code? What is Gray Code?
What is Gray Code?
 
1s and 2s complement
1s and 2s complement1s and 2s complement
1s and 2s complement
 
Encoder and decoder
Encoder and decoderEncoder and decoder
Encoder and decoder
 
Multiplexer and DeMultiplexer
Multiplexer and DeMultiplexerMultiplexer and DeMultiplexer
Multiplexer and DeMultiplexer
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 
Hamming codes
Hamming codesHamming codes
Hamming codes
 
Design half ,full Adder and Subtractor
Design half ,full Adder and SubtractorDesign half ,full Adder and Subtractor
Design half ,full Adder and Subtractor
 
Encoder
EncoderEncoder
Encoder
 
Number system conversion
Number system conversionNumber system conversion
Number system conversion
 
Binary Arithmetic Operations
Binary Arithmetic OperationsBinary Arithmetic Operations
Binary Arithmetic Operations
 
Combinational circuits
Combinational circuits Combinational circuits
Combinational circuits
 
Complements of numbers
Complements of numbersComplements of numbers
Complements of numbers
 
Binary codes
Binary codesBinary codes
Binary codes
 
Half adder & full adder
Half adder & full adderHalf adder & full adder
Half adder & full adder
 
Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.
Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.
Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.
 
Encoders and decoders
Encoders and decodersEncoders and decoders
Encoders and decoders
 
Data Representation
Data RepresentationData Representation
Data Representation
 

Viewers also liked (15)

Bcd to excess 3 code converter
Bcd to excess 3 code converterBcd to excess 3 code converter
Bcd to excess 3 code converter
 
23 gray codes
23 gray codes23 gray codes
23 gray codes
 
VHDL
VHDLVHDL
VHDL
 
VHDL CODE
VHDL CODE VHDL CODE
VHDL CODE
 
Binary to grey code conversion
Binary to grey code conversionBinary to grey code conversion
Binary to grey code conversion
 
Shift Registers
Shift RegistersShift Registers
Shift Registers
 
Dlc{binary to gray code conversion} ppt
Dlc{binary to gray code conversion} pptDlc{binary to gray code conversion} ppt
Dlc{binary to gray code conversion} ppt
 
Fpga
FpgaFpga
Fpga
 
Programs of VHDL
Programs of VHDLPrograms of VHDL
Programs of VHDL
 
Introduction to FPGA, VHDL
Introduction to FPGA, VHDL  Introduction to FPGA, VHDL
Introduction to FPGA, VHDL
 
Counters
CountersCounters
Counters
 
FPGA
FPGAFPGA
FPGA
 
Fundamentals of FPGA
Fundamentals of FPGAFundamentals of FPGA
Fundamentals of FPGA
 
FPGA
FPGAFPGA
FPGA
 
K to 12 PC Hardware Servicing Learning Module
K to 12 PC Hardware Servicing Learning ModuleK to 12 PC Hardware Servicing Learning Module
K to 12 PC Hardware Servicing Learning Module
 

Similar to BCD,GRAY and EXCESS 3 codes

5_2019_01_03!03_33_00_PM.pptx
5_2019_01_03!03_33_00_PM.pptx5_2019_01_03!03_33_00_PM.pptx
5_2019_01_03!03_33_00_PM.pptxAbijahRoseline1
 
Lecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdfLecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdfUmerKhan147799
 
9pL7F2E8XI0alXYT280.pptx
9pL7F2E8XI0alXYT280.pptx9pL7F2E8XI0alXYT280.pptx
9pL7F2E8XI0alXYT280.pptxAnSHiKa187943
 
Code conversions.pptx415.pptx
Code conversions.pptx415.pptxCode conversions.pptx415.pptx
Code conversions.pptx415.pptxMariaJoseph591921
 
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdfCDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdfshubhangisonawane6
 
DLD_PPT_0.pptx
DLD_PPT_0.pptxDLD_PPT_0.pptx
DLD_PPT_0.pptxECENAAC2
 
Lecture 5 binary_codes
Lecture 5 binary_codesLecture 5 binary_codes
Lecture 5 binary_codesKamran Zafar
 
Unit 1 data representation and computer arithmetic
Unit 1  data representation and computer arithmeticUnit 1  data representation and computer arithmetic
Unit 1 data representation and computer arithmeticAmrutaMehata
 
Unit1_Part2-Machine_Instructions_Programs_7_9_2018_3pm.ppt
Unit1_Part2-Machine_Instructions_Programs_7_9_2018_3pm.pptUnit1_Part2-Machine_Instructions_Programs_7_9_2018_3pm.ppt
Unit1_Part2-Machine_Instructions_Programs_7_9_2018_3pm.pptChiragSuresh
 
Introduction of number system
Introduction of number systemIntroduction of number system
Introduction of number systemAswiniT3
 
BCD to binary code converter
BCD to binary code converterBCD to binary code converter
BCD to binary code converterkiruthikamaniG1
 
numbering system binary and decimal hex octal
numbering system binary and decimal hex octalnumbering system binary and decimal hex octal
numbering system binary and decimal hex octalnoor300491
 
What is bcd number system
What is bcd number systemWhat is bcd number system
What is bcd number systemMuhammad Shahid
 
review of number systems and codes
review of number systems and codesreview of number systems and codes
review of number systems and codessrinu247
 

Similar to BCD,GRAY and EXCESS 3 codes (20)

5_2019_01_03!03_33_00_PM.pptx
5_2019_01_03!03_33_00_PM.pptx5_2019_01_03!03_33_00_PM.pptx
5_2019_01_03!03_33_00_PM.pptx
 
Lecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdfLecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdf
 
9pL7F2E8XI0alXYT280.pptx
9pL7F2E8XI0alXYT280.pptx9pL7F2E8XI0alXYT280.pptx
9pL7F2E8XI0alXYT280.pptx
 
Code conversions.pptx415.pptx
Code conversions.pptx415.pptxCode conversions.pptx415.pptx
Code conversions.pptx415.pptx
 
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdfCDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
 
DLD_PPT_0.pptx
DLD_PPT_0.pptxDLD_PPT_0.pptx
DLD_PPT_0.pptx
 
Codes r005
Codes  r005Codes  r005
Codes r005
 
Lecture 5 binary_codes
Lecture 5 binary_codesLecture 5 binary_codes
Lecture 5 binary_codes
 
Digital electronics
Digital electronicsDigital electronics
Digital electronics
 
Digital Electronics Codes.pdf
Digital Electronics Codes.pdfDigital Electronics Codes.pdf
Digital Electronics Codes.pdf
 
Unit 1 data representation and computer arithmetic
Unit 1  data representation and computer arithmeticUnit 1  data representation and computer arithmetic
Unit 1 data representation and computer arithmetic
 
Unit1_Part2-Machine_Instructions_Programs_7_9_2018_3pm.ppt
Unit1_Part2-Machine_Instructions_Programs_7_9_2018_3pm.pptUnit1_Part2-Machine_Instructions_Programs_7_9_2018_3pm.ppt
Unit1_Part2-Machine_Instructions_Programs_7_9_2018_3pm.ppt
 
IARE_DLD_PPT_0.pdf
IARE_DLD_PPT_0.pdfIARE_DLD_PPT_0.pdf
IARE_DLD_PPT_0.pdf
 
Introduction of number system
Introduction of number systemIntroduction of number system
Introduction of number system
 
BCD to binary code converter
BCD to binary code converterBCD to binary code converter
BCD to binary code converter
 
Number system
Number systemNumber system
Number system
 
numbering system binary and decimal hex octal
numbering system binary and decimal hex octalnumbering system binary and decimal hex octal
numbering system binary and decimal hex octal
 
Code conversion r006
Code conversion r006Code conversion r006
Code conversion r006
 
What is bcd number system
What is bcd number systemWhat is bcd number system
What is bcd number system
 
review of number systems and codes
review of number systems and codesreview of number systems and codes
review of number systems and codes
 

More from student

Logic Gates
Logic GatesLogic Gates
Logic Gatesstudent
 
Flipflops and Excitation tables of flipflops
Flipflops and Excitation tables of flipflopsFlipflops and Excitation tables of flipflops
Flipflops and Excitation tables of flipflopsstudent
 
Number Systems
Number SystemsNumber Systems
Number Systemsstudent
 
towers of hanoi
towers of hanoitowers of hanoi
towers of hanoistudent
 
header, circular and two way linked lists
header, circular and two way linked listsheader, circular and two way linked lists
header, circular and two way linked listsstudent
 
Arrays Data Structure
Arrays Data StructureArrays Data Structure
Arrays Data Structurestudent
 
Number Systems
Number SystemsNumber Systems
Number Systemsstudent
 
binary arithmetic rules
binary arithmetic rulesbinary arithmetic rules
binary arithmetic rulesstudent
 
animals colours numbers idioms
animals colours numbers idiomsanimals colours numbers idioms
animals colours numbers idiomsstudent
 
irregular verbs
irregular verbsirregular verbs
irregular verbsstudent
 
dc generator ece
dc generator ecedc generator ece
dc generator ecestudent
 
INDUCTION MOTOR
INDUCTION MOTORINDUCTION MOTOR
INDUCTION MOTORstudent
 
structure and union
structure and unionstructure and union
structure and unionstudent
 
storage class
storage classstorage class
storage classstudent
 
file handling1
file handling1file handling1
file handling1student
 
direct and indirect band gap
direct and indirect band gapdirect and indirect band gap
direct and indirect band gapstudent
 
hall effect
hall effecthall effect
hall effectstudent
 
optics chapter_07_solution_manual
optics chapter_07_solution_manualoptics chapter_07_solution_manual
optics chapter_07_solution_manualstudent
 
dyneins and kinesins
dyneins and kinesinsdyneins and kinesins
dyneins and kinesinsstudent
 
Structure and function of bacterial cells
Structure and function of bacterial cellsStructure and function of bacterial cells
Structure and function of bacterial cellsstudent
 

More from student (20)

Logic Gates
Logic GatesLogic Gates
Logic Gates
 
Flipflops and Excitation tables of flipflops
Flipflops and Excitation tables of flipflopsFlipflops and Excitation tables of flipflops
Flipflops and Excitation tables of flipflops
 
Number Systems
Number SystemsNumber Systems
Number Systems
 
towers of hanoi
towers of hanoitowers of hanoi
towers of hanoi
 
header, circular and two way linked lists
header, circular and two way linked listsheader, circular and two way linked lists
header, circular and two way linked lists
 
Arrays Data Structure
Arrays Data StructureArrays Data Structure
Arrays Data Structure
 
Number Systems
Number SystemsNumber Systems
Number Systems
 
binary arithmetic rules
binary arithmetic rulesbinary arithmetic rules
binary arithmetic rules
 
animals colours numbers idioms
animals colours numbers idiomsanimals colours numbers idioms
animals colours numbers idioms
 
irregular verbs
irregular verbsirregular verbs
irregular verbs
 
dc generator ece
dc generator ecedc generator ece
dc generator ece
 
INDUCTION MOTOR
INDUCTION MOTORINDUCTION MOTOR
INDUCTION MOTOR
 
structure and union
structure and unionstructure and union
structure and union
 
storage class
storage classstorage class
storage class
 
file handling1
file handling1file handling1
file handling1
 
direct and indirect band gap
direct and indirect band gapdirect and indirect band gap
direct and indirect band gap
 
hall effect
hall effecthall effect
hall effect
 
optics chapter_07_solution_manual
optics chapter_07_solution_manualoptics chapter_07_solution_manual
optics chapter_07_solution_manual
 
dyneins and kinesins
dyneins and kinesinsdyneins and kinesins
dyneins and kinesins
 
Structure and function of bacterial cells
Structure and function of bacterial cellsStructure and function of bacterial cells
Structure and function of bacterial cells
 

Recently uploaded

Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
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
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
lifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxlifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxsomshekarkn64
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
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
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction managementMariconPadriquez1
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsSachinPawar510423
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 

Recently uploaded (20)

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
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
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
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
lifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxlifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptx
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
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
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction management
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documents
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 

BCD,GRAY and EXCESS 3 codes

  • 1. Weighted and Non weighted code
  • 2. Weighted Code:- In weighted code, each digit position has a weight or value. The sum of all digits multiplied by a weight gives the total amount being represented. We can express any decimal number in tens, hundreds, thousands and so on. Eg:- Decimal number 4327 can be written as 4327= 4000+300+20+7 In the power of 10, it becomes 4327= 4(10³)+3(10²)+2(10¹)+7(100) BCD or 8421 is a type of weighted code where each digit position is being assigned a specific weight.
  • 3. Non-weighted code:- In non-weighted code, there is no positional weight i.e. each position within the binary number is not assigned a prefixed value. No specific weights are assigned to bit position in non –weighted code. The non-weighted codes are:- a) The Gray code b) The Excess-3 code
  • 4. BCD or 8421 code:- It is composed of four bits representing the decimal digits 0 through 9. The 8421 indicates the binary weights of the four bits(2³,2²,2¹,20). Decimal 8421(BCD) 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001
  • 5. Convert following to BCD form a)47310 b) 31210 c) 25710 d) 11210 Convert following BCD to their decimal equivalent a)10000110 b) 00110010.10010100 Convert the following binary number numbers to their BCD equivalent. a)1101.012 b) 11.0112 (Binary to decimal Decimal to BCD)
  • 6. BCD addition Add two numbers as same as binary addition Case 1: If the result is less than or equals to 9 and carry is zero then it is valid BCD. Case 2: If result is greater than 9 and carry is zero then add 6 in four bit combination. Case 3: If result is less than or equals to 9 but carry is 1 then add 6 in four bit combination.
  • 7. Packed BCD The BCD numbers corresponding to decimal numbers beyond 9 are called as packed BCD Decimal (25) 0010 0101(Packed BCD)
  • 8. 9’s complement: 9’s complement of a BCD number can be obtained by subtracting it from 9. 10’s compliment: 10’s compliment is obtained by adding 1 to 9’s compliment
  • 9. Comparison of BCD with Binary 1. BCD is less efficient than binary eg:- (78)10  (0111 1000)BCD  (1001110)2 To encode the same decimal number , BCD needs more no. of bits than binary . Hence BCD is less efficient as compared to Binary 2. BCD arithmetic is more complicated than binary arithmetic. 3. Advantage of a BCD code is that the conversion from decimal to BCD or vice versa is simple.
  • 10. The Gray code:- It is non weighted code in which each number differs from previous number by a single bit. Decimal Binary Gray code 0 0000 0000 1 0001 0001 2 0010 0011 3 0011 0010 4 0100 0110 5 0101 0111 6 0110 0101 7 0111 0100 8 1000 1100 9 1001 1101
  • 11. Binary to gray conversion:- a)The MSB in the Gray code is same as the corresponding bit in the binary number. b)Going from left to right, add each adjacent pair of binary bit to get next gray code bit and discard carry Gray to binary conversion:- a)The MSB is the binary code is same as corresponding digit in the gray code. b)Add each binary digit generated to the gray digit in the next adjacent position and discard carry.
  • 12. The Excess-3 code:- It is an important BCD code , is a 4 bit code and used with BCD numbers To convert any decimal numbers into its excess- 3 form ,add 3 to each decimal digit and then convert the sum to a BCD number As weights are not assigned, it is a kind of non weighted codes.
  • 13. Convert the following into Excess-3 number a)149 b) 2546 c) 152 d) 2694 Add the following numbers in excess-3 code a) 108+789 b) 275+496