[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [f-cpu] Status quo



Good morning y'all,

>> I think any new design
needs some sort of decimal arithmetic
>> ...

I don't agree at all, for many reasons,
but the right place to discuss this is usenet:comp.arch.

Whoaa... Why so rude?

If I remember correctly, the first CPUs were all able to do some BCD arithmetics. The 6502 for example has had a decimal flag. It could be set via CLD and SED (CLear Decimal and SEt Decimal). All following adds and subs were subsequently done in BCD arithmetics.

The Z80 has had the DAA (Decimal Adjust Accumulator) Opcode. It didn't convert a hex number into a decimal one, but at least it managed the carry bits. From a 4A it converted a 50. A B2 was transformed into a 12 and a set carry flag.

So it's definitely not a "new" feature, but a rather old one.

On the other hand, it might come in handy to have some BCD features while creating a library for handling abritary long numbers. Calculating pi, large primes for RSA keys, whatever.

And the best of it: It wouldn't disturb the design of the f-cpu at all. It's written in VHDL / Verilog at first. So we all can activate or deactivate a few lines of code via a software switch to enable or disable a BCD unit in the f-cpu.

Just my 2 cents....

Ralf


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature