convert BCD to 16-bits integer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hashem
    New Member
    • Sep 2010
    • 1

    #1

    convert BCD to 16-bits integer

    Convert a 4 digit number stored in a global array bcdval[4] in the format of Binary Coded Decimal (BCD) to a 16‐bit integer value stored in global variable ival. Sample of input and output:
    char bcdval[4] = {2, 9, 8, 7};
    int ival; Gives ival = 0x0BAB
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    This looks like a homework assignment.

    First: How do you convert any integer to BCD?

    Of you can do it on paper theb yu can code it.

    Please post your paper conversion.

    Comment

    Working...