Exact match. Not showing close matches.
'[OT] Boolean Eq. for BCD to Binary'
I have to implement 3 digit BCD(000-999,12bit) to binary(0x000-0x3E7)
conversion logic on Vantis CPLD(MACH111).
I need ABEL source code or Boolean Eq.
Anybody knows where I can get it?
> I have to implement 3 digit BCD(000-999,12bit) to binary(0x000-0x3E7)
> conversion logic on Vantis CPLD(MACH111).
> I need ABEL source code or Boolean Eq.
> Anybody knows where I can get it?
You can ask in comp.arch.fpga - the audience there offers plenty of tips.
If a 12-bit BCD number is written out as
ABCD EFGH IJKL [a=msb]
it may be converted to binary by multiplying ABCD*100 and EFGH*10,
and then adding those products together with IJKL. Since 10=8+2
and 100=64+32+8, it's possible to rewrite the expression as the sum
of four numbers:
This sum may be performed by using a variety of means; the most ob-
vious would be two use two carry-save adders followed by a full carry
adder; this may be overkill given that only one bit position (bit 3)
has terms on all four lines, but should yield reasonable results none-
Note that if a sequential-logic (rather than combinational) approach is
acceptable, that may simplify things somewhat. The design, however,
would be affected by timing and sequencing requrements; since I don't
know what the requirements are here I wouldn't know where to begin (other
than suggesting that this might be a good application for a PIC...)
|it mostly depends on the amount of processor time you have to compute the
one very simple method is as follows:
given BCD_high, BCD_low
returns answer_high, answer_low
answer = 0;
count = BCD_high // hundreds digit
while ( count )
answer = answer + 100; // use a 16 + 8 bit math routine
count = swap ( BCD_low & 0xF0 ) // tens digit
while ( count )
answer = answer + 10; // use a 16 + 8 bit math routine
count = BCD_low & 0x0F // ones digit
answer = answer + count;
return ( answer );
this may not be the fastest routine, but if you have to processor time the
KISS (Keep it Simple Stupid) will definitely pay off in much less debugging
You may leave the list at any time by writing "SIGNOFF PICLIST" in the
body of a message to MITVMA.MIT.EDU.LISTSERV
From: Marc <AARGH.FRANKEN.DE> marc
To: MITVMA.MIT.EDU < PICLISTMITVMA.MIT.EDU> PICLIST
Date: Tuesday, December 08, 1998 2:04 PM
Subject: Re: [OT] Boolean Eq. for BCD to Binary
>> I have to implement 3 digit BCD(000-999,12bit) to binary(0x000-0x3E7)
>> conversion logic on Vantis CPLD(MACH111).
>> I need ABEL source code or Boolean Eq.
>> Anybody knows where I can get it?
More... (looser matching)
- Last day of these posts
- In 1998
, 1999 only
- New search...