Show HN: A game where you build a GPU

497 points - yesterday at 4:45 PM


Thought the resources for GPU arch were lacking, so here we are

Source

Comments

rustybolt yesterday at 6:48 PM
This is great!

Some comments:

- I didn't like the "truth tables" one, I got many duplicate questions and for some reason I got only one second for the first question. The rest of the questions I managed to answer correctly but I still got only one start out of three?

- I got very confused by the capacitor. Capacitors do not have an "enable" gate! In fact, in 2.7 (1T1C) you are supposed to build the enable gate -- with a transistor. So currently, you can just simply not build the enable gate and use the one already in the primitive, meaning you don't need the NMOS gate at all.

Was this made using LLM-assistence? (Not judging, I'm just interested!) I'd love to hear more about your workflow and how you managed to produce a good UI as it's something I couldn't do if my life depended on it, and it's a skill I'd like to learn.

txr yesterday at 6:59 PM
Anyone who likes this should also take a look at: https://store.steampowered.com/app/1444480/Turing_Complete/ At the end you have your own CPU with your own assembly language. Sadly stuck in early access since forever with some very rough edges
roadbuster yesterday at 6:54 PM
I worked on deep sub-micron, full custom mixed-signal integrated circuits for more than a decade, and I can't pass the first level.

> Wire an NMOS transistor so that when In is 1, the output is pulled to ground (0). When In is 0, the output should be unconnected (Z).

Certainly:

(a) The nMOS has 3 connections: its drain is only connected to the output (no +Vdd supply), it's source is tied to ground, it's gate is tied to the signal input

(b) When the gate (input) is driven high, the nMOS transistor turns "on," connecting the output to the source (which is grounded). This acts as a "pull-down network"

(c) When the gate is driven low, the nMOS turns "off," leaving no connection to the output. This is equivalent to a "high-impedance" / "unconnected" / "Z" output

Fails 1/2 tests

(Edit) - I thought the light grey, thick line on the background grid was a wire from "input" to the transistor's gate. It is not. You need to explicitly add a wire from "input" to gate :\

Anonyneko yesterday at 5:53 PM
This looks really cool, although I personally seem to lack the absolute basic knowledge that is required to make sense of the tutorial messages, so I couldn't even figure out the first level.
eterm today at 12:52 AM
Your bug submission endpoint is getting a 429, so I'll report a bug here:

I see a difficulty pop up after I click "run tests" but it then gets hidden and doesn't do anything.

This was after selecting intermediate on the truth tables level, then clicking "next level" from there.

frmersdog yesterday at 7:21 PM
You need to have a, "Okay, I've tried 10 times, it's not working, what's the answer?" button. That will help not just us rubes who can't understand, but also in the off chance something is broken and even "correct" answers are being rejected.
yuppiepuppie yesterday at 7:29 PM
Neat idea!

Ive added this to the HN Arcade! https://hnarcade.com/games/games/mvidia

triilman today at 1:07 AM
is there any source or game like this specializing to create microcontroller, like arduino, wemos (not the IC), what kind of protocol is supposed to use.
john_strinlai yesterday at 5:57 PM
as a learning resource, it would be great it acronyms were expanded at least once. nmos, pmos, gnd, vdd all in the first 5 seconds or so, and i didnt see anywhere that actually said what those stood for

otherwise, looks polished and fills in a nice niche!

npinsker yesterday at 5:51 PM
Great game! For learning, might be nice to see some commentary or example (model) solutions after beating a level.
dminik today at 12:17 AM
Some feedback:

- Nice idea, though after playing Turing complete, I would like to skip the beginning and move to stuff that makes GPUs different to CPUs. But it's understandable.

- I'm not smart enough to intuit NAND from transistors. I'm also not sure I will be alone in that. It's such a weird difficulty wall.

- Speaking of, the difficulty is all over the place. Though easy mode is appreciated.

- Even with a n key rollover keyboard, I couldn't complete the capacitor refresh level. It seems like it speeds up and certain capacitors already start empty.

- The routing for wires is no good atrocious. Any level with more than 8 components will end up impossible to read.

- It doesn't help that you can't color code or even path wires manually.

- Might be Firefox only, but I had a hard time selecting the connection points.

- Dragging the mouse along the edge should pan. Otherwise you have to drop the connection and zoom.

- I appreciate the added "show solution". But it's not really giving you a solution. It's just a better hint.

- An option to show all tests or at least more tests would get great.

xmprt yesterday at 8:15 PM
This is super cool but part of me wishes I could skip to the later levels rather than redo college homework from a decade ago. Maybe that ruins the fun but also slogging through the early levels (especially when the UI is a bit rough around the edges and doesn't support copy paste) isn't fun either.
rg2004 yesterday at 11:40 PM
I would have really liked to have a temporary node to test the outputs. Better than that, I would have liked to see the truth table update in real time without running the tests.
vibe_that_works yesterday at 8:38 PM
That was great fun, an interactive refresher on my EE studies. Thank you so much for creating it.

If anybody can create something similarly interactive, educational and hands-on for microbiology or robotics, I am happy to sponsor your cost.

mdtrooper yesterday at 11:00 PM
It sounds great, it remembers to me:

- https://www.nand2tetris.org/

- https://nandgame.com/

zapkyeskrill yesterday at 6:56 PM
Any easy way to make this usable on mobile? In portrait mode things are unreadable, zoom and scrolling do not work. Landscape is even worse as everything is out of view (and zoom/scroll do not work).
brynnbee yesterday at 9:26 PM
Huge fan of this! I love learning-by-doing and this captures that cycle perfectly.
iandev yesterday at 7:50 PM
I'm confused about a difference in the NMOS and PMOS. The scenario I'm confused about is when the source is VDD and the drain is connected to GND and output.

For the PMOS, the output toggles between 1 and 0 (opposite the gate) as expected. However, for the NMOS, the output is always 0.

I don't understand why GND pulls VDD down to 0 for the NMOS, but not the PMOS.

Liebmann5 yesterday at 11:30 PM
I have been looking for something like this for so longggg! THANK YOU
Jaso1024 yesterday at 7:43 PM
Hi everyone, commenting to address feedback:

- Made timed minigames optional (e.g. binary tables)

- Added 7 (optional) intro levels to walk through pmos and nmos transistors

- Fixed the bug in the capacitor levels

- Changed editor bg to use dots instead of lines to fix wire confusion

buildbot yesterday at 5:36 PM
This would be such a good game for introducing students to digital technology! This is so fun! We just had to draw them by hand back in the dark ages of the 2010s.
unsnap_biceps yesterday at 8:18 PM
The truth tables are way too hard for me. I need time to think and the 10 seconds is way too fast. If this is intended to be a teaching resource, avoid timers IMHO. It needlessly excludes people.
xnzakg yesterday at 8:00 PM
The 2.13 level ("hex racer") is kind of pain. Apparently I'm not fast enough at dividing/multiplying by 16... when I get something like "convert 0xB3 to decimal"
NooneAtAll3 yesterday at 7:31 PM
if you solve a level, then press "next level", then solve that next level - then it still shows the original level (I think it just gets hidden below the new one and then reappears after a solve?)
gchadwick yesterday at 7:17 PM
A nice game, though the truth table lighting round is pretty punishing! Big contrast to the circuit building part where you can take your time. Personally I'd drop the time requirements from that quiz section.
fleshers yesterday at 6:26 PM
This is awesome! The truth table lightning round took me by surprise, I am rustier than I thought...

One note: It isn't immediately obvious that the In/Out nodes can be connected to multiple wires, made the first few rounds harder to work thru.

baobabKoodaa yesterday at 7:17 PM
Is this a sequel to "How to make a CPU"? https://www.youtube.com/watch?v=vuvckBQ1bME
hristov yesterday at 11:05 PM
Ok you have put a lot of work in this and it looks impressive. But it needs a serious balance change. It is far too hard. Currently this may work as a brain teaser for people in the industry or people with computer engineering degrees, but it wont bring any fresh young minds into the industry. The fresh young minds will be scared off.

Teaching is challenging stuff. You have to step out of your current mindset and think with the mind of someone that sees this stuff for the first time. It is not easy to make things look easy and simple. Specifically, I think you need a lot more exploration about cmos logic, about how one side pulls the output up or the other side pulls the output down but they are never on at the same time, about how they effectively amplify the result so the output does not have to depend on the power of the input, etc. Perhaps you can try to have people design things in NMOS logic than in PMOS logic and then combine the two to make a CMOS design to see how they complement each other.

But I do not want to discourage you. This is a very promising start and you should continue if you have the time.

Also, the timed answers -- are you kidding me? The time is waaay too short. And you fail all if you fail a single answer. Oh what is 0xDE in decimal, all I have to do is multiply 16 by 13 and add 14 to that. In my head in 12 seconds. Also the time is not sufficient for filling out truth tables, especially with a laptop trackpad. I was able to pass the truth tables, but gave up on hexracing.

Ok and here are some more specific issues.

-The wires seem to snap in position in a way that they superimpose each other so it becomes very difficult to see what your circuit is doing.

- truth tables seem to be bugged. If you have more inputs than the gate whose truth table you are looking at, sometimes it will generate a fictitious truth table with extra inputs. Thus, some times i get a NOT truth table that has two inputs.

- the ground element should have its connection circle on the top, not the bottom. I realized that you can rotate by pressing R, but the site does not mention that anywhere.

jomoho yesterday at 10:07 PM
first level is impossible to solve for me! Hint or showing solution did not work! Also adding multiple sources or ground behave differently than connecting to the same.
Ginop yesterday at 5:57 PM
It's always nice to see educational games like that. A lot of new learners (like me) are just looking at the high level stuff, where the computer "just works"...

Well done and keep it up :)

K0IN yesterday at 8:49 PM
love it, some level (full adder with 8 inputs) where a bit repetative, but it is fun.
anderskaseorg yesterday at 7:46 PM
The “next level” button takes you to the next level even if you haven’t solved that level’s prerequisites.
oytis yesterday at 9:18 PM
Must be missing something - is there a way to save progress?
arikrahman yesterday at 5:19 PM
Awesome project! Reminds me of Turing Complete on Steam.
jmholla yesterday at 6:52 PM
The continue buttons in intro break for me all the time on Firefox. I can't actually finish most of them.
Falell yesterday at 5:46 PM
Fun. 2.2 loads a blank screen for me, all previous levels were fine and 2.3 loads. Windows, Firefox 149.

Edit: Confirmed fixed.

agrishin yesterday at 5:35 PM
Great project! I somehow missed whole cpu architecture topic, so gonna catch up on that now
joha4270 yesterday at 7:51 PM
So, is there anything about GPU's in here right now?

I didn't actually finish Act 2, but it seems to end in a conventional processor with the GPU first coming after another two acts currently under construction.

dcreater yesterday at 11:44 PM
Nice vibe coded project. There are a few UX holes i've encountered so far: No way to go to the next lesson if we dismiss the modal (have to go back to the tree and then click the next lesson)? more hints or step wise reveal if user gets stuck will be very helpful
kongchu2 yesterday at 8:48 PM
Soooo cool! I will keep try this
schlecht_ yesterday at 5:46 PM
Love it, thanks! Would you mind making it possible for me to see my "circuit" after running the tests? Currently, I can't go back to the circuit I created.
treelover yesterday at 6:22 PM
I like the concept! What tools did you use to build it?
NooneAtAll3 yesterday at 7:39 PM
truth table minigame is lmost unplayable in dark mode

also it kept showing the same table to me like 4 times

tithos yesterday at 5:58 PM
Cool concept, but it should be mobile friendly
lukebechtel yesterday at 8:46 PM
really fun :) thanks!
fragmede yesterday at 7:25 PM
nottorp yesterday at 5:12 PM
În a few years it will be the only way to explain the kids what a GPU is. Unless you work for an “AI” shop and sneak them into the data center.
NooneAtAll3 yesterday at 7:45 PM
level 1.10 I put 2 AND gates and only one of them works...
SilentM68 yesterday at 5:30 PM
This is very cool!

We need more games like this so that the younger population get some sort of exposure to the hardware side of things, before AI takes over that field. I would also think that take-home electronic and soldering kits for adults and younger folks would be another way to reduce dependance on AI.

NooneAtAll3 yesterday at 7:27 PM
how do I remove/delete elements?
PunchyHamster yesterday at 7:52 PM
...why capacitor has 3 pins ?
skyskys yesterday at 6:13 PM
wow looks really cool, although seems kinda useless at first look.
testaccount28 yesterday at 6:57 PM
not playing past the truth tables bs
himmelsee2018 yesterday at 7:31 PM
[flagged]
aritzdf yesterday at 7:11 PM
[flagged]
bingbong06 yesterday at 4:53 PM
[flagged]
aritzdf yesterday at 7:05 PM
[flagged]