Maker Pro
Maker Pro

Binary to BCD converter IC?

I

ivanatora

Jan 1, 1970
0
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.
 
S

Stephen J. Rush

Jan 1, 1970
0
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.
 
D

DJ Delorie

Jan 1, 1970
0
ivanatora said:
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.
 
B

Bob Monsen

Jan 1, 1970
0
DJ Delorie said:
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
 
D

DJ Delorie

Jan 1, 1970
0
Bob Monsen said:
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/
 
D

DJ Delorie

Jan 1, 1970
0
DJ Delorie said:
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.
 
D

DJ Delorie

Jan 1, 1970
0
DJ Delorie said:
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 :)
 
I

ivanatora

Jan 1, 1970
0
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 :)
 
K

Ken Fowler

Jan 1, 1970
0
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
 
I

ivanatora

Jan 1, 1970
0
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'.
 
J

John Fields

Jan 1, 1970
0
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
 
I

ivanatora

Jan 1, 1970
0
Mapping all 100 possible combinations? That seems pretty exhausting :p
I see it now, thanks for the example!
 
J

John Fields

Jan 1, 1970
0
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!
 
Top