[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/diy/ - Do It Yourself

Search:


View post   

>> No.1710091 [View]
File: 67 KB, 909x480, pdp11-45-front-47.jpg [View same] [iqdb] [saucenao] [google]
1710091

Homebrew CPU anon from a few threads back.
I went back and re-worked my CPU architecture, it's much cleaner now.
Registers are now 16-bit instead of 8-bit
I moved the PC into the register file.
I dropped fixed instruction length for a 16/32-bit format, with only two instruction formats.
R-type instructions are three operand register-register, and are 16-bits
I-type instructions are three-operand register-immediate, and are 32-bits.

I want your opinions of branch instructions.
Currently I'm using a flags register, which is set by all dataflow or comparison instructions.
Branches then use the immediate value to hold the offset and use the ALU to calculate the target address.
This allows me to use a single unified datapath, but I'm also really interested in encoding the comparison in the instruction itself, like MIPS does.
In my current micro-acrchitecture, encoding the registers to be compared inside the instruction itself would require me to add a second branch datapath.
Like MIPS, the embedded comparison would be limited to comparing against zero, or between registers. I don't have space to fit both a branch target and an immediate value to be compared against.
Moving the comparison inside of the branch instruction would speed up execution, since a separate comparison instruction won't have to be run, and it helps with interrupts, since I don't have to worry about saving the flags during interrupts.
They both have advantages and disadvantages, but I just can't decide which style would be most useful to implement.
What do you think?

Navigation
View posts[+24][+48][+96]