C needs BCD -- why BCD? Accountants!

Guy Harris guy at rlgvax.UUCP
Tue Nov 27 09:38:19 AEST 1984


> >As soon as I/O gets involved, it hardly matters which one is faster
> >computationally. BTW, you can do conversions using shifts and (sorry
> >to say that) BCD arithmetic... but you can write that in assembly
> >language.
> 
> A Fujitsu Eagle transfers data at about 1.8 megabytes per second.  Many
> mainframe disks are even faster.  If you are storing 6-byte (12-digit) BCD
> and are adding two streams, you are transferring 18 bytes per operation.
> Assuming you double-buffer but have only one controller, this is 100K
> operations per second.  You thus have to convert to binary, add, and
> convert back to BCD in approximately 10 microseconds.

Ummmmmmm... isn't there any seek time in there?  Even with IBMish track-at-
a-time reads the heads'll have to move *some*time - and if you're not doing
sequential access of a batch file, but, say, a transaction processing
application they'll be moving more than that.

For that matter, what if the operation involves multiplication or, worse,
division?  BCD *adds* can be done quickly (even 4/8 digits in parallel), but
multiplications and divisions are a major pain.

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy



More information about the Comp.lang.c mailing list