Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Zero instruction langagues

Options
  • 29-08-2003 9:30pm
    #1
    Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 91,672 Mod ✭✭✭✭


    in the early days of computers rather than build complex logic units they used lookup tables for complex mathematical functions (like addition etc.)

    Does any one know of links to them or better still yet a list of the primitives nessary to create such language ?


Comments

  • Registered Users Posts: 491 ✭✭Silent Bob


    You can do bizarre things with C++ templates that cause any complicated functions (like sine/cosine etc.) to be calculated at compile time (assuming you use immediate operands).

    As for creating lookup tables you don't need a special language for that, any of them will do. Just create a table use operand 1 for row indexing, operand 2 for column indexing and store the result.

    Of course you will still need to access it programatically with memory reading and so forth. Unless your entire table fits in the cache at the same time then it will probably be quicker just to do the calculation rather than having to read memory and have the process out of the CPU etc.

    If you want your hardware to do this table lookup automagically then you need new (old:)) hardware.


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 91,672 Mod ✭✭✭✭Capt'n Midnight


    If I can reduce the instruction set to the bare minimum, and the word size to one byte then it should be possible to make a lookup tabe for every combination of op code / pair of operands

    ie make a "processor" from a ROM (if fact if you had a big enough table you could also include flags into it too.. or only use flags with single operand instructions)

    eg: AND A,B - for an 8 bit word only means 64K table

    Note: If you can replace two operand instruction with several different single operand ones it would reduce the table size.

    When finished a lot of optimising of the values of the op-codes should further reduce the table size too.

    Also no pentium type bugs ....


  • Registered Users Posts: 491 ✭✭Silent Bob


    Originally posted by Capt'n Midnight
    If I can reduce the instruction set to the bare minimum, and the word size to one byte then it should be possible to make a lookup tabe for every combination of op code / pair of operands

    ie make a "processor" from a ROM (if fact if you had a big enough table you could also include flags into it too.. or only use flags with single operand instructions)

    eg: AND A,B - for an 8 bit word only means 64K table

    Note: If you can replace two operand instruction with several different single operand ones it would reduce the table size.

    When finished a lot of optimising of the values of the op-codes should further reduce the table size too.

    Also no pentium type bugs ....
    Ahhh, I thought you were looking to do this on a modern processor.

    Is this a final year project or just for the hell of it?

    I have to say that I don't think it will produce a faster 'processor', mainly because of having to access memory all the time but a worthy exercise nonetheless :)


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 91,672 Mod ✭✭✭✭Capt'n Midnight


    Desiging a CPU less computer
    ZISC - as is no instructions just look up's


  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    Interesting idea...

    Surely the math would very quickly spiral to unfeasably large numbers before being able to do anything above the most simple of tasks?

    jc


  • Advertisement
  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 91,672 Mod ✭✭✭✭Capt'n Midnight


    No you just to find out all of the primitives - are there 17 basic instructions ?

    eg: multiplication is just shift and addition
    division is multiplication by recropical of number
    recropical can be done using XOR (and some fancy shifting)
    All of these can easily be done by lookup tables
    to add or subtract two 8 bit numbers you need only 64K per table
    Note: the result would also populate the carry flag and sign flag so the table would hold 10 bits or more..

    You could cheat and sort the numbers first - ie biggest one - this would halve the size of the table - but that's cheating (unless you use a 64K table with a size flag indicating which is bigger)

    since you would not be using this for 3D games most of the coprocessor would be irrelevant - in fact all it needs to be able to do is run an 8 bit C compiler..


Advertisement