Converting decimal fraction to BCD

Discussion in 'Homework Help' started by TsAmE, Mar 17, 2011.

  1. TsAmE

    Thread Starter Member

    Apr 19, 2010
    72
    0
    Convert the following decimal numbers to their 8421 BCD equivalents:

    99.9

    Attempt:

    I was able to convert 99 (1001 1001) but i am not sure how you would convert 0.9
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,136
    1,786
    You express 0.9 as sum of binary fractions:

    0.9 = (1/2) + (1/4) + (1/8) + ... to any level of precision you care to work with. In the above case you would have the binary fraction:

    0.1110
     
  3. Arbitrator

    New Member

    Mar 10, 2011
    16
    0
    would 19.9 in base 10 would be 0001 1001.1110 or 0001 1001.0111 in BCD?
    __________________________<---------.---> __<---------.<-----
    do you start from right and continue to go left?
     
  4. justtrying

    Active Member

    Mar 9, 2011
    329
    341
    I believe this converts 0.9 into binary and not BCD.

    I think 0.9 in BCD will simply be 0.1001 as the whole point of BCD is to use 0-9 binary representations of numbers to avoid these conversions. Forgive in advance if I am wrong. (as per Wiki. 0.2 = 0.0010)
     
  5. Arbitrator

    New Member

    Mar 10, 2011
    16
    0
    so .8 will be 0.1000 or 0001 in BCD?
    for .9 in Binary i am getting .11100

    since 1/2 + 1/4 + 1/8 is ALMOST .9

    but i am unsure about BCD is 0.8, 0.1000 or 0.0001?? i am sure it is one or the other.
     
    Last edited: Mar 18, 2011
  6. justtrying

    Active Member

    Mar 9, 2011
    329
    341
    well, 8 in BCD is 1000 right? if you go with .0001, then in BCD that is actually 0.1 since you just keep reading BCD in nibbles
     
  7. Arbitrator

    New Member

    Mar 10, 2011
    16
    0
    hmm.. so your saying 8 = 1000 in BCD, i agree. so .8 must be .1000... i guess. so your saying that for BCD .x is read in whole numbers and only binary is read by 1/2+1/4+1/8 excetera?
    therefore .8 = 1000 in BCD and .8 = 1100 -approximately (it is actually 7.5), is that what you mean?
     
    Last edited: Mar 18, 2011
  8. justtrying

    Active Member

    Mar 9, 2011
    329
    341
    I assume .8 = 1100 (~0.75) in binary...

    and you are right about it being read as whole numbers since the purpose of BCD is to take each digit in the number and represent it in binary form using 4 bits of data.
     
Loading...