Skip to main content

Why Do We Add 6 to AL in BCD Arithmetic?


Why Do We Add 6 to AL in BCD Arithmetic?

One of the most common questions when studying the Intel 8086 and BCD (Binary-Coded Decimal) arithmetic is:

Why do we add 06H to AL after certain additions?

The answer lies in the difference between binary numbers and BCD numbers.

BCD vs Binary Representation

A single BCD digit can represent only decimal values from 0 to 9.

System Range Binary Values
BCD Digit 0 – 9 0000 to 1001
4-bit Binary 0 – 15 0000 to 1111

Therefore, the following binary values are invalid BCD digits:

1010 = 10
1011 = 11
1100 = 12
1101 = 13
1110 = 14
1111 = 15
    

The Mathematical Reason

In BCD, after digit 9 comes decimal 10. However, in binary, the next value after 9 is still represented within the same nibble.

The correction value is obtained from:

16 - 10 = 6
    

Since a 4-bit nibble naturally rolls over at 16, adding 6 (06H) forces the binary result into a valid BCD format and generates the proper decimal carry.

BCD Correction Rule:
If a BCD digit becomes greater than 9, add 06H.

Example 1: 8 + 5

Step 1: Binary Addition

  1000   (8)
+ 0101   (5)
-------
  1101   (13)
    

The result 1101 equals decimal 13, which is not a valid single BCD digit.

Step 2: Add 06H

  1101
+ 0110
-------
1 0011
    

The carry becomes the tens digit and 0011 becomes the units digit.

0001 0011 = BCD 13
    
Result: Decimal 13 is correctly represented as BCD 0001 0011.

Example 2: 9 + 8

Binary Addition

  1001   (9)
+ 1000   (8)
-------
10001   (17)
    

Since the decimal value exceeds 9, a BCD correction is required.

After decimal adjustment, the result becomes:

0001 0111
    

Which represents:

17
    

How the DAA Instruction Uses This Rule

The Intel 8086 provides the DAA (Decimal Adjust after Addition) instruction to perform this correction automatically.

MOV AL,08H
ADD AL,05H
DAA
    
Step AL Value
After ADD 0DH
After DAA 13H

The DAA instruction detects that the lower nibble exceeds 9 and automatically adds 06H to produce a valid packed BCD result.

Visual Explanation

Binary Result 1101 + Add 0110 = Valid BCD 0001 0011

Key Takeaway

A 4-bit binary digit can represent values from 0 to 15, but a BCD digit can represent only 0 to 9. Whenever a BCD digit exceeds 9, adding 06H converts the invalid binary value into a valid BCD representation while generating the correct decimal carry.

Formula:

Correction = 16 - 10 = 6
        

This is the fundamental reason why the Intel 8086 DAA instruction adds 06H to AL during BCD adjustment.

Contact Us

Name

Email *

Message *

Popular Posts

UGC NET Electronic Science Previous Year Question Papers with Solutions

Home / Engineering & Other Exams / UGC NET 2026 PYQ ⬇️ Download Papers and Solutions 📋 Exam Pattern 💡 Preparation Tips ❓ FAQs 📊 Exam Highlights: Electronic Science (88) Feature Details Junior Research Fellowship (JRF) ₹37,000 + HRA per month Eligibility M.Sc/M.Tech in Electronics (55%) Validity of Certificate JRF (3 Years) | Lectureship (Lifetime) 📥 Download UGC NET Electronics PDFs Complete collection of previous year question papers, answer keys and explanations for Subject Code 88. Start Downloading 📂 View All Question Papers June 2025 - Question Paper Download PDF June 2025 - Solved Paper + Explanation ...

BER vs SNR for M-ary QAM, M-ary PSK, QPSK, BPSK, ...(MATLAB Code + Simulator)

Bit Error Rate (BER) & SNR Guide Analyze communication system performance with our interactive simulators and MATLAB tools. 📘 Theory 🧮 Simulators 💻 MATLAB Code 📚 Resources BER Definition SNR Formula BER Calculator MATLAB Comparison 📂 Explore M-ary QAM, PSK, and QPSK Topics ▼ 🧮 Constellation Simulator: M-ary QAM 🧮 Constellation Simulator: M-ary PSK 🧮 BER calculation for ASK, FSK, and PSK 🧮 Approaches to BER vs SNR What is Bit Error Rate (BER)? The BER indicates how many corrupted bits are received compared to the total number of bits sent. It is the primary figure of merit f...

UGC NET Electronic Science June 2025 Question Paper with Answer Key & Detailed Solutions

Home / UGC NET PYQ / June 2025 Solved UGC NET Electronic Science June 2025 Question Paper with Answer Key and Full Explanations 📥 Download Question Paper (PDF) 2025 2024 2023 2022 2021 2020 Explanations 1.  Answer: Option (3) For forming a p-type semiconductor, the dopant must be a trivalent impurity (three valence electrons) so that it creates acceptor levels and holes become the majority carriers. Among the given elements, boron (B) is a group-III element (trivalent). Arsenic (As) and phosphorus (P) are group-V (pentavalent) donors that produce n-type material, and germanium (Ge) is a group-IV element usually used as the semiconductor, not as an acceptor dopant. Hence, doping an intrinsic semiconductor with B produces a p-type semiconductor. 2.  Answer: Option (4) The ohmic resistance of a JFET at zero gate bias is given by the standard relation: R DS(on) = V P / I DSS ...

Online Simulator for ASK, FSK, and PSK

Interactive Digital Signal Processing (DSP) Tutorial and Simulator for ASK, FSK, and BPSK modulation techniques. Try our new Digital Signal Processing Simulator!   •   Interactive ASK, FSK, and BPSK tools updated for 2025. Start Now Digital Modulation Visualizer: ASK, FSK, & BPSK Simulator Learn and visualize binary modulation techniques (ASK, FSK, BPSK) in real-time with adjustable carrier and sampling parameters. Perfect for DSP students and engineers. 📡 ASK Simulator 📶 FSK Simulator 🎚️ BPSK Simulator 📚 More Topics ASK Modulator FSK Modulator BPSK Modulator More Topics 1. ASK (Amplitude Shift Keying) Simulat...

Constellation Diagrams of ASK, PSK, and FSK (with MATLAB Code + Simulator)

Constellation Diagrams: ASK, FSK, and PSK Comprehensive guide to signal space representation, including interactive simulators and MATLAB implementations. 📘 Overview 🧮 Simulator ⚖️ Theory Q-function 📚 Resources 📂 Other Topics: M-ary PSK & QAM Diagrams ▼ 🧮 Simulator for M-ary PSK Constellation 🧮 Simulator for M-ary QAM Constellation BASK (Binary ASK) Modulation Transmits one of two signals: 0 or -√Eb, where Eb​ is the energy per bit. These signals represent binary 0 and 1. BFSK (Binary FSK) Modulation Transmits one of two signals: +√Eb​ (On the y-axis, the phas...

MATLAB Code for ASK, FSK, and PSK (with Online Simulator)

MATLAB Code for ASK, FSK, and PSK Comprehensive implementation of digital modulation and demodulation techniques with simulation results. 📘 Theory 📡 ASK Code 📶 FSK Code 🎚️ PSK Code 🕹️ Simulator 📚 Further Reading Amplitude Shift Frequency Shift Phase Shift Live Simulator ASK, FSK & PSK HomePage MATLAB Code MATLAB Code for ASK Modulation and Demodulation COPY % The code is written by SalimWireless.Com clc; clear all; close all; % Parameters Tb = 1; fc = 10; N_bits = 10; Fs = 100 * fc; Ts = 1/Fs; samples_per_bit = Fs * Tb; rng(10); binar...

1G to 5G Technology - Evolution of Wireless Generations

Cellular wireless evolution Generation Frequency band PHY features Data rate Spectral Eff. (bps/Hz) 1G 850 MHz FDMA, FM N/A N/A 2G 900 MHz, 1.8 GHz TDMA/CDMA, GMSK/QPSK, FEC, PC 10 Kbps < 1 3G 1.8–2.5 GHz CDMA, QAM 1–40 Mbps 1–8 4G 2–8 GHz OFDMA, SC-FDMA, QAM, MIMO-OFDM 100–600 Mbps 15 5G 1–6 GHz mm wave (26–28 GHz) < 1 GHz (massive IoT) visible light? massive MIMO, beamforming D2D, Full duplex, NOMA LDPC and Polar codes OFDM & variants (adapted to extremes?) multi-Gbps several tens Waveform design is the major change between the generations Mobile Wireless Generations Specifications  1G  Voice, Analog traffic, FDMA  2G  Voice, SMS, CS data ...

BER performance of QPSK with BPSK, 4-QAM, 16-QAM, 64-QAM, 256-QAM, etc (MATLAB + Simulator)

📘 Overview 📚 QPSK vs BPSK and QAM: A Comparison of Modulation Schemes in Wireless Communication 📚 Real-World Example 🧮 MATLAB Code 📚 Further Reading   QPSK provides twice the data rate compared to BPSK. However, the bit error rate (BER) is approximately the same as BPSK at low SNR values when gray coding is used. On the other hand, QPSK exhibits similar spectral efficiency to 4-QAM and 16-QAM under low SNR conditions. In very noisy channels, QPSK can sometimes achieve better spectral efficiency than 4-QAM or 16-QAM. In practical wireless communication scenarios, QPSK is commonly used along with QAM techniques, especially where adaptive modulation is applied. Modulation Bits/Symbol Points in Constellation Usage Notes BPSK 1 2 Very robust, used in weak signals QPSK 2 4 Balanced speed & reliability 4-QAM ...