From: Spehro Pefhany
Subject: Re: ? Binary to BCD conversion chip ?
References: <email@example.com> <firstname.lastname@example.org>
X-Newsreader: Forte Agent 1.92/32.572
Date: Thu, 28 Nov 2002 16:23:44 GMT
NNTP-Posting-Date: Thu, 28 Nov 2002 11:23:44 EST
On Thu, 28 Nov 2002 08:46:17 +0000 (GMT), the renowned Tony Williams
>In article <email@example.com>,
> Spehro Pefhany 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........
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;
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
"it's the network..." "The Journey is the reward"
firstname.lastname@example.org Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.co