A modern normal network card will have onboard an Ethernet controller which, of course, is a pre-programmed microcontroller. Not only does it do the things required to keep a computer on the network, it can even save the primary CPU from having to do certain common tasks required for communicating. But not [Ivan’s]. His homebrew computer — comprised of 7 colorful PCBs — now has an eighth card. You guessed it. That card connects to 10BASE-T Ethernet.
There’s not a microcontroller in sight, although there are RAM chips. Everything else is logic gates, flip flops, and counters. There are a few other function chips, but nothing too large. Does it work? Yes. Is it fast? Um…well, no.
He can ping others on the network with an 85 ms round trip and serve web pages from his homebrew computer at about 2.6 kB/s. But speed wasn’t the goal here and the end result is quite impressive. He even ported a C compiler to his CPU so he could compile uIP, a networking stack, avoiding the problems of writing his own from scratch.
Some compromises had to be made. The host computer has to do things you normally expect a network card to do. The MTU is 1024 bytes (instead of the more common 1500 bytes, but TCP/IP is made to expect different MTU sizes, which used to be more common when more network interfaces looked like this one).
Even on an FPGA, these days, you are more likely to grab some “IP” to do your Ethernet controller. Rolling your own from general logic is amazing, and — honestly — the design is simpler than we would have guessed. If you check out [Ivan]’s blog, you can find articles on the CPU design, its ALU, and even a VGA video card all from discrete logic. The whole design, including the network card is up on GitHub.
We love the idea of building a whole computer system soup to nuts. We wish we had the time. If you need a refresher on what’s really happening with Ethernet, our [Arya Voronova] can help.
This is superb! With blinkenlights as well, absolutely fantastic!
This is one of those things you first say “why”, then “oh”, then “amazing, tell me more”. I am still on the “why” tho.
I think this is one of those “because they can” things.
It’s a learning path, “see if i can do this…”
It all starts with “I wonder can I …”
Can anyone who actually understands explain why he thinks that storing and comparing the first 6 bits of the mac address is too complex?
No, he said comparing the 6 *bytes* of the MAC address, not bits. As in, a 48-bit comparator would be too difficult.
I’ve recently found that chips like 74LS684 exist – performing 8-bit comparison in a single package. A set of six of those plus an AND gate and there we go!
This is exactly what I meant yeah, like surely some comparators and AND gates wouldn’t be too complicated or too slow
Or…compare a byte, bump a counter if a match, reset the counter if not…if counter ==5, it’s your MAC.
counter==6
Right, but I still see it as the same problem. Just a wider (more parallel) comparison or more comparisons. Seems like comparing if some bits are the same should be a solved problem 😅 And something that could be performed very fast too
there are many FPGA projects with network and without any cpu’s, only in pure logic.
but still a cool project !
The headline’s “NO CPU” appears to be in strong disagreement with the article.
They mean it’s made from discreet logic, not a dedicated CPU chip.
It would be self-flagellation to go back to Bill Stallings’ Ethernet book and build from scratch from the state diagram in the book. I’d be willing to use an AMD AM7990D LANCE chip in conjunction with the AM7992 serial Manchester encode/decode chip. Those date from about 1986, so if retro is the objective that box is checked. There is even LANCE software emulation code floating around. The LANCE was used in Sun Spacstations, AT&T 3B1 Safari UNIX-PC, Amiga expansion board and others, so using this chip would be a fitting homage to the past.
Many a cheap PC motherboard has no CPU on the network.
It’s all done in the driver. With part of the driver running in systems management mode (whatever they’ve renamed it to) so you can’t see how much CPU the motherboard is hogging up polling the network hardware.
It sucked worse before everybody had 6+ CPUs.