Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

? Binary to BCD conversion chip ?

892 views
Skip to first unread message

i z e n \"@uclink4.berkeley.edu Yi-Zen Chu; Yiren Qu

unread,
Nov 27, 2002, 9:08:18 PM11/27/02
to
Hello everyone,

Does anyone know if there's any IC chip commercially available that can
convert a 4 (or 8 bit) number to BCD? Where can I buy it? I tried
looking up on the Net but only found 74185, which seemed to be discontinued?

Thanks for the help!

Yi-Zen

PS. Sorry for the cross-posting; I'm not sure where this question should
be addressed.

Michael R. Kesti

unread,
Nov 28, 2002, 12:09:31 AM11/28/02
to
"Yi-Zen Chu; Yiren Qu" wrote:

>Hello everyone,
>
>Does anyone know if there's any IC chip commercially available that can
>convert a 4 (or 8 bit) number to BCD? Where can I buy it? I tried
>looking up on the Net but only found 74185, which seemed to be discontinued?

The classic solution is to program an EPROM or similar with a table of
values.

--
========================================================================
Michael Kesti | "And like, one and one don't make
| two, one and one make one."
mke...@gv.net | - The Who, Bargain

Spehro Pefhany

unread,
Nov 28, 2002, 12:13:55 AM11/28/02
to
On Thu, 28 Nov 2002 02:08:18 GMT, the renowned "Yi-Zen Chu; Yiren Qu"
<""y i z e n \"@ u c l i n k 4 . b e r k e l e y

. e d u> wrote:

>Hello everyone,
>
>Does anyone know if there's any IC chip commercially available that can
>convert a 4 (or 8 bit) number to BCD? Where can I buy it? I tried
>looking up on the Net but only found 74185, which seemed to be discontinued?

One easy way would be to use one or more standard EPROMs. For example,
a 64K x 16 EPROM costs less than $5 one-off and will give you any 16
bit output you like, for any 16 bit input, in less than 100ns.

Of course you have to come up with data to program the EPROM, but
that's not hard, just write a simple program in C or whatever to spit
it out.


Best regards,
Spehro Pefhany
--
"it's the network..." "The Journey is the reward"
sp...@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.co

i z e n \"@uclink4.berkeley.edu Yi-Zen Chu; Yiren Qu

unread,
Nov 28, 2002, 2:17:22 AM11/28/02
to
Thanks for responding to my questions.

Could you guys educate me on what an EPROM is? I am a newbie to
electronics. How do I program it?

Yi-Zen

Paul Burke

unread,
Nov 28, 2002, 3:49:57 AM11/28/02
to
Spehro Pefhany wrote:

> >Does anyone know if there's any IC chip commercially available that can
> >convert a 4 (or 8 bit) number to BCD? Where can I buy it? I tried
> >looking up on the Net but only found 74185, which seemed to be discontinued?
>
> One easy way would be to use one or more standard EPROMs. For example,
> a 64K x 16 EPROM costs less than $5 one-off and will give you any 16
> bit output you like, for any 16 bit input, in less than 100ns.
>

There is an algorithmic way to do the conversion on an incoming stream
of data. All I can remember about it was that it was in an old
programmable logic applications book (over 15 years ago)- perhaps MMI? A
colleague implemented it in software on a 6809 and all I can say is it
worked, and saved a few vital bytes compared with divides or repeated
subtraction. Took an age though.

Paul Burke

Tony Williams

unread,
Nov 28, 2002, 3:46:17 AM11/28/02
to
In article <769buuonnv7e0or9i...@4ax.com>,
Spehro Pefhany <sp...@interlog.com> wrote:

> One easy way would be to use one or more standard EPROMs. For example,
> a 64K x 16 EPROM costs less than $5 one-off and will give you any 16
> bit output you like, for any 16 bit input, in less than 100ns.

You've thwarted my cunning scheme of nibble-arithmetic,
using 4-bit comparators and adders. And it was only
going to take about 11 chips........

--
Tony Williams.

Tilmann Reh

unread,
Nov 28, 2002, 5:33:34 AM11/28/02
to
Paul Burke schrieb:

> There is an algorithmic way to do the conversion on an incoming stream
> of data. All I can remember about it was that it was in an old
> programmable logic applications book (over 15 years ago)- perhaps MMI? A
> colleague implemented it in software on a 6809 and all I can say is it
> worked, and saved a few vital bytes compared with divides or repeated
> subtraction. Took an age though.

It's rather simple, I often use that method.
You need to shift the binary data and add correctives if nibbles
fall into the range A..F.
Takes one complete shifting of the binary data, i.e. 16 times
a 16-bit shift for 16-bit data (20-bit output in this case), plus
some conditional additions for the decimal adjustments. But needs
only very small code space and other resources.

Dipl.-Ing. Tilmann Reh
Autometer GmbH Siegen - Elektronik nach Maß.
http://www.autometer.de

==================================================================
In a world without walls and fences, who needs Windows and Gates ?
(Sun Microsystems)

i z e n \"@uclink4.berkeley.edu Yi-Zen Chu; Yiren Qu

unread,
Nov 28, 2002, 6:09:27 AM11/28/02
to
Yi-Zen Chu; Yiren Qu wrote:
>
> Does anyone know if there's any IC chip commercially available that can
> convert a 4 (or 8 bit) number to BCD?

I should be more precise: I need to convert a 8 bit binary number to
BCD, not a 4 bit.

Yi-Zen

Tony Williams

unread,
Nov 28, 2002, 7:04:21 AM11/28/02
to
In article <3DE5D8B5...@scazon.com>,
Paul Burke <pa...@scazon.com> wrote:

> There is an algorithmic way to do the conversion on an incoming stream
> of data. All I can remember about it was that it was in an old
> programmable logic applications book (over 15 years ago)- perhaps MMI? A
> colleague implemented it in software on a 6809 and all I can say is it
> worked, and saved a few vital bytes compared with divides or repeated
> subtraction. Took an age though.

I think there's an example in a PIC app note.

--
Tony Williams.

Tilmann Reh

unread,
Nov 28, 2002, 8:20:25 AM11/28/02
to
"Yi-Zen Chu; Yiren Qu" schrieb:

> I should be more precise: I need to convert a 8 bit binary number to
> BCD, not a 4 bit.

Doesn't matter, anyway.

Spehro Pefhany

unread,
Nov 28, 2002, 9:32:31 AM11/28/02
to
On Thu, 28 Nov 2002 07:17:22 GMT, the renowned "Yi-Zen Chu; Yiren Qu"

<""y i z e n \"@ u c l i n k 4 . b e r k e l e y
. e d u> wrote:

>Thanks for responding to my questions.
>
>Could you guys educate me on what an EPROM

Erasable programmable read-only memory. Some EPROMs are not
erasable, but rather than calling them ROMs (which would cause
confusion with mask-ROMs etc.) we call them OTP EPROMs.
(one time programmable). You may wish to use an erasable part or
an EEPROM or FLASH (the latter are electrically erasable
equivalents) for your initial tests.

Here is a suitable x16: http://www.atmel.com/atmel/acrobat/doc0019.pdf
and an x8: http://www.atmel.com/atmel/acrobat/doc0015.pdf


>electronics. How do I program it?

Create an Intel hex file (see my web page for the format),
and use a programmer. Test, if not correct, rinse and repeat.

John Fields

unread,
Nov 28, 2002, 8:01:36 AM11/28/02
to
On Thu, 28 Nov 2002 02:08:18 GMT, "Yi-Zen Chu; Yiren Qu" <""y i z

e n \"@ u c l i n k 4 . b e r k e l e y . e d
u> wrote:

>Hello everyone,
>
>Does anyone know if there's any IC chip commercially available that can
>convert a 4 (or 8 bit) number to BCD? Where can I buy it? I tried
>looking up on the Net but only found 74185, which seemed to be discontinued?

---
Here's an old-timey pure hardware solution. No 湣, no EPROMS, no
programming...

Hook up two '191's and three '190's to the same clock. Set the
191's to count down and the 190's to count up. Connect TC from the
most significant 191 to CE\ of the least significant 191 and 190.
At the same time you load the number you want to convert into the
191's, load zeroes into the 190's and allow both counters to start
counting. When the counters stop counting, the 190's will contain
the BCD equivalent of what you loaded into the 191's. 30盜, give or
take, for the conversion using a 10MHz clock and about five bucks
for the chips.
---
John Fields
Professional circuit designer
http://www.austininstruments.com


John Fields

unread,
Nov 28, 2002, 8:14:27 AM11/28/02
to
On Thu, 28 Nov 2002 13:01:36 GMT, jfi...@texas.net (John Fields)
wrote:

---
Oops...

You have to AND TC from both chips before feeding it back to CE\.

Gary Tait

unread,
Nov 28, 2002, 11:13:15 AM11/28/02
to
On Thu, 28 Nov 2002 11:09:27 GMT, "Yi-Zen Chu; Yiren Qu" <""y i z e

n \"@ u c l i n k 4 . b e r k e l e y . e d u>
wrote:

>Yi-Zen Chu; Yiren Qu wrote:

For that makes 3 4 bit numbers., of which the hundreds have 2 bits,
and the lower 3 bits on the units does not need conversion ( i think),
therefore requiring only 7 bits on an EPROM.

Spehro Pefhany

unread,
Nov 28, 2002, 11:23:44 AM11/28/02
to

That might be the best way if we were using a PLD or making a chip-
throwing 1M bits at a problem that can be solved with a few dozen
gates would be insane.

I don't know about doing something like arcsin(x) fast (say in a
microsecond or thereabouts), maybe in an FPGA you could do a CORDIC
algorithm in hardware that fast.

Another silly method would be to use a microcontroller. While
there are certainly faster ways, I tested a simple program
that just waits for a falling edge on an input pin then reads
a port, and outputs packed BCD on two ports. Written in C, it
takes around 60-70usec to execute at 5 MIPS.

Something like this:

/* must initialize a bunch of stuff first- left as exercise */

unsigned char a, b;
for (;;)
{
while (1 == RD7); // wait for falling edge
a = PORTA; // sample data once, here
b = a % 10; a /= 10; // LS digit
PORTD = ((a % 10) << 4) | b;
PORTC = a/10; // MS digit
while(0 == RD7); // wait for return to 1

Fred Bloggs

unread,
Nov 28, 2002, 12:06:07 PM11/28/02
to

It's a bit-instruction intensive add-3 algorithm that requires shifting
of the BCD result nibbles. It iteratively multiplies the BCD nibbles by
shift lefts but before this is done each nibble must have 3 added to it
if >5- a simple variant of the add-6 decimal adjust.

There was a 74XXX MSI that performed the conversion nibble-wise
combinatorially- but the number of chips required grew as some
ridiculous thing like 10^(nibbles) or something unusable like that.

If the number of digits is large then the answer is a uproc. If it's
small like 2-4 digits then a CPLD using a simple counter algorithm is
far more useful than EPROM. For an 8-bit binary to 12-bit BCD, this is
only 20 bits, and say 7 bits for a BCD-7-segment encoder for subtotal 27
bits, leaves 9 macrocells open for display mux'ing, input latching, and
other tasks in the low-end Xilinx XC9536-15PC44C from Xilinx at $3.30
unit quantity available from their website or DigiKey. The fitting and
design software is free- handles nearly any reasonable design entry
method, but the parallel port programming cable is a bit pricey at $95.

Arie de Muynck

unread,
Nov 28, 2002, 1:51:49 PM11/28/02
to

"Paul Burke" wrote

> There is an algorithmic way to do the conversion on an incoming stream
> of data. All I can remember about it was that it was in an old
> programmable logic applications book (over 15 years ago)- perhaps MMI? A
> colleague implemented it in software on a 6809 and all I can say is it
> worked, and saved a few vital bytes compared with divides or repeated
> subtraction. Took an age though.

Something like this?
Arie de Muynck

;--------------------------------------------------------------------------
; BIN24BCD.ASM
;
; Fast 24-bit binary to packed BCD conversion for AVC51_3
; Small model.
;
; 990822 AdM initial version
;--------------------------------------------------------------------------

global stack_internal
defseg c_text,class=CODE
seg c_text

_R equ 0 ; register bank 0

;--------------------------------------------------------------------------
; unsigned long bin24bcd( unsigned long bin)
;
; Convert 24 bits to 8 digits packed bcd.
;
; On entry, ?_bin24bcd+0...3 holds binary value (MSB..LSB).
; The lower 24 bits get stored into R0-1-6.
; On exit, R4-5-6-7 holds packed BCD (MSB...LSB).
;
; Algorithm:
; When the BIN value is leftshifted into the BCD result, each bit that
; would crossover into a higher nibble is really 16, so the BCD result
; is then corrected by adding 6 to the lower nibble. Also, nibbles above 9
; are corrected by subtracting 10 from the lower nibble and adding 1
; to the higher one (this is faster if we just add '6', the two's
; complement of 10, to the byte).
;
; Here it is even faster because we add 3 to the lower nibble BEFORE the
; shift, if the result then is > 7 a transfer of the highest bit to the
; next nibble would occur after the shift, so the transfer and the adding
; of 6 would be OK after the shift (6 = 3<<1). If not, the nibble is
; preserved by subtracting 3 again. Each nibble will never be > 9 so the
; checks for nibble values > 9 need not be made.
;
; Algorithm by Alexander Eisen, Electronic Design March 18 1996.
; Converted to Avocet C51 by A. de Muynck.
;
; Speed: about 1900 cycles (normally: printf("%8lu",..) takes 25700 cycles!)
;--------------------------------------------------------------------------

global _bin24bcd ; setup signatures for linker
signat _bin24bcd,4220 ; including call graph info
fnsize _bin24bcd,0,4

global ?_bin24bcd ; param _bin assigned to ?_bin24bcd+0..3

db ?_bin24bcd ; WHY??

_bin24bcd:
mov a, ?_bin24bcd ; get MSB
jz do24 ; if > 24 bits (0..16777215)
mov r2, #99h ; return 99999999
mov r3, #99h
mov r4, #99h
mov r5, #99h
ret
do24:
mov r0, ?_bin24bcd+1 ; move lower 24 bits to R 0-1-6 (MSB..LSB)
mov r1, ?_bin24bcd+2
mov r6, ?_bin24bcd+3

clr cy ; prepare shifting
mov r2, #0 ; BCD = 00000000
mov r3, #0
mov r4, #0
mov r5, #0
mov b, #24 ; bits = 24
shloop: ; do
xch a, r6 ; shift left BIN into BCD, 1 bit
rlc a ; R2345 <-- R016 <-- 0
xch a, r6
xch a, r1
rlc a
xch a, r1
xch a, r0
rlc a
xch a, r0
xch a, r5
rlc a
xch a, r5
xch a, r4
rlc a
xch a, r4
xch a, r3
rlc a
xch a, r3
xch a, r2
rlc a
xch a, r2
djnz b, next ; if (--bits == 0) return BCD in R4567
ret
next:
mov a, r5 ; get two LSB nibbles of BCD
call adj_bcd ; adjust them
mov r5, a
mov a, r4 ; same for others
call adj_bcd
mov r4, a
mov a, r3
call adj_bcd
mov r3, a
mov a, r2
call adj_bcd
mov r2, a
sjmp shloop ; while (1)

;----- sub. adjust both BCD nibbles

adj_bcd:
add a, #03h ; adjust low nibble
jb acc.3, lo ; if > 7
add a, #256-03h ; restore
lo: add a, #30h ; adjust hi nibble
jb acc.7, hi ; if > 127
add a, #256-30h ; restore
hi: ret

;-------------------------------- eof -------------------------------------

end


Ash

unread,
Nov 28, 2002, 2:39:32 PM11/28/02
to
I've been trying to find a simple way to converting 8-bit paralell binary
to BCD for a displaydriver but haven't found the 'magical' way to do it.
All suggestions I've got are to use eproms or microcontrollers,
well sure - I can program eproms and pic's ... but I cant create the programs
since I dont know programming..
Let me know if you find a working solution with logic circuits please :)

//Greg

Frank Bemelman

unread,
Nov 28, 2002, 3:13:54 PM11/28/02
to

"Ash" <a...@gravitywell.org> schreef in bericht
news:3DE670F5...@gravitywell.org...

Hmm... you could try a binary counter, incremented by whatever clock is
available, use the same clock to increment a dual bcd-counter, compare
the *binary* result with your input, and when both are equal, inhibit the
clock to both counters. Add flipflops and latches to make it all foolproof
;)

--
Thanks,
Frank Bemelman
(remove 'x' & .invalid when sending email)


kilowatt

unread,
Nov 28, 2002, 6:43:16 PM11/28/02
to
Gary Tait <ta...@hurontel.on.ca> wrote in message news:<gvfcuuc9m6kemjc0p...@4ax.com>...

From (kilowatt)

First time poster to this group, looks like a cool topic.

I have(2)of the 74185's but yes, they are no longer available.

I still have a Texas Instruments Data book that lists the truth table
(input vs output bits) This way one could program a chip like the 16V8
or 10's to replace the old ti part.

FYI, Texas Instr. also made a BCD to Bin converter. I have lots of
them but not of use to you. 74184.

ciau
Jerry, chip guru

chris

unread,
Nov 28, 2002, 6:43:40 PM11/28/02
to
Ash <a...@gravitywell.org> wrote in message news:<3DE670F5...@gravitywell.org>...

Hi, look up 74184,74185 to see how to do it the old way! maybe then
you will take the advice allready given.

Tony Williams

unread,
Nov 29, 2002, 3:21:08 AM11/29/02
to
In article <3de679ec$0$157$1b62...@news.euronet.nl>,
Frank Bemelman <beme...@euronet.nl.invalid> wrote:

> Hmm... you could try a binary counter, incremented by whatever clock is
> available, use the same clock to increment a dual bcd-counter, compare
> the *binary* result with your input, and when both are equal, inhibit
> the clock to both counters. Add flipflops and latches to make it
> all foolproof ;)

That's similar to JF's more standard suggestion.
Load the BIN counter with the binary unknown,
zero the BCD counter, count down the BIN, count
up the BCD, when BIN=0, BCD= right answer. Only
about 5 or 6 chips. :-)

The cost of doing BIN-BCD explains why early uPs
often had a BCD arithmetic facility, or the odd
little hooks for it.

--
Tony Williams.

Frank Bemelman

unread,
Nov 29, 2002, 4:40:33 AM11/29/02
to
"Tony Williams" <to...@ledelec.demon.co.uk> schreef in bericht
news:4b9ce34...@ledelec.demon.co.uk...

> In article <3de679ec$0$157$1b62...@news.euronet.nl>,
> Frank Bemelman <beme...@euronet.nl.invalid> wrote:
>
> > Hmm... you could try a binary counter, incremented by whatever clock is
> > available, use the same clock to increment a dual bcd-counter, compare
> > the *binary* result with your input, and when both are equal, inhibit
> > the clock to both counters. Add flipflops and latches to make it
> > all foolproof ;)
>
> That's similar to JF's more standard suggestion.
> Load the BIN counter with the binary unknown,
> zero the BCD counter, count down the BIN, count
> up the BCD, when BIN=0, BCD= right answer. Only
> about 5 or 6 chips. :-)

Yes, it is terrible. At the moment I am designing a
board that is going to be terrible as well. Nothing 'fits'
and I need the craziest stuff to 'connect' everything
together, lots of half-used ic's etc, really beyond
the point of being funny ;)

Now, all of a sudden, I read my own text above, and notice
that I used the word 'inhibit'. When choosing labels in
my schematics, I always use 'disable'. Seems like a
rather old-fashioned word, 'inhibit'. Never mind.

> The cost of doing BIN-BCD explains why early uPs
> often had a BCD arithmetic facility, or the odd
> little hooks for it.

8051 has a few BCD instructions I believe, but never
knew what to do with it ;)

Tony Williams

unread,
Nov 29, 2002, 6:34:58 AM11/29/02
to
In article <3de7361e$0$170$1b62...@news.euronet.nl>,
Frank Bemelman <beme...@euronet.nl.invalid> wrote:

> 8051 has a few BCD instructions I believe, but never
> knew what to do with it ;)

They are there as an IQ test Frank.........

--
Tony Williams.

Jonathan Bromley

unread,
Nov 29, 2002, 9:44:20 AM11/29/02
to
On Thu, 28 Nov 2002 21:13:54 +0100, "Frank Bemelman"
<beme...@euronet.nl.invalid> wrote:

>"Ash" <a...@gravitywell.org> schreef in bericht
>news:3DE670F5...@gravitywell.org...
>> I've been trying to find a simple way to converting 8-bit paralell binary
>> to BCD for a displaydriver

>Hmm... you could try a binary counter, incremented by whatever clock is


>available, use the same clock to increment a dual bcd-counter

Take a look at http://www.xilinx.com/xapp/xapp029.pdf for a
sensible, simple bit-serial method. Something similar has
already been mentioned in this thread, but XAPP029 shows very
clearly how to do it in hardware. You need 4N clock cycles
to generate an N-digit result.

In an FPGA you would create a copy of the decimal-shifter for
each output digit, but with a bit of ingenuity you could
recirculate the data around just one digit's-worth of
shifter. That'll cost you at least 4N^2 clocks per result.

Cheers
--
Jonathan Bromley

Frank Bemelman

unread,
Nov 29, 2002, 10:30:35 AM11/29/02
to

"Jonathan Bromley" <jona...@oxfordbromley.u-net.com> schreef in bericht
news:3de77c8b...@news.u-net.com...

> On Thu, 28 Nov 2002 21:13:54 +0100, "Frank Bemelman"
> <beme...@euronet.nl.invalid> wrote:
>
> >"Ash" <a...@gravitywell.org> schreef in bericht
> >news:3DE670F5...@gravitywell.org...
> >> I've been trying to find a simple way to converting 8-bit paralell
binary
> >> to BCD for a displaydriver
>
> >Hmm... you could try a binary counter, incremented by whatever clock is
> >available, use the same clock to increment a dual bcd-counter
>
> Take a look at http://www.xilinx.com/xapp/xapp029.pdf for a
> sensible, simple bit-serial method. Something similar has
> already been mentioned in this thread, but XAPP029 shows very
> clearly how to do it in hardware. You need 4N clock cycles
> to generate an N-digit result.

Yes, I missed that post of John Fields. "Ash", not the OP btw,
asked for something he can build out of standard components.
There is no simple solution, if you can only use standard logic.

The appnote deals with serial data, not parallel.

[snip]

Tony Williams

unread,
Nov 29, 2002, 10:27:06 AM11/29/02
to
In article <3de77c8b...@news.u-net.com>,
Jonathan Bromley <jona...@oxfordbromley.u-net.com> wrote:

Hello stranger........

--
Tony Williams.

Jonathan Bromley

unread,
Nov 29, 2002, 11:48:07 AM11/29/02
to
On Fri, 29 Nov 2002 16:30:35 +0100, "Frank Bemelman"
<beme...@euronet.nl.invalid> wrote:

>There is no simple solution, if you can only use standard logic.

I have a pretty hard time imagining anyone doing electronics
these days who doesn't think of programmable logic as "standard".
FPGAs and CPLDs are so cheap, versatile and ubiquitous; and
ye olde "standard" logic is so hard to get hold of, unless you
want boring octal buffers and that kind of stuff.

>The appnote deals with serial data, not parallel.

but serialising it is so easy - especially if you have
some programmable logic :-)

cheers
--
Jonathan Bromley

Jim Thompson

unread,
Nov 29, 2002, 12:31:34 PM11/29/02
to
On Thu, 28 Nov 2002 02:08:18 GMT,

"Yi-Zen Chu; Yiren Qu" <""y i z e n \"@ u c l i n k 4 .
b e r k e l e y . e d u>,
In Newsgroup: sci.electronics.design,
Article: <mUeF9.151366$NH2.11112@sccrnsc01>,
Entitled: "? Binary to BCD conversion chip ?",
Wrote the following:

|Hello everyone,


|
|Does anyone know if there's any IC chip commercially available that can

|convert a 4 (or 8 bit) number to BCD? Where can I buy it? I tried
|looking up on the Net but only found 74185, which seemed to be discontinued?
|

|Thanks for the help!
|
|Yi-Zen
|
|PS. Sorry for the cross-posting; I'm not sure where this question should
|be addressed.

4-bit is trivial, requiring around 10 gates and 3 inverters. 8-bit
would be a royal bitch ;-)

See http://www.puz.com/sw/karnaugh/index.htm for a nice tool (KMAP445)
to work out the logic.

There is also http://www.patdouble.com/switchmin/switchmin.htm but
this link is down right now.

SwitchMin can handle up to *32 inputs*, but is much more difficult to
work with than KMAP (at least for us analog types ;-)

...Jim Thompson
--
| James E.Thompson, P.E. | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona Voice:(480)460-2350 | |
| Jim-T@analog_innovations.com Fax:(480)460-2142 | Brass Rat |
| http://www.analog-innovations.com | 1962 |

For proper E-mail replies SWAP "-" and "_"

I love to cook with wine. Sometimes I even put it in the food.

Roger Hamlett

unread,
Dec 5, 2002, 5:15:53 AM12/5/02
to

"Yi-Zen Chu; Yiren Qu" <""y i z e n \"@ u c l i n k 4 . b e r k e l e y . e
d u> wrote in message news:mUeF9.151366$NH2.11112@sccrnsc01...

> Hello everyone,
>
> Does anyone know if there's any IC chip commercially available that can
> convert a 4 (or 8 bit) number to BCD? Where can I buy it? I tried
> looking up on the Net but only found 74185, which seemed to be
discontinued?
>
> Thanks for the help!
Others have allready suggested using an EPROM, but it is also worth asking
what sort of speed is required, and whether there are any other functions
that need to be done?. One reason these chips have disappeared, is that this
sort of decoding can be done so easily in a microprocessor now, and in many
cases with less power consumption. For example, the same logic as the 74185,
could be generated in a basic PIC, that in the UK, costs about £1.50 in one
off quantities. Using it's own internal oscillator (so no need for a
crystal), the conversion could be coded in about half a dozen instructions
(using a look up table), giving a latency of perhaps 10uSec. This sort of
chip, consumes uA, so provided the speed requirement is slow, could well be
an economic solution. If the total conversion required is more complex
(perhaps feeding seven segment displays), this type of choice becomes even
better, since a slightly larger chip could be programmed to directly drive
the digit segments, removing the need for a seperate BCD to seven segment
converter. I also have to ask where the binary patterns are coming from?. In
many cases, applications that used this type of chip in the past, can now be
done using other products, that give BCD directly.
You mention coding just 4 or 8 bits 'sections', which is very easy to do in
a 'look up table' solution (this is the EPROM that has allready been
suggested), the only problem with this solution, is finding small ROMs these
days.

Best Wishes


S. Marget MacLeod - Silberstein

unread,
Dec 5, 2002, 10:53:03 PM12/5/02
to
"Roger Hamlett" <rogerspa...@ttelmah.demon.co.uk> wrote in message news:<CRFH9.720$qa6....@newsfep1-gui.server.ntli.net>...

Dear friends-

I have a related question: Does anyone kow of a good way to convert 12
bit binary to bcd? This comes after a 12 bit ripple counter that will
count to 4096 in one second.

Thanks,
Marget

Spehro Pefhany

unread,
Dec 6, 2002, 1:29:16 AM12/6/02
to
On 5 Dec 2002 19:53:03 -0800, the renowned sma...@hotmail.com (S.

Marget MacLeod - Silberstein) wrote:

>
>I have a related question: Does anyone kow of a good way to convert 12
>bit binary to bcd? This comes after a 12 bit ripple counter that will
>count to 4096 in one second.

Replace or parallel the counter with a 4 digit BCD counter- much
easier than converting.

Ken Smith

unread,
Dec 6, 2002, 1:16:03 PM12/6/02
to
In article <f39e66c2.02120...@posting.google.com>,
S. Marget MacLeod - Silberstein <sma...@hotmail.com> wrote:
[...]

>Dear friends-
>
>I have a related question: Does anyone kow of a good way to convert 12
>bit binary to bcd? This comes after a 12 bit ripple counter that will
>count to 4096 in one second.

Why not use a BCD counter?

--
--
kens...@rahul.net forging knowledge

petrus bitbyter

unread,
Dec 6, 2002, 2:36:55 PM12/6/02
to
>
> Dear friends-
>
> I have a related question: Does anyone kow of a good way to convert 12
> bit binary to bcd? This comes after a 12 bit ripple counter that will
> count to 4096 in one second.
>
> Thanks,
> Marget

Marget,

Your question is not only related, it's (almost) the same. So all answers
you have for an eight bit conversion will do (or not) for the twelve bits
conversion as well. Assuming your counter is given and the need for BCD is
given as well, the easiest way is programming a 16 bits EPROM. You can use
two 8 bits EPROMs as well. It will require some space but don't forget you
should have needed eight 74LS185 chips to do the trick. (An eight bits
conversion requires only three of them.)
You can use counters with some control logic. Chipcount and conversion time
may become a problem.
A microcontroller will also do the job, but you will need a big one as you
need twentyeight i/o-pins. (Of course you can multiplex i/o but at the
expence of some extra buffer/registers.) If you want to convert fast, you
will have to use table- lookup wich will require the same amount of memory
as the EPROMs mentioned earlier.

pieter

Richard Steven Walz

unread,
Dec 7, 2002, 5:51:53 PM12/7/02
to
In article <6qjF9.160687$QZ.26861@sccrnsc02>,

Yi-Zen Chu; Yiren Qu <""y i z e n \"@ u c l i n k 4 . b e r k e l e y . e d u> wrote:
>Thanks for responding to my questions.
>
>Could you guys educate me on what an EPROM is? I am a newbie to
>electronics. How do I program it?
>
>Yi-Zen
-------------------
You were given Atmel reading material on this thread. Read it.

An EPROM is a number-in/number-out box. All numbers in are programmed with
a number out. When you want to get a number back out, you put the right
input nunber in, called an "address". The number that comes out is called
the "data". You can program ANY data into ANY address, if it's not bigger
than the size of the EPROM.

As for how to program it, read the PDF databook file for that EPROM.
-Steve
--
-Steve Walz rst...@armory.com ftp://ftp.armory.com/pub/user/rstevew
Electronics Site!! 1000's of Files and Dirs!! With Schematics Galore!!
http://www.armory.com/~rstevew or http://www.armory.com/~rstevew/Public

0 new messages