HN Theater @HNTheaterMonth

The best talks and videos of Hacker News.

Hacker News Comments on
Homemade 32-bit CPU and OS - Part 1 of 2

Tom · Youtube · 253 HN points · 0 HN comments
HN Theater has aggregated all Hacker News stories and comments that mention Tom's video "Homemade 32-bit CPU and OS - Part 1 of 2".
Youtube Summary
This is part 1/2 (Part 2 is at http://youtu.be/SB1enTt2JzA) of a brief description/demo of a CPU I have designed in my spare time, and an OS which I have written for it. Everything I have done has been from the ground up, starting with designing an Instruction Set Architecture, designing a CPU and surrounding system, writing an assembler, and then writing a basic OS in my assembly language. Thanks for watching and I hope you enjoy.

Docs. here - https://drive.google.com/folderview?id=0B9bGsX6PKXAHfktGUDJGd2lhd2dzNzA2V3RpUmlpMkEwcDA2VlJnRkdNZEVXcGJaM3BpR1k&usp=sharing
HN Theater Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this video.
Jun 06, 2016 · 253 points, 37 comments · submitted by tomsm
Zardoz84
I don't know if I should post on HW, my 32-bit CPU that only exists as software emulator, plus a basic firmware that consists on a basic BIOS + machine code monitor that imitates Apple ][ Wozniak's machine code monitor. I ever managed to get a Raspery Pi B to run the emulator.

I try to wrote the CPU as VHDL, but I only did a few pieces (registers storage and a 32 bit ALU), so I can get a real and accurate cycle count for each instructions.

DanBC
> I don't know if I should post on HW

Many people would be really interested to read a submission about that. I think they'd especially be interested to read how you solved any problems you had.

jackhack
second that. It sounds fascinating.
bpye
This is really cool, something I've wanted to do but never actually done. The closest I've been is a very simple 8 bit CPU implemented in Verilog ( https://gist.github.com/benpye/07aa8a66e25a7c702766 ), the program in the BRAM I think calculates the 5th number in the fibbonachi series or something, I've forgotten. It works on the ice40 hx8k breakout board if anyone wants to try it, I was using the icestorm toolchain.
danellis
I can definitely see some ARM inspiration here, and the guy's English, so I wonder if he grew up with Acorn hardware.
yxlx
He sounds like he's in his twenties to me. If so, do you think he would have had an Acorn computer? I dunno, could be.
tomsm
Hi, yes indeed, our 1st comp. arch. course at uni was based on ARM hence the influence. Unfortunately I did not have an Acorn machine.
None
None
cjdrake
Cool demo. Did the author post the source anywhere? This would be a great reference for do-it-yourself-ers.
max_
This is a realy great submission... thanx!!
dang
Since it looks like the author posted this, we've added "Show HN" to the title. Normally that requires something people can try out, but when you're making something on an FPGA * that's hard to do, so a demo is fine, as long as it works.

* I originally said "making your own hardware" but that caused confusion. Sorry!

ebbv
He didn't make his own hardware though? It's a software based CPU. Actually manufacturing a CPU at home would require you to crash at a foundry. Or y'know build a really, really slow one out of parts that you could actually use in your home.

I think this is really cool but all he did was use a cool product for exactly what it is intended for.

The video seems to be deliberately non-obvious that this is all software based. If you're gonna post it for public consumption you should be more up front, I think, or some people are probably going to assume you actually did manufacture your own CPU From the title.

sklogic
This semantic argument that "is FPGA a real hardware" is pointless. All the same arguments that the "software" side can produce are also applicable for, say, a circuit built on a breadboard. Is this circuit not a "real circuit", but a "software" for some weird reason? And if not, stop calling FPGA bitfiles a "software".
nickpsecurity
There's whole papers in CompSci on why FPGA's aren't ASIC's and many FPGA-to-ASIC conversions failed to achieve their objectives. They really are different enough to warrant a distinction. I'd just call them bitstreams instead of software, though, given software usually gives implication of instructions a la x86 running on fixed HW. I mean, technically that's what FPGA's and bitstreams are but world of difference in meaning.

It starts getting extra muddy when we're talking anti-fuse FPGA's where it runs software exactly once then becomes hardware. ;) Still significant logical, structural, and so on differences from ASIC's or TTL designs to not consider HDL-to-FPGA to be same as making, esp manufacturing or wiring up, those.

sklogic
FPGA to an ASIC is sort of like a breadboard to a PCB. A direct translation does not make much sense for the latter as well.
nickpsecurity
Point being the structures and underlying workings of FPGA doing things vs an ASIC are really different. A person who can FPGA-prove something can't necessarily put that specific design on a 350nm node. Surely not on deep sub-micron. The FPGA won't even run by itself in the development configuration. Stand-alone FPGA boards with the stuff flashed or whatever is closer to building some hardware. It's still only a subset of skill required, though.
tomsm
I've built custom HW for the FPGA based SoC now too. https://youtu.be/ZDELr2QHxec?t=6m56s
Fox8
Great project, do you plan to opensource it ? Would love to know how did you build the board!
peterkelly
He says at the beginning that the CPU is written VHDL and it's running on an FPGA.
etatoby
> This is part 1/2 of a brief description/demo of a CPU I have designed in my spare time, and an OS which I have written for it.

He claims to have designed his own CPU, not physically built it.

VHDL/Verilog is the correct way to do it and an FPGA is the best way to actually run (as opposed to simulate) the hardware design.

I don't see anything remotely misleading here.

danellis
It isn't all software based. It's running on an FPGA. He made that perfectly clear at the beginning.
coin
I was expecting to see a wire wrap type CPU, but instead it's just an FPGA
dang
Ok we'll change the title back to what it was originally. Sorry for the distraction.

Edit: actually this is still pretty cool work and it isn't the creator's fault that I oversold it, so I've put "Show HN" back and edited my root comment above. Let's discuss the video now!

mafuyu
I think it's totally valid, but I can see how the word 'homemade' could be misleading. All designs nowadays start as HDL, even the ones manufactured at a foundry.
None
None
chrisper
Isn't that even one of the main reasons for FPGAs?
chc4
There are plenty of hand-built CPU projects built by enthusiasts, made out of wire-wrapped integrated circuits[0]. There was even a Zuse homage I saw that was built entirely out of magnetic relays[1]. It's...insane, tbh.

0: http://www.homebrewcpu.com/ 1: http://nablaman.com/relay/

sliverstorm
Notice most of the wire-wrapped machines are 8-bit data 16-bit address, or similar. 32-bit gets pretty painful to do on a proto board.
d4rti
I know a guy who is building an All Relay Computer, no transistors.

I don't think he has a webpage though.

nickpsecurity
"Or y'know build a really, really slow one out of parts that you could actually use in your home."

He already said that. He's pointing out this isn't a physical build since that requires parts as mentioned above or a fab run.

fit2rule
I've worked for some characters in my time, and some of my elderly bosses were hardcore on this subject. As it happens, in various industries - rail/transportation, for example - there are often available large surpluses of electro-mechanical relays, in copious quantities sitting in large bins, which .. by way of practical application of apprentices .. become a new 'test subsystem rack' waaaaaay in the back of RailtrainCo.'s, computing facility. What I'm trying to say is, "don't power off the back racks, ever, because they are the bosses little relay-CPU project, and its computing .. something .. (actually its running the model railway switching system, upstairs in the lobby)" ..
arethuza
That sounds like something from a Charlie Stross Laundry novel.

Edit: I have encountered systems that were designed in the 1960s where they wanted to rely on tried and tested technology - so pretty much clockwork! This was for sequencing operations during the emergency shutdown of a nuclear reactor, so being conservative in technology platform was perhaps understandable!

fit2rule
In my case, it was just so that the Boss could prove the point: even his relay-CPU could handle the train signalling/switching systems, sometimes, better than the 'modern' versions we were all sweating on developing. Technological prowess runs deep in the train-nerds world.
VLM
Remote reprogramming requiring a metal lathe, milling machine, and a cooperative operator onsite is not necessarily a bug with nukes. Expensive, but accidents are more expensive.
db1
This reminds me of http://nand2tetris.org/ (and the accompanying Coursera course). It's a fantastic course to learn about computing from first principles.

The course starts off with just a few logic gates and how you can combine these to make more complicated circuits. These are in turn combined to reach higher levels of abstraction, until you finally have a 16bit computer, with 16K of ram. It's a really cool course that helped me flesh out my understanding of what's going in my computer.

talnet
Hey thanks for the course pop up.
nul_byte
Quick question if I may. I have a very keen interest in trying this course...is what you build (hack) using actual physical circuits / components? Or do you run it all in simulation?
projektfu
It's all simulation using a simplified HDL.
d0mine
You might also like the book CODE: The Hidden Language of Computer Hardware and Software http://www.charlespetzold.com/code/index.html

It starts with sending signals using flashlights and follows the evolution of computers from the ground up (mostly hardware).

HN Theater is an independent project and is not operated by Y Combinator or any of the video hosting platforms linked to on this site.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.