Designing my own architecture to be simulated in software - need help with the ISA



Hi. I'm a 17 year old student, I'm about go to university in September.
After the first year, I'll be going into Computer Science or Electronic
and Computer Engineering depending on the preferences I develop in the
first year.

I thought it'd be an interesting idea to pick up some books on digital
design and try to simulate my own architecture in the Python
programming language, without relying on the features of the language
at all. Essentially, I want the code to be transparent for real-world
application so I defined the most basic construct as a NAND gate and
started building on top of that.

Right now I have constructs for a signed adder/subtractor, an
encoder/decoder, and registers made from D-flops. I've gotten to the
point where I need to define clear goals for the project so I can just
focus on the invidual parts of the implementation.

Word length is 32-bit, and the ALU and registers and memory conform to
the standard. Since I want to encode each instruction in only one word,
memory address range is limited to 16 bits. I figure 256KB should be
enough for anyone.

I/O is memory mapped, so I don't need special instructions for those. I
do plan to have graphical output, a 320x240 display with 1-bit color.
This will consume 960 bytes of address space, just to give an example.
I have plenty of room for expansion, and maybe I could even add a
"paper tape" device as permanent storage.

I'm reserving the HO byte of the word for the instruction type, so I
can theoretically have 256 different instructions though I plan to have
much less. The register operands are half-bytes in length, so I can
have a total of 16 registers in the core. The remaining 2 bytes allows
me to address the memory in operations that require it.

I'm very much a beginner, and the reason I undertook this project was
to learn as I go along. I don't have any practical experience with
assembly language, but I understand how it works and I have examined
the instructions for my iBook's PowerPC processor and the MIPS R3000
instruction set.

Unfortunately, experience is something that would be very helpful when
defining an instruction set. I need to know what I need to implement at
the hardware level, and what things I could piece together and simulate
in the assembler.

I'm pretty sure I can allocate 8 of the registers for general purposes,
and I'm allocating the other 8 for special purposes just in case. One
of them will contain the current instruction, one will contain the next
instruction, and one I can use as a pointer for returning from a
branched instruction.

Here's my instruction set so far. I would really appreciate some tips
as to what I could add or remove.

nop - no operation

add - store the sum of two registers in a register
sub - store the difference of two registers in a register

not - store not (contents of register X) in a register
and - store rX & rY in a register
or - store rX | rY in a register
xor - store rX ^ rY in a register
lsh - store rX << rY in a reg
rsh - store rX >> rY in a reg

jmp - jump to instruction at memory address mX
jeq - jump if rX == rY
jne - jump if not equal
jlt - jump if less than
jle - jump if less than or equal

bun - set Branch Return register to instruction below current, set Next
Instruction to mem address mX
beq - branch if equal
bne - branch if not equal
blt - branch if less than
ble - branch if less than or equal


Those of you with more experience in assembler, does this look like an
adequate instruction set for the hardware if I combine it with some
macros in the assembler? Any other tips?

.



Relevant Pages

  • Re: How does this make you feel?
    ... >> XOR instruction that applies to a 1M range of VM; ... > register gives a memory address, and the second gives a byte-count (up ... in a CPU that has one execution pathway. ... instruction set and the specifics of its addressing modes; ...
    (comp.arch)
  • Re: CPU design
    ... 00 load internal register 1 ... For the load and store micro instructions, we have 6 bits for encoding the ... But for this reduced instruction set a compiler would be a good idea. ...
    (comp.arch.fpga)
  • Re: Designing my own architecture to be simulated in software - need help with the ISA
    ... > memory address range is limited to 16 bits. ... > I'm reserving the HO byte of the word for the instruction type, ... The register operands are half-bytes in length, ... > sub - store the difference of two registers in a register ...
    (comp.arch)
  • Re: CPU design
    ... 00 load internal register 1 ... For the load and store micro instructions, we have 6 bits for encoding the ... But for this reduced instruction set a compiler would be a good idea. ...
    (comp.arch.fpga)
  • Re: How does this make you feel?
    ... > instruction was added that allowed you to, for instance, extract a column ... >> + Maybe C and UNIX distorted CPU design, ... > supporting interrupts efficiently was a design goal for the transputer. ... behaviour of a conventionally conceieved register. ...
    (comp.arch)