Kids can do math better than x86 cpu's.

In article , Skybuck Flying wrote: [....]

The CDP1802 did its math 1 bit at a time. The Z80 did internal stuff in groups of 4 bits. The 8080 did some things in 8 or 16 bits. The PDP-8 did 12 bits. The 68000 did 16 bits. Everyone does a limited number of bits at a time. [....]

What you mean "we".

If a processor did everything required in one instruction, there would be no need for programmers to write multiple instruction programs.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith
Loading thread data ...

Really? One times one is three? One times zero is one? I'd say that's rather stupid.

Where is that in your table above.

Just because 2+2=4 and 2*2=4 doesn't mean the '+' and '*' operator are the same.

Ten plus ten is twenty?

--
  Keith
Reply to
krw

How much money are you willing to supply? I can guarantee that anything less than six or seven hundred dollars will get you told to f*ck yourself, especially when a minimum wage job will make more money and won't be nearly as tedious.

Reply to
AZ Nomad

The _only_ problem with this approach is that these days google makes posts last forever, which means that X years from now some unfortunate soul might hit upon a Sky post in response to a search for real information. With zero gainsayers said soul might even believe it. :-(

Terje

--
- 
"almost all programming can be viewed as an exercise in caching"
Reply to
Terje Mathisen

Terje,

Your x86 BCD reference jogs my memory back to 80's on BYTE Magazine's BIX (Byte Information eXchange) teleconferencing system (cosy).

Some of us processor-bigots, in the CPU or CPUs confernece, had an informal my-cpu-is-better-than-yours speed competition involving multiplication of 72-bit unsigned binary integers. The 9 bytes were picked, in theory, so as not to give arbitrary advantage to cpus of particular word sizes.

My entry for Apple /// (8-bit cpu Mostek 6502B) just used the lowest level bit bit-test/add/shifting/carry instructions. The code first determined the 6 10-byte results from one of the multipliers (the one on the left {smile}) when multiplied by 2, 4, 8, 16, 32, 64 and 128. This actually meant 8 results were precalculated in that multiplying by 0 was obvious and multiplying by 1 was already given. The 6 values were done with simple bitshifts/carry/add. Once that was done then the other multipler was processed bit-by-bit right-to-left and answer adjusted/accumulated accordingly just like a school child would do in decimal on paper. Choosing which multiplier (OK, multiplier, multiplicand) to process based on the lower number of 1 was sometimes useful.

This simple-minded low-level approach actually outperformed other cpus including 8086, 8088, z80, 8080, etc. lovingly handcrafted in assembler making use of, ahem, higher instructions.

The code used maybe a half dozen rather simple MACROs. Of course, the fact that there was ample room in the 6502B's "zero page of 256 bytes) to do all the work was a big boost. In effect, the zero page's faster access meant you could treat it as 256 registers.

Cheers, - Jim

Jim Keohane, Multi-Platforms, > Skybuck Fly> > It's not only about reinventing the wheel, it's also about

Reply to
JimKeo

111254223123672372347834547095404083406983406983406830498603984603498693748­657861321231643613279573965234682735912875912374592387592375923759759237592­837598237592375923759273985723985723947541643614361426341642432321231182023­90593740572308652389562397652865
786738628768231441242987629476398458623598369634593645893645983765983658923­765239786538764322313421321121212651212367213712781578342534823745845823482­365834834587230540954098547098509854709857059687059687059687540968754098754­09870457854097845069854097856098348572357862352364528761431654126541

Your CS class must have been cheating by using multipliers.

Try a real class, a skybuck class !

No multipliers available:

Everything must be done with lookup tables and bytes, no words allowed.

I am sure you will find it more then challenging.

P.S.: your cs class can go into the waste basket.

Bye, Skybuck ;)

Reply to
Skybuck Flying

I want to learn what's called "long hand multiplication".

The method thought to kids in high-school.

Which uses look-up tables.

It's highy unlikely such a software library already exists because it would be quite slow.

Bye, Skybuck.

Reply to
Skybuck Flying

I want to learn and see an implementation of what's called "long hand multiplication".

The method thought to kids in high-school.

Which uses look-up tables.

It's highy unlikely such a software library already exists because it would be quite slow.

Bye, Skybuck.

Reply to
Skybuck Flying

Does it use the kiddy method ? (long hand multiplication as thought in school)

Bye, Skybuck.

Reply to
Skybuck Flying

OK.

Please contact your local high school.

R's, John

Reply to
John L

Lets see, there is the MIPS 4500, 5000, and 10000 series, some later Transputers, Sun Ultrasparc (64 bit), DEC Alpha, HP PA-RISC 8900, some late model VAX's, PowerPC G5, and Opterons all have this capability in hardware. Some of this is 20 years old, where have you been?

BTW implementing wide math is not all that difficult. Usually cost or IP issues prevent libraries from being used. I have done the basics (+, -, /, and X) for 6502 and 8051; stretching them from 8 to 32 bits was straightforward is a bit laborious to test. All the necessary assembler (hardware) instructions are present in x86, 68K, PPC, Alpha, and many other architectures (Even including IBM 360/370/390).

--
 JosephKK
 Gegen dummheit kampfen die Gotter Selbst, vergebens.  
  --Schiller
Reply to
joseph2k

You use yours and i'll use properly parmeterized libraries for each target and call them from "C" or whatever HLL; and we can test to see which performs better.

--
 JosephKK
 Gegen dummheit kampfen die Gotter Selbst, vergebens.  
  --Schiller
Reply to
joseph2k

That's the way I'd do a multiple-precision multiply. I'm sure there is another way, but I don't know it.

Ever hear of an FPGA? ;-)

As I said before, the IBM 1620 used lookup tables for its arithmetic (add included). It had no native arithmetic operators at all.

They do exist, for a number of reasons.

--
  Keith
Reply to
krw

There was at least one PDP-8 model (8S?) that did bit serial arithmetic too.

--
  Keith
Reply to
krw

e=20

in=20

et=20

lem=20

603498693748=AD657861321231643613279573965234682735912875912374592387592375= 923759759237592=AD837598237592375923759273985723985723947541643614361426341= 642432321231182023=AD90593740572308652389562397652865
765983658923=AD765239786538764322313421321121212651212367213712781578342534= 823745845823482=AD365834834587230540954098547098509854709857059687059687059= 687540968754098754=AD098704578540978450698540978560983485723578623523645287= 61431654126541

ut=20

36975066=AD0866053304942879984231537943067897694712601511924963938379101922= 64701799646=AD7693753500201567049250263137918035932076754718727578460674626= 63296305368295=AD3542462596305825701489258055255205143723480139275624009749= 76378536354699695=AD
8405=AD62858668918874516573028372141913565341690326646001016936780035890683= 7797232=AD72497823743536996507912615301781952286119024476400241536169635474= 9986226338=AD6141535774330150101189965

=20

gal=20

.

in

.
t

the

s
69\
22\
74\
24\
07\
69\
95\

=20

=20

er=20

I=20

nna=20

's=20

What's the difference between a multiplier and a lookup table? If=20 you poke one can you tell the difference?

No thanks. I couldn't stop laughing.

Are there multipliers that work?

Fine, that's easy.=20 =20

Nope. It's trivial. =20

DOn't need a CS class. I learned how to do the above in fifth grade=20 (in any base that floats your boat).

--=20 Keith=20

Reply to
krw

Yes. it was the "S". Also the 8051 was serial internally.

There was also the MC14500.

If you had enough 2900s, you could do any number of bits.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

Never knew the 8051 was serial, though it makes sense when I think about it (12/24 clocks per cycle).

There's the answer to Skynut's multiple precision problem!

--
  Keith
Reply to
krw

[....]

Those plus a 200A +5V supply.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

With discrete transistors!

The Data General NOVA was a 16-bit machine that used nibble math, with a single 4-bit ALU, as I recall.

John

Reply to
John Larkin

The 6502 family was made by MOS Technology, not Mostek.

--
Service to my country? Been there, Done that, and I\'ve got my DD214 to
prove it.
Member of DAV #85.

Michael A. Terrell
Central Florida
Reply to
Michael A. Terrell

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.