Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!mordor!sri-spam!rutgers!mit-eddie!bu-cs!bzs From: bzs@bu-cs.BU.EDU (Barry Shein) Newsgroups: comp.arch Subject: Re: More than 32 bits needed where? Message-ID: <19667@bu-cs.BU.EDU> Date: 4 Feb 88 20:40:01 GMT References: <235@unicom.UUCP> <28200089@ccvaxa> <3104@watcgl.waterloo.edu> <3637@diku.dk> Organization: Boston U. Comp. Sci. Lines: 41 In-reply-to: keld@diku.dk's message of 3 Feb 88 17:04:56 GMT Posting-Front-End: GNU Emacs 18.41.4 of Mon Mar 23 1987 on bu-cs (berkeley-unix) >Another use of more than 32 bits is for normal accounting purposes. >31 bits with sign is just able to handle up to 20 million dollars >including cents. Not that impressing. In other currencies this might >only amount to 2 million or 200000 dollars worth. This is only >enough for amateur firms. > >keld This was the motivation for packed decimal instruction sets on many computers aimed at the business market. They typically used "BCD", decimal digits packed one per 4-bit nibble and supported variable length operands up to 15 decimal digits. This put them somewhere between strings and integers in format, one advantage was that they were simple to unpack into decimal strings (usually just a matter of expanding the nibbles to bytes and or'ing in a character zero.) The 370 supports these and pack/unpack in hardware to/from EBCDIC (whoop-tee-doo) and even EDIT and EDMK which will do things like fill on the left with asterisks, put $ signs in and append the characters "CR" all in hardware! Well, it seems to make the COBOL crowd happy. DEC put basically a clone implementation of the 370 decimal instruction set in the VAX tho it may have had some basis in the PDP-11 CIS chip (a coprocessor, "Commercial Instruction Set" which added various opcodes), I don't remember if CIS had packed decimal, probably (you had a spot for either the CIS or an FPU but not both, I worked in science stuff so we always got the FPU although we were always curious if the block move in the CIS would help UNIX's buffer motions, I digress.) Actually, we got an EIS but that's another story (gee Martha, a 32-bit shift instruction AND real hardware multiply and it's only a few thousand dollars! Quick, write a PO!!) I'm sure the packed decimal stuff isn't all that fast tho I have no data (heck, I guess I'd have to mention a machine first, I wouldn't be shocked to hear that some old Burroughs or Nixdorf was faster on BCD than integer) so I'd still agree that a 64-bit integer could be useful, but it's not entirely an unaddressed issue. -Barry Shein, Boston University