[ 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


View post   

File: 387 KB, 1024x685, Magic-1.jpg [View same] [iqdb] [saucenao] [google]
275415 No.275415 [Reply] [Original]

So, /diy/, I'm god-damned insane. Back in my Freshman year of High School, I tried building my own 8-bit CPU out of the 7400 series of TTL logic chips. I actually succeeded in building the Program Counter and ALU but lost steam and creativity. Now, 4 years later, a few days before I head off to college, I got bitten by the bug again. This time, I want to do it right. I feel as though my previous one would have been a total hack-job. I've seen all the stuff on the Homebrew CPU Web-ring, and followed all the links on homebrewcpu.com (TONS of them are 404/dead links now)

Does anybody have any good online books/a tutorial series that will help me get started at building something cleanly, rather than something that's a total hackjob? Optimally, I'd also like to be able to easily port old programs (So maybe cloning something like the 8080, Z80, etc would be a good idea?)

Finally, might it be a good idea to start with a 4-bit cpu, or a total waste of time? I feel as though there's virtually nothing you could do with that except add some numbers together and run basic calculator-esque functions, but I could be wrong and there might be clever ways to do things like link up to video or small lcd displays, etc.

Pic semi-related, it's the Magic-1

>> No.275541

Whatever that is. zomg

>> No.275558

>>275415
if you want to do it for the sake of having this crazy thing under your desk i have no idea. but if you're generally curious about how architectures work, look into designing the architecture and emulating it on an FPGA. it's a lot more practical, and gives you a legit skill that few people have.

>> No.275569

>>275558
Call me crazy, but I wouldn't feel satisfied "Cutting Corners", if you can call even *that* cutting corners. I have this urge to do it with logic gates (I'll obviously not against using actual RAM and ROM chips - those would be a BITCH). I've been scouring the internet and have found a few more sources to supplement the little bit I've seen already. I'm going to see what I can't come up with in the design notebook tonight.

>> No.275570

>>275569
"I'm obviously"*

>> No.275582

>>275569
you should totally go for a couple words of core memory, for bragging rights.

>> No.275601

>>275582
I may have to do that, but I'm not sure where I would use a couple words. I'm definitely not going to hand-wire too much of this. Maybe I would be able to reverse-engineer an old card of this. I'm definitely at least considering a punch-card reader, as long as I can find some good resources online.

I'm working on the diagrams tonight, along with the basic outline of the microcode. The diagrams look like SHIT (I'm a sloppy drawer and writer), but it might be functional. Everything seems a lot different than what I've seen on line, but halfway through working out the different instructions, it all seems OK so far. Once I have a cleaned up version (Hopefully tomorrow), I could scan and upload, if there's any interest here. Would anybody like to see that, along with my personal notes for clarity, to either kickstart their own project or help me find things that simply wouldn't work on mine?

>> No.275644

> Does anybody have any good online books/a tutorial series

Not online (unless you torrent it) and not particularly good, but you might want to check "Logic and computer design fundamentals", by Mano & Kime. At least it's clearly written.

> rather than something that's a total hackjob

Many ancient processors were hackjobs.

> Finally, might it be a good idea to start with a 4-bit cpu, or a total waste of time?

Depends on what you want. If you want to port old programs, then it's a waste of time, as you'll have difficulties finding programs to port.

>> No.275725

your awesome OP. ive been wanting to do this for a long time.

you should take the cpu you already have and add on to it.

create a VGA display, a keyboard input, and an SD card reader writer for a hard drive.

merge all these together, keep adding on till you have an entire machine.

>> No.275738

I did exactly that - built a 4-bit cpu out of 7400 series components - in a 3rd year electrical engineering lab.

Hopefully OP is taking electrical engineering. He can just be patient, and he'll get to do what he likes in class.

>> No.275755

How would I go about starting to do this?
Is there a schematic for the placement or wiring of the chips or is it a case of trial error?

Kudos to OP though, are there any pics of your creation?

>> No.275986

make it as modular as possible. Many of the earliest computers had different opcodes on different circuit boards. Doing this will make it easier to localize your bugs. It will also keep your spirits up, because you can watch the cpu run even when its partially built.

Yes, modularizing it will add extra work. Mostly, it will force you to put some serious thought into your design before you build it. You need to have some very specific architecture details worked out before you can choose what lines will be on your data bus.

It'd be ideal if you got your hands on some s-100 proto boards, but that's probably not going to happen. You'll have to improvise with what you've got.

>> No.275988

>>275986
Thanks for the input. That seems like a really good idea, and I'll have to think about how to go about that. Unfortunately, I have a breadboard for prototyping and will be using the solderable copperpad perfboards (Like you can buy at radioshack). It's been a busy day so I haven't gotten to clean up the block diagram yet, but hopefully will sometime tonight.

>> No.276161

I've been slowly building a relay computer over the last couple of years. It's an 8-bit RISC machine with a 16-bit single cycle instruction word, with an 8-bit data memory and a 10-bit instruction memory.

Searching for books on computer architecture should return a lot of results. I would recommend Digital Design and Computer Architecture. This book focuses on more modern RISC architecture though, so it may not be up your alley. But if you can understand how a RISC architecture works you should have no problem a micro coded computer.

>> No.276190
File: 2.84 MB, 3842x2969, PreliminaryBlockDiagram.jpg [View same] [iqdb] [saucenao] [google]
276190

>>276161
Any videos of it functioning yet? I love Relay CPU videos - all that clicking, it's heavenly!

Yes, I'm aware that I got one of my hairs and a beard hair on the scanner. If it bothers you, edit it out.

>> No.276191
File: 2.06 MB, 2434x3182, Notes-BlockDiagram.jpg [View same] [iqdb] [saucenao] [google]
276191

>> No.276192
File: 2.07 MB, 2447x3210, PreliminaryMicroCode.jpg [View same] [iqdb] [saucenao] [google]
276192

>> No.276206

You're all a bunch of masochists, but you're damn clever ones. I can't get my head around logic circuits at all, best I've made is a NAND gated clock generator, and some inverter clocks.

RF is my thing really.

>> No.276250
File: 1.57 MB, 1500x1125, SAM_0998.jpg [View same] [iqdb] [saucenao] [google]
276250

>>276190
Looks like you know what you are doing. Since you have a separate program and data memory, have you thought about building a RISC machine instead? I don't think I've seen a homebuilt one yet.

I'd recommend downloading Logisim, if you haven't already. It's a free logic simulator that is made for building computers.

No videos of the relay computer yet. The only thing that can actually run at the moment is the PC, kind of boring to watch ticking over by itself. Even if I can get it to hum along at a massive 46Hz.

The pile of crap in this year old picture are the mostly finished modules. Top left board with leds is PC, bottom left is ALU, next to it is the register board 4x 8-bit registers and the board with the chips is 1/2 the program memory. The switches are used to program the EEproms. A lot's been done since then and i'm getting damn close to wiring everything together.

>> No.276318

>>276206

Funny, as it's much easier to earn wizard's reputation with RF stuff than with digital stuff.

>>276250
> building a RISC machine instead?
> I don't think I've seen a homebuilt one yet.

This surprises me, as Harvard architecture RISC machine is (IMO) easier to design.
Any ideas why the RISC machines aren't popular? People want design which are compatible with Z80 and other old processors?

>> No.276414

>>276250
I thought a bit when I first woke up and realized - I have no operation that can get an initial value into the accumulator! I'll just change the Clear Accumulator to Set Accumulator to whatever comes out of the Program Data (Labelled RAM Address). A bit more work, but it's worth it so I don't have a computer that sits there and basically idles with all 0's haha

>>276318
I imagine portability is what everybody is concerned with. Honestly, I'm just kind of going with the flow on this one, and hoping I can get some help from those who have done this all ready (Sent out a few emails to some people with complete projects last night). I feel like I've seen a few projects that said they were RISC, somewhere.

>>276206
I've always wanted to get started in RF. Maybe that would be a good next project. Definitely not wanting to have two big projects at once, though

>> No.276439

You're so cool for showing that pic.op.

>> No.276707

>>276318
>Any ideas why the RISC machines aren't popular? People want design which are compatible with Z80 and other old processors?

I'm not sure. It might be because they don't want to wire up a heap of registers. But if you compare the register count between a single cycle computer and one that is micro coded, there isn't a huge difference. As the micro coded computers need to store data between cycles. I wouldn't say RISC machines are easier to design they can be far more challenging in a lot of ways.

I don't think it's a compatibility thing either as everybody seems to role their own instruction set. Maybe it's as simple as they prefer programming these type of computers.

>> No.276714

>>276414
A number of them have RISC like instruction sets, but they aren't RISC computers. RISC computers have instruction sets that are designed to have each instruction execute in a single cycle. LIke the Avr, ARM, MIPS, Power PC etc.

>> No.276757 [DELETED] 

>>275415
> Optimally, I'd also like to be able to easily port old programs (So maybe cloning something like the 8080, Z80, etc would be a good idea?)
6502 would be the easiest "real" CPU to clone. Making one which runs at 1 or 2 MHz (typical for the 8-bit home micro era) wouldn't be hard with contemporary 74-series chips.
Aim for something which connects via ribbon cable to a DIP header so that it can replace the CPU in a C64 or similar.