News for hackers. Stuff that matters.

sergex

Re:NandGame – Build a Computer from Scratch on Saturday November 02, 2024 @05:39AM (#42025176)
Author here. Yeah, the first level is special and perhaps half-baked. It felt like cheating to start with the NAND-gate as the atomic component since transistors are not NAND-gates. So I start with electric relays (since they logically correspond to transistors but are easier to visualize). But I didn't want to get into realistic simulation of electronic circuits with all the complexity this entails.

May I ask how you would have preferred to solve the first level if the game didn't have limitations?

Re:NandGame – Build a Computer from Scratch on Saturday November 02, 2024 @05:28AM (#42025139)
Is your problem with the user interface, i.e. how to connect wires from input to output, or is is with the logical problem of getting the correct output?
Re:NandGame – Build a Computer from Scratch on Friday December 04, 2020 @09:10AM (#25302355)
Yes that would be great!
Re:NandGame – Build a Computer from Scratch on Friday December 04, 2020 @09:09AM (#25302341)
I'm not using canvas. SVG is used for the connections, the rest is HTML. I'm not using any particular library for the diagrams, since I couldn't find anything suiting my purpose unfortunately.

I would definitely like to improve the look of the wires.

Re:NandGame – Build a Computer from Scratch on Friday December 04, 2020 @07:48AM (#25301664)
No it means you can either optimize for fewest components or fewest nand-gate. The text could be clearer.
Re:NandGame – Build a Computer from Scratch on Thursday December 03, 2020 @05:56PM (#25296512)
Author here - I would love to do a few layers below the nand gate.
Re:NandGame – Build a Computer from Scratch on Thursday December 03, 2020 @08:59AM (#25288851)
> I'd like to see the ability to "unbundle" the composite components.

This is a great idea, and you are not the first to suggest it. I just haven't gotten around to implement it.

Re:NandGame – Build a Computer from Scratch on Thursday December 03, 2020 @06:58AM (#25288019)
Yes it has improved a lot. Still more improvements to come!
Re:NandGame – Build a Computer from Scratch on Thursday December 03, 2020 @06:41AM (#25287934)
Thank you very much for the suggestions.
Re:NandGame – Build a Computer from Scratch on Thursday December 03, 2020 @04:51AM (#25287355)
Author here: The reason you drag from the input rather than output is that a pin can have only one input.
Re:NandGame – Build a Computer from Scratch on Thursday December 03, 2020 @04:06AM (#25287049)
Author here - thank you for the feedback!

The nand-count is based on how you built the components involved. So optimizing a component will have have cascading effects.

"This is the simplest solution!" means the solution with fewest individual components on the canvas. I realize the text could be clearer.

Re:NandGame – Build a Computer from Scratch on Thursday December 03, 2020 @03:44AM (#25286906)
Author here - It uses TypeScript and the Angular framework. Not because I prefer Angular in particular but because I had to learn it anyway for a work-related project. I think TypeScript is great.
Re:Ask HN: Scalable Hosting for Side Project on Sunday September 20, 2020 @12:50PM (#24535099)
It is a web site, but it seems they have a "sites" plan for 5$ a month. Looks great, thanks!

Ask HN: Scalable Hosting for Side Project

I have a side project which sometimes get many visitors. I initially hosted it on a cheap hosting provider, but on the first surge of visitors it got hugged to death. So I quickly moved to Microsoft Azure, and since then I had no downtime. However Azure have a relatively large monthly cost for such a non-commercial project. It seems more geared towards businesses.I wonder if there is some...

( Read More... | 3 comments | 3 points | on HN )
That would be really cool. I need to refactor a bit to allow different translations of the text, but I can get back to you when it is possible.
Code goes into how logic gates like the nand gate are built, so it does start at a lower level than Nand to Tetris which start with nand gates as primitives.
Yeah it currently only compares the solutions towards the minimum number of components of any type. I also intend to compare against the minimum number of nand gates overall, but this is not yet supported.
That would be really cool!
I made a small game inspired by the first lessons in the course: http://nandgame.com/
Re:Show HN: Online challenge: Build a CPU from scratch on Saturday July 14, 2018 @03:40PM (#17531975)
Thank you for finding the bugs! It shouldn't even be possible feed a 5 to a one-bit connector.

Yes I think I shot myself in the foot by designing the connectors so the labels could only be one or two letters. There is no technical reason they couldn't have descriptive labels like "clock" rather than "c". But it would probably require to turn the design "on the side", so the connectors are left-right rather than top-bottom.

I know I miss tests for a few of the levels.

Thanks for the nice words, it is encouraging!

Re:Show HN: Online challenge: Build a CPU from scratch on Friday July 13, 2018 @01:33PM (#17524945)
Actually there was a bug both in the text and in the code. A=1 should be 0x8FE0, but this was not specified correctly. I have fixed it now (I hope).
Re:Show HN: Online challenge: Build a CPU from scratch on Friday July 13, 2018 @04:00AM (#17521228)
Thanks, it is a very cool idea. I wanted to make the game really simple and accessible, but there seem to be interest in optimization challenges like finding the smallest/cheapest/fastest possible solution.
Re:Show HN: Online challenge: Build a CPU from scratch on Friday July 13, 2018 @03:53AM (#17521198)
You are correct, the text is wrong. It should be 128KB, not 64KB. A word is two bytes (on a 16-bit architecture) so we can address 64K words which is 128KB. (I think you mixed up byte and word in your comment, but I understand what you meant.)

The explanatory text for the level does not really define neither "byte" or "word", so beside fixing the error it also need more details. (But I want to avoid going down the rabbit hole of explaining that bytes can have different sizes than 8 and so on)

Re:Show HN: Online challenge: Build a CPU from scratch on Thursday July 12, 2018 @02:03PM (#17517098)
May I ask about browser/platform and what you did to make this happen? I am not able to reproduce the issue.
Re:Show HN: Online challenge: Build a CPU from scratch on Thursday July 12, 2018 @01:15PM (#17516664)
Yeah I'm unsure how to clearly communicate how the connectors work.
Re:Show HN: Online challenge: Build a CPU from scratch on Thursday July 12, 2018 @11:05AM (#17515320)
Interesting idea, but how should this be determined? Would it be a "cost" per transistor and wirelength, and then the minimum clock cycle time would be the "worst case" path through the circuit?
Re:Show HN: Online challenge: Build a CPU from scratch on Thursday July 12, 2018 @10:58AM (#17515254)
No, just ignorance on my part. I would be easy to flip input and output though.
Re:Show HN: Online challenge: Build a CPU from scratch on Thursday July 12, 2018 @10:53AM (#17515198)
Doh, you are correct about selector - the decoder should no be available here (and is not needed). And the bus definitely needs an introduction.
Re:Show HN: Online challenge: Build a CPU from scratch on Thursday July 12, 2018 @10:38AM (#17515021)
Thanks! A possible solution [spoiler alert!] is inv(add(inv(input), inv(0)) where inv(0) is an inverter without any input.

By the way I suppose the subtraction component should be available in this task. This would make is simpler. I had trouble deciding if increment should be before or after subtraction.

Re:Show HN: Online challenge: Build a CPU from scratch on Thursday July 12, 2018 @07:24AM (#17513531)
You need to special case "target a", it should be 1 in case bit 15 is 0. The error reporting could definitely be improved. It should probably display the exact mismatch, something like "with input XXX connector Y was 0 but was expected to be 1". Otherwise it gets to tedious to debug.

The m issue is a bug in the spec, thanks for discovering it.

Thank you for the feedback, it is much appreciated.

Older »