URL
https://opencores.org/ocsvn/tinycpu/tinycpu/trunk
Subversion Repositories tinycpu
[/] [tinycpu/] [trunk/] [docs/] [design.md.txt] - Rev 3
Go to most recent revision | Compare with Previous | Blame | View Log
This is the design of TinyCPU. It's goals are as follows:1. 8-bit registers and operations (8 bit processor)2. 16-bit address bus3. fixed 16-bit instruction length4. use a small amount of "rich" instructions to do powerful things5. 1 instruction per clock cycleRegister list:r0-r2 general purpose registersip instruction pointer register (represented as r3)cs, ds, es, ss segment registers (code segment, data segment, extra segment, stack segment)tr truth register for conditionalsgeneral opcode formatfirst byte:first 4 bits: actual instructionnext 2 bits: (target) registerlast 2 bits: conditionalsecond byte:first 1 bit: use segment registersnext 1 bit: exchange target and source registernext 2 bits: other registernext 1 bit: dereference first register for memory (respecting the "exchange" bit)next 3 bits: extra opcode information(optional) or last two bits is third register (such as for ADD it could be target=source+third_register)...or second byte is immediate valueFor opcodes requiring 3 registers but without room, the target opcode is assume to be the second operation. Such as for AND, target=source AND targetshort list of instructions: (not final, still planning)0 -nop (doesn't do a thing)1 -move immediate (only uses first byte)2 -move3 -push4 -push immediate5 -push and move (or call when acting on ip)6 -compare (is less than, is less than or equal, is greater than, is greater than or equal, is equal, is not equal) (6 conditions room for 2 more in extra)7 -add8 -subtract9 -bitwise operations (xor, or, and, shift right, shift left, not)x -multiply (if room)x -divideconditionals00 -- always01 -- if true10 -- if false11 -- reserved/not usedpushpopmoveaddsub
Go to most recent revision | Compare with Previous | Blame | View Log
