Пікірлер
@JaredDeBlander
@JaredDeBlander 2 ай бұрын
Fantastic series, I look forward to seeing more. Have you played the game Turing Complete? I am working on a custom architecture in that game for my second playthrough of it's advanced section and your video series has been great for food for thought and just enjoyable in it's own right. Sorry to hear about all your breadboard woes, I've thrown out many myself.
@saultube44
@saultube44 3 ай бұрын
Don't be discourage by colleagues, the satisfaction of designing at your own pleasure, comes from freeing the mind and how efficient the project is. Best of lucks👍
@phodopus42
@phodopus42 2 ай бұрын
@@saultube44 Thank you for your kind words! I've been pretty busy with work the past couple of months (completing a project) but I'm still trying to design the decoder logic and how the pipeline will function. I'm getting close now.
@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.
@lawrencemanning
@lawrencemanning 5 ай бұрын
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 5 ай бұрын
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 5 ай бұрын
@@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 🤣
@lawrencemanning
@lawrencemanning 5 ай бұрын
That’s cool. Interesting approach to use a Pico to test the functionality.
@phodopus42
@phodopus42 5 ай бұрын
Thanks. Previously, I'd been using some DIP switches, except that they like to fall out of breadboards because of their short legs 😆
@weirdboyjim
@weirdboyjim 5 ай бұрын
"And then life happened". Doesn't it always!
@phodopus42
@phodopus42 5 ай бұрын
And never little by little - everything happens at once! 😅
@PhilBoswell
@PhilBoswell 5 ай бұрын
I looked at your 65816 project but the playlist is all messed up so I'm starting here instead!
@phodopus42
@phodopus42 5 ай бұрын
Oops, yes it in the wrong order. Thanks for noticing and letting me know 🙂
@akiliinstitute6819
@akiliinstitute6819 5 ай бұрын
Do you have any plans on making a project that can be followed along with?
@phodopus42
@phodopus42 5 ай бұрын
Thank you for asking 🙂 I have github repo with the source of the GALs here: github.com/phodopus42/video/tree/main/src/pld The wiring is pretty boring. Mostly it's connecting an output XYZ to all inputs called XYZ. I did start a schematic in KiCad. Let me dig out some files and see what I can upload. What would be more helpful? A KiCad schematic or diagrams of the breadboard wiring? Or something else? Hires photos of the breadboards? Let me know.
@MikhailGoncharov-tl4cr
@MikhailGoncharov-tl4cr 5 ай бұрын
it's so exiting at all. thanks
@phodopus42
@phodopus42 5 ай бұрын
Thanks!
@BlueChrome
@BlueChrome 5 ай бұрын
You also have the option of going the 68000 route with regard to registers and splitting the register file in two, one half a set data registers and the other half a set of address registers. So only two bits needed to specify a register - with the type of instruction being executed deciding which half of the register file is to be addressed by the hardware.
@phodopus42
@phodopus42 5 ай бұрын
I didn't realise the 68k did that. I grew up on the 6502, a tiny bit of Z80, then ARM, then joined the masses with x86 (although the only serious assembly I've done in x86 was for hand-optimising SIMD 🤯). It's a neat idea, for sure. I kinda wanted a "RISC-like" architecture in that all registers are treated equal. I guess I have a soft spot for ARM 😆 I have more ideas... too many ideas to implement. Thanks for watching & commenting 👍
@BlueChrome
@BlueChrome 5 ай бұрын
​@@phodopus42 > Well with sixteen odd registers to deal with, and the division was not done as strictly as I make out, but we're talking about a sixteen bit instruction (minimally, they can get much bigger) versus your eight bit. But still interesting to see what you end up going with.
@cthutu
@cthutu 5 ай бұрын
Use Obsidian or something similar to keep a journal on your work as you do it. You can add images, mermaid graphs and text to document your travels. If you have to take a break due to real life, hopefully your notes are enough to get you back into the swing of things. Take particular note of problems and their solutions you come across.
@phodopus42
@phodopus42 5 ай бұрын
Thanks for the recommendation 👍 I've not seen Obsidian before. I'm pretty old school in that I use a notebook and a pencil. Whenever I have an idea, I write it down, even if I just cross it out moments later. I was a bit shocked to find a 15 day gap between entries recently 😥 Work has been absorbing all my energy recently because we have a looming deadline.
@cthutu
@cthutu 5 ай бұрын
I hit the same issues when designing my 6502-inspired CPU (I plan to implement on an FPGA). However, I do like you 2-register ALU approach. Even though it uses 4 instructions, I could see assembler support for pseudo instructions that use A0 and A1. I am wondering, therefore, if a 16-bit ISA would be more useful.
@phodopus42
@phodopus42 5 ай бұрын
So... OK... this got me thinking. Since the start, I've been jumping back and forth between the idea of this ALU register. I never liked it. I ended up settling on a 2-byte opcode for ALU ops to avoid it. I was walking through the pipeline stages for instructions. Loads & stores take minimum 2 cycles (fetch opcode, perform load/store), or 3 cycles if there's an immediate (fetch opcode, fetch offset, perform load/store). ALU ops take 2 cycles because it's a giant opcode. OK, so what instructions only take 1 cycle? Virtually none. And I believe you are completely right. I sketched out the opcodes assuming they are all 2-bytes, and suddenly there is room to breathe! Let me play through the scenarios and I may have an update in the next video. Thank you for a provocative and helpful suggestion 👍 I'd love to see your FPGA design.
@0toleranz
@0toleranz 5 ай бұрын
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 5 ай бұрын
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 😆
@DavidLatham-productiondave
@DavidLatham-productiondave 5 ай бұрын
No worries when real life gets in the way of hobby projects. I'm enjoying watching your progress.
@phodopus42
@phodopus42 5 ай бұрын
Awesome. Thank you 😄
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt 5 ай бұрын
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 5 ай бұрын
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 5 ай бұрын
@@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 5 ай бұрын
​@@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 5 ай бұрын
@@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 5 ай бұрын
@@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
@ruslanzalata
@ruslanzalata 6 ай бұрын
I think, you better start with data path design, instruction set will depend on what DP you could do. Second, you do not need so many ALU ops. You need AND, OR, XOR, ADD, SUB, SLL, SLR, i.e. 3 bits. Also, why so many regs ? Go the 6502 route - A, B, H, L. Use H and L for memory access. 8 bits is plenty of space for encoding instructions. :)
@phodopus42
@phodopus42 5 ай бұрын
Thanks :) I wanted something more "RISC-like" so that I can avoid complex instructions like the 6502's indirect memory accesses. That's why I ended up with 8 registers. I'm currently designing the data paths and decoder. In retrospect, that's where I should have started. As I've probably pointed out, I'm not an expert here! I am reconsidering the whole instruction set as a consequence. I've been programming some simulators at different levels: a high-level one for the instruction set, and a lower-level one simulating the data paths and control logic. This gives me the advantage that I can try something out without hours of work on the breadboards.
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt 6 ай бұрын
I have a hard time to believe that SRAM is not the fastest solution in the end, kinda like the ZeroPage in the 6502 only that SRAM is faster. Change you ISA to allow for instructions with more bits. Two byte instruction words. pcEngine and SNES (and sega genesis) had SRAMS . Those chips have 32 kB, but only 8 data pins. Data pins really seem to be a problem. Maybe if we look at old SRAM as used in the Commodore PET and VIC-20. 4kB chips. So for 16 bit addresses and program pointer we still want two of them. So 8kByte register file. The ALU would still be 8 bit or 4 ( Ben Eater uses 4-bit chips ). Atari JRISC is an ISA, but the only implementation has a timing which can be explained by the latches in front of the ALU. Just like 6502 and Ben Eater SAP-1 the contents of the register file is first transferred into latches. Then like on Z80 you could use a multiplexer to let your 4 bit ALU go over the data. In all those cycles you can load the next instruction ( pipeline ), so that it does not hurt to fetch multiple bytes into the instruction register. The decoder should wait when a branch opcode is detected. So like on Z80, every first byte fetch is followed by a pause where the memory 8bit bus can be used for something else. I know this is not very MIPS like. With MIPS the ALU is fed directly from the registers because we need the result with minimal latency because every instruction needs the ALU. For load store it does the addressing mode. For branch it first checks for the condition and then calculates the branch. But economic multi-port register files are very much a specialty of the a real microprocessor where ALU and file sit on the same chip. You could order prototype chips for 300$ . Just ALU and file. Keep the control logic outside to be able to tinker with it. I don’t see the problem with multiple cycles. Loops can be coded in microcode. So yeah, need a micro instruction pointer and a counter.
@phodopus42
@phodopus42 6 ай бұрын
Thanks for commenting and offering ideas 👍 SRAM is definitely the best solution for the system memory, agreed. (DRAM would be faster but is a pain with the refresh cycles. It was used on, for example, the BBC Micro because 32KB of 4MHz RAM back then really needed DRAM.) However, my question was about the storage of registers in the register file. Modern CPUs have many registers (over 100 in typical x86-64 designs, even if only 16 are exposed to the ISA), and will use multi-port SRAM, that is, something that supports reading multiple addresses registers at once (i.e. concurrent dispatch of multiple instructions accessing registers), and even writing the same register as it is being written. This kind of setup is not possible with "ordinary" SRAM -- set an address, wait ~55ns, and you have a value on the outputs. I certainly can't read and write a single value in one "clock" of SRAM (although SRAM strictly speaking doesn't have clock cycles). I went with 74x574 octal latches because I can do precisely this: I can read and write on the same clock because they are edge-triggered. I only need 8 chips, so it's not too bad. You are right about the 6502 -- the zero page is *almost* like a set of 256 registers. Accessing and updating still takes multiple cycles, though. I wanted something that's a) built without microcode, and b) can retire 1 instruction per cycle (in the optimistic case). Variable-byte instruction decoding will be painful, I think. Of course, on an FPGA (or real silicon), it becomes less painful. But this is discrete chips, and wiring 100 connections and finding the 1 single wire that's made a bad connection is starting to drive me nuts 😆 Thanks again for commenting... you've made me have a good think about the design. Sorry if I've misunderstood anything you've explained. I might warm up to the idea of a fixed 2-byte instruction width 🙂 Anyway, I've probably said this before: I am kinda working this out as I go along. I'm definitely no expert in any of this (which should be pretty clear). I wanted to turn my "oh, I wonder if this would work?" into "wow, this circuit actually does something!" I'm slightly surprised anyone is even vaguely interested (!)
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt 6 ай бұрын
@@phodopus42 oh, I guess I should recheck the single cycle per instruction thing of yours. Load and Store need two cycles as does immediate8. So from a single bit to a 4 bit counter it is not much more parts. My motivation for even a second pointer comes from all the bugs in the original 6502, which tried to do 16 bit without it. It seems that you have the hard facts about RAM and I only know theory. SRAM is used for cache because it is faster than DRAM. Consoles used SRAM and ran faster than Homecomputers with DRAM. I agree that SRAM lacks separate in and out ports. It is so weird that each cell resembles a latch, but to save transistors and increase capacity, the latch is connected to the data line via transfer gates. Reading uses a slow connect to neutralised lines not overwhelm the small transistors, followed by highZ read out. Write precharges the lines and stamps this charge into the cell. Yeah, many CPUs (says a book I own, but my only example is JRISC ) have 2 port register files, but none has 1 port. Old DRAM had separate input and output ports for read modify write. Why does google find me tons of dual port RAM where both ports can write at the same time, but none with dedicated read and dedicated write port. The specs and datasheets don’t hint at a multiplexer to assign external requests to the read or write port on an internal block of latches. This would explain why those chips are so slow. Even with serialisation on collision dedicated read and write lines would make the chip faster.
@Af5j
@Af5j 6 ай бұрын
bee
@davidgari3240
@davidgari3240 6 ай бұрын
That you include GALs and the Pi Pico illustrates how competent and fearless you are. Well done!
@phodopus42
@phodopus42 6 ай бұрын
Thank you 🙂 I don't know whether I'm fearless or I just don't know what I'm doing 😆
@jackdaniels8898
@jackdaniels8898 7 ай бұрын
Really interesting. Can you share the schematic please.
@phodopus42
@phodopus42 7 ай бұрын
Sure! Give me a moment... I have to remember how I built it :-D From memory, I use a 555 timer connected to a J/K flip-flop to provide low / high nibble pulses. All 8 bits + this nibble switch go into an ATF16V8, and I get 7 bits for the 7-segment display. The J/K provides positive and negative outputs, so I use that to choose which nibble is connected on the hex display. When I have a moment, I'll upload the PLD file I used to build it and a quick schematic to github. I also built a version with a 24-bit address display and 8-bit data display, soldered (very badly!) onto some perf board.
@phodopus42
@phodopus42 7 ай бұрын
Here is the repo: github.com/phodopus42/hex-display I hope it's useful! I'm sorry for any mistakes.
@jackdaniels8898
@jackdaniels8898 7 ай бұрын
@@phodopus42 Thank you very much.
@MattSiegel
@MattSiegel 7 ай бұрын
🚫🧄
@phodopus42
@phodopus42 7 ай бұрын
I've done some more testing on this "power down" mode, and it's more complicated than I thought 😿 More on that next time... if I get this new breadboard finished 😆
@davidgari3240
@davidgari3240 6 ай бұрын
​@@phodopus42I too keep power consumption foremost in designs, just in case it needs solar power one day.
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt 6 ай бұрын
@@davidgari3240I like CMOS logic. An 80s RISC CPU design without branch prediction or instruction reordering has an extremely low power consumption. In a Micro processor parasitic capacity is low, and so is power consumption. Apply any clock up to 1 GHz . I still don’t know how a CPU knows the clock. Like, is there adrenaline? Direct power from solar can use a Joule thief to launch the next cycle once enough energy was collected. I think that spacecraft work this way. But what happens in an eclipse?
@phodopus42
@phodopus42 5 ай бұрын
​@@davidgari3240My only concern at present is that my cheap lab PSU has a fan that spins up when I draw a few watts 😅
@MattSiegel
@MattSiegel 7 ай бұрын
i'm excited to see a new unique cpu, thank you for showing the progress ✨
@phodopus42
@phodopus42 7 ай бұрын
Thanks 🙂 I got distracted this week with the programmable logic chips. I'll upload the video today. I was hoping the Easter weekend would mean more electronics project time, but I ended up clearing out old junk. I found a bag of 1973 74-series chips from my dad... Not the LS, but original TTL. He said they were expensive at the time 😮
@davidgari3240
@davidgari3240 6 ай бұрын
​@@phodopus42 I'm old enough to remember feeling the 40ma heat coming off those original TTL chips.
@phodopus42
@phodopus42 5 ай бұрын
​@@davidgari3240I found some 74 series chips in my dad's lift - dated 1972. He said they were amazing at the time. He designed some electronics for a particle accelerator. Cool stuff. What did you design and build with them? Sorry for replying late 😕
@MattSiegel
@MattSiegel 7 ай бұрын
appreciate the thorough analysis and clear explanation :D
@phodopus42
@phodopus42 7 ай бұрын
Thank you! All these ideas float around my head, and I find explaining it crystallizes them 😀
@DirkJMartens
@DirkJMartens 8 ай бұрын
What happened to the VGA card?
@phodopus42
@phodopus42 8 ай бұрын
It's still in a drawer :) I will do a wrap-up video to finish the series.
@Lantertronics
@Lantertronics Жыл бұрын
This is really impressive work!
@phodopus42
@phodopus42 Жыл бұрын
Thank you 🙂
@chikipichi5280
@chikipichi5280 Жыл бұрын
very kool!
@tmbarral664
@tmbarral664 2 жыл бұрын
just discovered your channel.... brilliant job you're doing ! Please, pretty please, keep it going ;)
@phodopus42
@phodopus42 2 жыл бұрын
Thank you :) You've encouraged me to look again. My breadboards are looking lonely and unloved ;-)
@LoganE01
@LoganE01 Жыл бұрын
​@@phodopus42Well seems like there's quite a resurgent in retro computers with projects like the commander X16. I've personally been looking into the 65816, and getting into breadboarding. What ever came of this project, are you still working on it?
@phodopus42
@phodopus42 Жыл бұрын
@@LoganE01 There is quite a resurgence. I like to think what could have been made in the early 80s with the hardware they had, but some of the hindsight we have now. For example, Acorn's original idea before they made the BBC Micro was to have some kind of dual-CPU system - a bit of that survived in its "second processor" add-ons. My project has been paused. The past year has been tricky and a project like this needs more than 30 mins at a time. (It takes me that length of time to remember what I was doing!) I can totally recommend starting with the 65816 - I was having loads of fun until "real life" got in the way 🙂