Тёмный

Designing an 8-bit CPU - 6 - program counter 

Phodopus42
Подписаться 472
Просмотров 3,7 тыс.
50% 1

This time, I've got my program counter working.
Again, my camera was keen to focus on wires and not the board. I filmed it late and didn't notice until later :(

Наука

Опубликовано:

 

18 май 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 20   
@DavidLatham-productiondave
@DavidLatham-productiondave Месяц назад
No worries when real life gets in the way of hobby projects. I'm enjoying watching your progress.
@phodopus42
@phodopus42 Месяц назад
Awesome. Thank you 😄
@MikhailGoncharov-tl4cr
@MikhailGoncharov-tl4cr Месяц назад
it's so exiting at all. thanks
@phodopus42
@phodopus42 Месяц назад
Thanks!
@lawrencemanning
@lawrencemanning 25 дней назад
Very interesting project. Thanks for taking the effort to document what you are up to. Was surprised to see PC relative addressing, as that’s generally considered a luxury on small systems like this is shaping up to be. Curious whether this will be microcoded or sequenced in a GAL or CPLD, but I suspect it’ll end up needing a fairly wide ROM? The ALU is also gonna be interesting to see as, again, there’s a fair few approaches. Anyway, glad I found your project! Looking forward to the next instalment. 😊
@phodopus42
@phodopus42 13 дней назад
Thank you for your comment! I've already used some GALs because the alternative logic with "pure" 74-series would be cumbersome. (Also, I bought too few of some chips on my last order, so had to use a GAL to compensate.) I've not played with CPLDs. I think Xilinx is stopping manufacture of the common CPLDs, I guess with the reason being that FPGAs have been a thing for long enough now. I remember seeing a FPGA run the game of life at university, supposedly faster than the contemporaneous Pentiums. I'm struggling to get time to play with the project, sadly. My work has hit a crunch point and my energy has been zapped. I will have some significant changes in my next video. I think I'm getting somewhere with the decoding / pipeline design. Anyway, thank you again and hope you enjoy!
@lawrencemanning
@lawrencemanning 12 дней назад
@@phodopus42 just reading about AMD knocking the head on the CPLD. The distinction is certainly blurry now with FPGAs available with nonvolatile storage, which was one of the key differences. But historically CPLDs and arguably even today they have different uses; small amounts of logic that doesn’t justify a FPGA or ASIC. Hopefully Atmel erm microchip will keep manufacturing their Altera MAX7000 clones. I made good use of MAX7000s in my 6809 and later 68000 boards. You can even get them in 44 pin PLCC so you can jam one in a breadboard. One would work in your projects, but the software can be a pain to find these days. Project burnout is a thing, which is why I try to have two on the go. Hobbies are about having fun, so don’t feel bad having break. Anyway, take it easy! If you want a look at my crappy channel... You might find something interesting. :)
@phodopus42
@phodopus42 4 дня назад
@@lawrencemanning Nice -- just checking out your videos after a long week at work 😀 I think chip manufacturers can't really justify supporting electronics hobbyists long-term. I can see that DIP as a package is going to disappear at some point, with some chips pretty much impossible to find in that format. I ordered some 74-series from a Well-Known Distributor 2.5 years apart and got DIP chips from the same batch. I guess repairing 80s computers will, in 10-20 years, become like repairing valve-computers is now 😕
@phodopus42
@phodopus42 4 дня назад
P.S. your channel can't be worse than mine 🤣
@0toleranz
@0toleranz Месяц назад
You might keep in mind you also want to output the program counter to the data bus so it can be pushed onto the stack before a jump to a subroutine and later read back of course.
@phodopus42
@phodopus42 Месяц назад
This is a very good point! I had forgotten about JSR instructions. I was going to use a register pair r7:6 for the link address (like ARM uses r14). I'd need a way to get the address back to the register file. It sounds like I have some more rewiring to do 😆
@io1921
@io1921 4 дня назад
software for schematics ?
@phodopus42
@phodopus42 4 дня назад
Hi there. I use KiCad. It works nicely under Linux, so that's a huge plus for me! My biggest issue is that adding variants (e.g. 74AHC chips) to the library is a bit tedious. But it's pretty awesome for free software.
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt Месяц назад
6502 uses the ALU for relative addressing. RISCV uses the ALU for compare. Your branch seems to not use the ALU at all. Who ever uses PC relative addressing? Is it for switch case? So you have low integers, or a good hash, and then some addresses around your current instruction are filled with function pointers? Why not roughly match the size of case branches and shift left the integer to convert it into an address? Or use the hash? Or just a tree of branches? Hybrid. Ah, optimising compiler. So it is for switch(enum) only. In RISCV and MIPS there is only one addressing mode: register+immediate . Register 0 is always 0 . Program pointer cannot be read. All other 31 names are for GPR .
@phodopus42
@phodopus42 Месяц назад
Thank you, interesting thoughts! ARM uses PC-relative a lot because there's no absolute addressing. It works well as long as you can keep your data close to your code. I remember tricks like putting constants at the end of a function so that they are within the accessible range. So I was going for PC-relative instead of absolute addressing. It also makes it easier to write relocatable code, which is a real pain on the 6502, not that it matters with no MMU and a 16-bit address space 😮
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt Месяц назад
@@phodopus42 a quick search tells me that this addressing is only used to load Immediates which don’t fit into the instruction. RISCV can load 24bit immediates, enough for the whole address range of a 68000. JRISC just lets immediates follow in the instruction stream like 6502 does it. With 32 registers in RISCV you load each all constants at the smallest block scope. I can see how 16 register Arm wanted to save registers and memory.
@phodopus42
@phodopus42 Месяц назад
​@@ArneChristianRosenfeldtI think you might be right. If I have 8-bit registers, then a "load immediate" will suffice for loading constants. I do need something for code in ROM to access scratch RAM. The 6502 did this by adding zero-page addressing. That's maybe what I will go with. Thanks again for interesting ideas.
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt Месяц назад
@@phodopus42 high level languages for some reason don’t use a scratchpad, but a stack and a heap. With a base pointer and this pointer (BX in x86?) . 6800 has 16 bit pointers. I may repeat myself here, but RCA showed that 16 * 16 bit did fit on a die, even in somewhat larger CMOS logic.
@RelayComputer
@RelayComputer Месяц назад
@@ArneChristianRosenfeldtThere is actually a number of processors that can use the PC as the base register for relative mode addressing. On most cases the instructions to do so are provided just as a matter of encoding orthogonality, not that they are used very often. However there's a critical difference between PC relative and GPR relative modes when talking about Harvard's architecture processors, because the first mode will access program memory while the second one will access data memory
Далее
I built my own 16-Bit CPU in Excel
16:28
Просмотров 1,4 млн
Designing an 8-bit CPU - 1 - project goals
11:21
Просмотров 1,4 тыс.
🥔 Sloppy Joe Potato Casserole ~#Shorts
00:23
Просмотров 4,2 млн
I Designed My Own 16-bit CPU
15:46
Просмотров 1,9 млн
Custom Keyboard From Scratch Part 2
17:13
Просмотров 17 тыс.
The Magic of RISC-V Vector Processing
16:56
Просмотров 213 тыс.
Pentium Pro, was it a lemon ?
24:27
Просмотров 70 тыс.
I built my own computer. by hand.
13:03
Просмотров 1,1 млн
CRAFTING A CPU TO RUN PROGRAMS
19:49
Просмотров 45 тыс.
#miniphone
0:16
Просмотров 3,5 млн
Купил iPhone 15. Первые эмоции!
0:58