Sci.Electronics.Basics

on Electronics-Related.com

  Home  |  Books  |  Sci.Electronics.Design  |  Sci.Electronics.Basics  |  Resources  |  Contact  | 
Sign in
username:

password:

Remember Me

Not a member?
Search Sci.Electronics.Basics

Search Tips

Sci.Electronics.Basics -> Binary to BCD converter IC?

There are 14 messages in this thread.
You are currently looking at messages 1 to 14.






Author: ivanatora
Date: 04:20 16-01-08

Hello,
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.

Author: Stephen J. Rush
Date: 05:44 16-01-08


On Wed, 16 Jan 2008 01:20:26 -0800, ivanatora wrote:

> Hello,
> 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?

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.

Date: 12:25 16-01-08


ivanatora <ivanatora@gmail.com> writes:
> I don't want to use microcontrollers.

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
digikey.

Author: Bob Monsen
Date: 01:38 17-01-08


"DJ Delorie" <dj@delorie.com> wrote in message
news:xnmyr5pts7.fsf@delorie.com...
>
> ivanatora <ivanatora@gmail.com> writes:
>> I don't want to use microcontrollers.
>
> 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
> digikey.

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.

Regards,
Bob Monsen


Date: 02:54 17-01-08


"Bob Monsen" <rcmonsen@gmail.com> writes:
> 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.

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
documented).

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.


[*] http://www.delorie.com/electronics/usb-gpio/

Date: 01:01 23-01-08


DJ Delorie <dj@delorie.com> writes:
> XC9536's cost about $1 at digikey.

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.

Date: 23:46 23-01-08


DJ Delorie <dj@delorie.com> writes:
> 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.

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 :-)

Author: ivanatora
Date: 04:09 27-01-08

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 :)

Author: Ken Fowler
Date: 21:12 27-01-08


On 27-Jan-2008, ivanatora <ivanatora@gmail.com> wrote:

> Xref: number1.nntp.dca.giganews.com sci.electronics.basics:284450
>
> 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 :)

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

Author: ivanatora
Date: 00:59 08-02-08


> 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

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'.

Author: John Fields
Date: 08:07 08-02-08

On Thu, 7 Feb 2008 21:59:21 -0800 (PST), ivanatora
<ivanatora@gmail.com> wrote:

>
>> 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
>
>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'.

---
With 8-bit address and data spaces:

BINARY BCD BCD DECIMAL
ADDRESS MSD LSD DISPLAY
-----------|------|------|--------
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
--
JF

Author: ivanatora
Date: 11:08 08-02-08

Mapping all 100 possible combinations? That seems pretty exhausting :P
I see it now, thanks for the example!


On 8 =E6=C5=D7, 15:07, John Fields <jfie...@austininstruments.com> wrote:
> On Thu, 7 Feb 2008 21:59:21 -0800 (PST), ivanatora
>
> <ivanat...@gmail.com> wrote:
>
> >> 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
>
> >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'.
>
> ---
> With 8-bit address and data spaces:
>
> BINARY BCD BCD DECIMAL
> ADDRESS MSD LSD DISPLAY
> -----------|------|------|--------
> 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
> --
> JF


Author: John Fields
Date: 15:30 08-02-08

On Fri, 8 Feb 2008 08:08:33 -0800 (PST), ivanatora
<ivanatora@gmail.com> wrote:

>> ---
>> With 8-bit address and data spaces:
>>
>> BINARY BCD BCD DECIMAL
>> ADDRESS MSD LSD DISPLAY
>> -----------|------|------|--------
>> 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 <--Oops
>> 0001 0100 0010 0000 20
>> 0001 0101 0010 0001 21
>> .
>> .
>> .
>> 1001 1001 1001 1001 99
>> --
>> JF

>Mapping all 100 possible combinations? That seems pretty exhausting :P

---
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
EPROM.
---

>I see it now, thanks for the example!

---
You're welcome!

The 'Oops' should read:

BINARY BCD BCD DECIMAL
ADDRESS MSD LSD DISPLAY
-----------|------|------|---------
0001 0011 0001 1001 19

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


Date: 19:52 08-02-08


DJ Delorie <dj@delorie.com> writes:
> Not that I've actually tried any of these in hardware :-)

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

http://www.delorie.com/electronics/bin2seven/

The chip (XC9572XL-VQ44) costs $2.04 each at Digikey.

1


      Contact  |  Electronic Portal


Sci.Electronics.Basics by Keywords
ADC
Antenna
CAD
Coil
Generator
IDE
LCD
Modulator
MOSFET
NiMH
Opamp
Oscilloscope
PID
RS232
Telephone
Transformers
TTL
USB

Sci.Electronics.Basics By Author