Connect with us

Binary to BCD converter IC?

Discussion in 'Electronic Basics' started by ivanatora, Jan 16, 2008.

Scroll to continue with content
  1. ivanatora

    ivanatora Guest

    I'm searching for an IC which can convert binary input to BCD code.
    I have a TC77 temperature sensor, which provides data to 8-bit shift
    register, and finally I have 8 bits in complementary code for negative
    temperatures, and straight code for positive temperatures. Let's put
    aside the negative numbers for now and concentrate on simple binary to
    BCD converter. I want to put that reading on a 7-segment indication
    via 7447 driver.
    So long for now I've found in Google ICL74185 as binary to BCD
    convertor, but I will need 2 or 3 hooked together for converting 8-bit
    number. Also I can't find that IC anywhere on our stores and it seems
    it is not in production anymore.

    The other question is - is there a IC for converting the complimentary
    code into straight code?

    I don't want to use microcontrollers.

    Regards, Ivan.
  2. A small (256 bytes) PROM can be programmed to convert 8-bit twos-
    complement to two BCD digits and a sign bit, but you'd lose some
    precision. A wider PROM could supply 12 BCD bits and a sign. Somebody
    probably offers it preprogrammed; National Semiconductor used to have a
    bunch of specialized decoders based on the same mask ROM, back in the
    Z-80 era. Converting twos-complement to natural binary can be done with
    gates, but the minimum-package-count solution is probably a small
    microcontroller. Some of them, especially the low-speed grades, have
    become absurdly cheap. Most of them have a serial input, so you wouldn't
    need the shift register.
  3. DJ Delorie

    DJ Delorie Guest

    This was recently covered in detail. How about a CPLD? Program it
    once, treat it like a complex logic chip. XC9536's cost about $1 at
  4. Bob Monsen

    Bob Monsen Guest

    How much does the programmer cost? I looked into CPLDs a while back, and the
    programming algorithm was proprietary, meaning I'd have to shell out a few
    hundred bucks for a programmer.

    Bob Monsen
  5. DJ Delorie

    DJ Delorie Guest

    The Xilinx tools are free, and they have app notes that tell you how
    to run the jtag yourself for embedded ISP, and provide a tool to
    compress the bitstream into something easily parsable (and

    Me, I'm wiring mine up to a small mcu module I already have[*], so the
    cost to me for the programmer is zero. There are schematics for the
    Parallel III cable if you want to build it; it's a connector and a
    couple of TTL chips.

    Total cost to me to have a XC9536XL CPLD: $1.

  6. DJ Delorie

    DJ Delorie Guest

    Just FYI I did a trial synthesis (by first! :) of this, and it fits
    into the XC9572 but not the XC9536. So, it's $2 instead of $1.
  7. DJ Delorie

    DJ Delorie Guest

    More trials.

    If you want a multiplexed display (three digit drivers, seven segment
    drivers, clock input), it fits easily into a XC9536.

    If you want separate digits (i.e. 21 segment drivers) but don't mind
    providing a clock (full update in three clocks), that can fit into an
    XC9536 too. This works because there's only one 7-segment decoder
    block, which is shared across the three output modules.

    It looks like there's enough remaining cells to implement leading zero
    blanking, too.

    Not that I've actually tried any of these in hardware :)
  8. ivanatora

    ivanatora Guest

    I'm back again.
    I've searched a lot and find no easy way to convert parallel binary
    into BCD, so I'm reconsidering using a microcontroller. They are
    pretty cheap indeed, and a friend of mine just built a PIC16
    programmer. Me and him are not so bad in C and asm, so we could make
    of that good learning project :)
  9. Ken Fowler

    Ken Fowler Guest

    I believe someone pointed out that an easy way to convert binary to BCD is
    to store the BCD values in EPROM(s) and use the binary as the address. I
    once wrote an ASM Macro to generate the BCD values for storing in a HEX
    file to program the EPROM. You need four output bits of EPROM for each BCD
    digit. For eight bit binary you need two eight bit wide EPROMs.

    Ken Fowler
  10. ivanatora

    ivanatora Guest

    In that way what would happen to the number 1110 (14) for example?
    There is no corresponding (readable) BCD code for that, and two BCD
    digits must be emitted - '1' and '4'.
  11. John Fields

    John Fields Guest

    With 8-bit address and data spaces:

    0000 0000 0000 0000 00
    0000 0001 0000 0001 01
    0000 0010 0000 0010 02
    0000 0011 0000 0011 03
    0000 0100 0000 0100 04
    0000 0101 0000 0101 05
    0000 0110 0000 0110 06
    0000 0111 0000 0111 07
    0000 1000 0000 1000 08
    0000 1001 0000 1001 09
    0000 1010 0001 0000 10
    0000 1011 0001 0001 11
    0000 1100 0001 0010 12
    0000 1101 0001 0011 13
    0000 1110 0001 0100 14
    0000 1111 0001 0101 15
    0001 0000 0001 0110 16
    0001 0001 0001 0111 17
    0001 0010 0001 1000 18
    0001 0011 0001 0000 19
    0001 0100 0010 0000 20
    0001 0101 0010 0001 21
    1001 1001 1001 1001 99
  12. ivanatora

    ivanatora Guest

    Mapping all 100 possible combinations? That seems pretty exhausting :p
    I see it now, thanks for the example!
  13. John Fields

    John Fields Guest

    It shouldn't be, just write a binary to BCD routine which will
    generate a file your EPROM programmer can use to burn the target
    You're welcome!

    The 'Oops' should read:

    0001 0011 0001 1001 19

    Another good reason for letting a machine do it instead of doing it
    by hand, LOL!
  14. DJ Delorie

    DJ Delorie Guest

    Ok, I have a WORKING binary to three-digit-led converter chip:

    The chip (XC9572XL-VQ44) costs $2.04 each at Digikey.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day