Principle of Water Content Test of Insulating Oil
Collecting Oil Sample from Oil Immersed Electrical Equipment
Causes of Insulating Oil Deterioration
Acidity Test of Transformer Insulating Oil
Magnetic FieldClosely Related Articles
Binary Number System | Binary to Decimal and Decimal to Binary Conversion
Binary to Decimal and Decimal to Binary Conversion
BCD or Binary Coded Decimal | BCD Conversion Addition Subtraction
Binary to Octal and Octal to Binary Conversion
Octal to Decimal and Decimal to Octal Conversion
Binary to Hexadecimal and Hex to Binary Conversion
Hexadecimal to Decimal and Decimal to Hexadecimal Conversion
Gray Code | Binary to Gray Code and that to Binary Conversion
Octal Number System
Digital Logic Gates
2s Complement Arithmetic
Error Detection and Correction Codes
9s complement and 10s complement | Subtraction
Some Common Applications of Logic Gates
Alphanumeric codes | ASCII code | EBCDIC code | UNICODE
Boolean Algebra Theorems and Laws of Boolean Algebra
De Morgan Theorem and Demorgans Laws
Truth Tables for Digital Logic
Simplifying Boolean Expression using K Map
Excess 3 Code Addition and Subtraction
K Map or Karnaugh Map
Switching Algebra or Boolean Algebra
Binary Adder Half and Full Adder
Seven Segment Display
Binary to Gray Code Converter and Grey to Binary Code Converter
Binary to BCD Code Converter
Analog to Digital Converter
Digital Encoder or Binary Encoder
Basic Digital Counter
BCD to Seven Segment Decoder
Parallel Adder or Subtractor
555 Timer and 555 Timer Working
Look Ahead Carry Adder
OR Operation | Logical OR Operation
AND Operation | Logical AND Operation
Logical OR Gate
Logical AND Gate
Universal Gate | NAND and NOR Gate as Universal Gate
Diode and Transistor NAND Gate or DTL NAND Gate and NAND Gate ICs
X OR Gate and X NOR Gate
Transistor Transistor Logic or TTL
Fan out of Logic Gates
NMOS Logic and PMOS Logic
Logic Families Significance and Types of Logic Families
S R Flip Flop
Active Low S R Latch
Clocked S R Flip Flops
D Flip Flop
J K Flip Flop
Master Slave Flip Flop
Read Only Memory
Programmable Logic Devices
Programmable Array Logic
Application of Flip Flops
Buffer Register and Controlled Buffer Register
Data Transfer in Shift Registers
Serial In Serial Out (SISO) Shift Register
Serial in Parallel Out (SIPO) Shift Register
Parallel in Serial Out (PISO) Shift Register
Parallel in Parallel Out (PIPO) Shift Register
Universal Shift Registers
Bidirectional Shift Register
Dynamic Shift Register
Applications of Shift Registers
Conversion of Flip Flops
BCD or Binary Coded Decimal | BCD Conversion Addition Subtraction
Let, (12)10 be the decimal number whose equivalent Binary coded decimal will be 00010010. Four bits from L.S.B is binary equivalent of 2 and next four is the binary equivalent of 1. Table given below shows the binary and BCD codes for the decimal numbers 0 to 15. From the table below, we can conclude that after 9 the decimal equivalent binary number is of four bit but in case of BCD it is an eight bit number. This is the main difference between Binary number and binary coded decimal. For 0 to 9 decimal numbers both binary and BCD is equal but when decimal number is more than one bit BCD differs from binary.
|Decimal number||Binary number||Binary Coded Decimal(BCD)|
BCD AdditionLike other number system in BCD arithmetical operation may be required. BCD is a numerical code which has several rules for addition. The rules are given below in three steps with an example to make the idea of BCD Addition clear.
- At first the given number are to be added using the rule of binary. For example,
- In second step we have to judge the result of addition. Here two cases are shown to describe the rules of BCD Addition. In case 1 the result of addition of two binary number is greater than 9, which is not valid for BCD number. But the result of addition in case 2 is less than 9, which is valid for BCD numbers.
- If the four bit result of addition is greater than 9 and if a carry bit is present in the result then it is invalid and we have to add 6 whose binary equivalent is (0110)2 to the result of addition. Then the resultant that we would get will be a valid binary coded number. In case 1 the result was (1111)2, which is greater than 9 so we have to add 6 or (0110)2 to it.
BCD SubtractionThere are several methods of BCD Subtraction. BCD subtraction can be done by 1’s compliment method and 9’s compliment method or 10’s compliment method. Among all these methods 9’s compliment method or 10’s compliment method is the most easiest. We will clear our idea on both the methods of BCD Subtraction
Method of BCD Subtraction : 1In 1st method we will do BCD Subtraction by 1’s compliment method. There are several steps for this method shown below. They are:-
- At first 1’s compliment of the subtrahend is done.
- Then the complimented subtrahend is added to the other number from which the subtraction is to be done. This is called adder 1.
- Now in BCD Subtraction there is a term ‘EAC(end-around-carry)’. If there is a carry i.e if EAC = 1 the result of the subtraction is +ve and if EAC = 0 then the result is –ve. A table shown below gives the rules of EAC.
- In the final result if any carry bit occurs the it will be ignored.
|carry of individual groups||EAC = 1||EAC = 0|
|1||Transfer real result of adder 1 and add 0000 in adder 2||Transfer 1’s compliment result of adder 1 and add 1010 in adder 2|
|0||Transfer real result of adder 1 and add 1010 in adder 2||Transfer 1’s compliment result of adder 1 and add 0000 to adder 2|
Example: - 1 In this example 0010 0001 0110 is subtracted from 0101 0100 0001.
- At first 1’s compliment of the subtrahend is done, which is 1101 1110 1001 and is added to 0101 0100 0001. This step is called adder 1.
- Now after addition if any carry occurs then it will be added to the next group of numbers towards MSB. Then EAC will be examined. Here, EAC = 1. So the result of addition is positive and true result of adder 1 will be transferred to adder 2.
- Now notice from LSB. There are three groups of four bit numbers. 1010 is added 1011 which is the first group of numbers because it do not have any carry. The result of the addition is the final answer.
- Carry 1 will be ignored as it is from the rule.
- Now move to the next group of numbers. 0000 is added to 0010 and gives the result 0010. It is the final result again.
- Now again move to the next group here 0000 is also added to 0011 to give the final result 0011.
- You may have noticed that in this two groups 0000 is added, because result of first adder do not contain any carry. Thus the results of the adder 2 is the final result of BCD Subtraction.
Example: - 2In this example let 0101 0001 be subtracted from 0100 1001.
- As per rule firstly 1’s compliment of the subtrahend is done. Then the addition is done and the result is checked. Here EAC = 0, so the overall result will be –ve.
- Now see the result of adder 1 from LSB. 1’s compliment value of 0111 is transferred to adder 2 and it is added with 1010 since no carry is added with it as per the rule. The answer is the final result.
- Now move to the next result of adder 1 i.e 1110. Here 1 is added to it which is the carry of the previous result. Then it’ value is 1’s complimented i.e 0000 and it is added to 0000. Result of adder 2 is the final result. This is the final result of BCD Subtraction.
- Now you can again check yourself. Decimal equivalent of the given numbers of subtraction is 49 and 51. Therefore 49 -51 = -2. So our result is correct.
Method of BCD Subtraction: 2In 2nd method we will do BCD subtraction in 9’s compliment method.
- Here the method is very simple. At first the decimal equivalent of the given Binary Coded Decimal (BCD) codes are found out.
- Then the 9’s compliment of the subtrahend is done and then that result is added to the number from which the subtraction is to be done.
- If there is any carry bit then the carry bit may be added to the result of the subtraction.
- As we can see 51 and 21 are the decimal value of the given BCD codes. Then the 9’s compliment of the subtrahend is done i.e 99 − 21 = 78.
- This complimented value is added with the 51. i.e 51 + 78 = 129.
- In this result the MSB i.e 1 is the carry. This carry will be added to 29. Therefore 29 + 1 = 30, which is the final answer of BCD Subtraction.
- The decimal result will be changed into BCD codes to get the result in BCD. Therefore from the example we can conclude the final result of BCD Subtraction i.e
BCD ComversionBCD conversion is very simple. In case of BCD conversion at first the decimal equivalent of the BCD codes are found out and then that decimal number can be changed to any other number system as required. To know the methods of conversion of number system you may read the topic binary number system.
Closely Related Articles Binary Number System | Binary to Decimal and Decimal to Binary ConversionBinary to Decimal and Decimal to Binary ConversionBinary to Octal and Octal to Binary ConversionOctal to Decimal and Decimal to Octal ConversionBinary to Hexadecimal and Hex to Binary ConversionHexadecimal to Decimal and Decimal to Hexadecimal ConversionGray Code | Binary to Gray Code and that to Binary ConversionOctal Number SystemDigital Logic Gates2′s Complement1′s ComplementASCII CodeHamming Code2s Complement ArithmeticError Detection and Correction Codes9s complement and 10s complement | SubtractionSome Common Applications of Logic GatesKeyboard EncoderAlphanumeric codes | ASCII code | EBCDIC code | UNICODEMore Related Articles Digital ElectronicsBoolean Algebra Theorems and Laws of Boolean AlgebraDe Morgan Theorem and Demorgans LawsTruth Tables for Digital LogicBinary Arithmetic Binary AdditionBinary SubtractionSimplifying Boolean Expression using K MapBinary DivisionExcess 3 Code Addition and SubtractionK Map or Karnaugh MapSwitching Algebra or Boolean AlgebraBinary MultiplicationParallel SubtractorBinary Adder Half and Full AdderBinary SubstractorSeven Segment DisplayBinary to Gray Code Converter and Grey to Binary Code ConverterBinary to BCD Code ConverterAnalog to Digital ConverterDigital Encoder or Binary EncoderBinary DecoderBasic Digital CounterDigital ComparatorBCD to Seven Segment DecoderParallel AdderParallel Adder or SubtractorMultiplexerDemultiplexer555 Timer and 555 Timer WorkingLook Ahead Carry AdderOR Operation | Logical OR OperationAND Operation | Logical AND OperationLogical OR GateLogical AND GateNOT GateUniversal Gate | NAND and NOR Gate as Universal GateNAND GateDiode and Transistor NAND Gate or DTL NAND Gate and NAND Gate ICsX OR Gate and X NOR GateTransistor Transistor Logic or TTLNOR GateFan out of Logic GatesINHIBIT GateNMOS Logic and PMOS LogicSchmitt GatesLogic Families Significance and Types of Logic FamiliesLatches and Flip FlopsS R Flip Flop S R LatchActive Low S R Latch and Flip FlopGated S R Latches or Clocked S R Flip FlopsD Flip Flop or D LatchJ K Flip FlopMaster Slave Flip FlopRead Only Memory | ROMProgrammable Logic DevicesProgrammable Array LogicApplication of Flip FlopsShift RegistersBuffer Register and Controlled Buffer RegisterData Transfer in Shift RegistersSerial In Serial Out (SISO) Shift RegisterSerial in Parallel Out (SIPO) Shift RegisterParallel in Serial Out (PISO) Shift RegisterParallel in Parallel Out (PIPO) Shift RegisterUniversal Shift RegistersBidirectional Shift RegisterDynamic Shift RegisterApplications of Shift RegistersUninterruptible Power Supply | UPSConversion of Flip FlopsJohnson CounterSequence GeneratorRing CounterNew Articles Principle of Water Content Test of Insulating OilCollecting Oil Sample from Oil Immersed Electrical EquipmentCauses of Insulating Oil DeteriorationAcidity Test of Transformer Insulating OilMagnetic Flux