मराठी
महाराष्ट्र राज्य शिक्षण मंडळएचएससी विज्ञान (संगणक विज्ञान) इयत्ता १२ वी

Write procedure of DAA instruction to convert hexadecimal number in to Binary Coded Decimal (BCD) number with suitable example. - Computer Science 2

Advertisements
Advertisements

प्रश्न

Write procedure of DAA instruction to convert hexadecimal number in to Binary Coded Decimal (BCD) number with suitable example. 

सविस्तर उत्तर
Advertisements

उत्तर

The DAA (Decimal Adjust Accumulator) instruction is used to convert the hexadecimal result of the addition of two BCD numbers into a valid packed BCD number. It is used only after the ADD/ADC/ADI instruction.

Procedure

  1. Perform addition: Add two BCD numbers using ADD/ADC/ADI. The result (in hexadecimal form) is stored in Accumulator (A).

  2. Check lower nibble (units digit): If lower nibble > 9 OR Auxiliary Carry (AC) = 1 → Add 06H to accumulator.

  3. Check upper nibble (tens digit): After step 2, if upper nibble > 9

    OR Carry flag (CY) = 1 → Add 60H to the accumulator.

  4. Final result: The accumulator now contains a valid packed BCD number. If CY = 1, it indicates an extra digit (hundreds).

Add 68 and 85 (BCD numbers)

Perform addition → 68H + 85H = EDH

Lower nibble check → EDH + 06H = F3H

Upper nibble check → F3H + 60H = 153H

Final result 

A = 53H

CY = 1

shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2025-2026 (March) Official Board Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×