Page 1 of 1

Nand2Tetris/Hack Core

Posted: Sun May 24, 2020 7:21 pm
by sajattack
Hello, I have an unofficial core not many people know about, implementing the computer from the Nand2Tetris Coursera course, which is called Hack. It was largely an educational exercise and doesn't have many games but I'd be happy if y'all checked it out. I updated it last week to work with newest main. https://github.com/sajattack/Hack_MiSTer

Re: Nand2Tetris/Hack Core

Posted: Thu May 28, 2020 2:55 pm
by Moondandy
Hey, that's really cool you made a core. I'm not entirely sure what this is or what games can be played, and how to set it up to play them. Are you able to give a write up of what it is and how to set it up? Would be worth adding to the readme file on GitHub, hopefully with that you will get some more people downloading and get some feedback.

Maybe Pezz 82 will give it a bump on one of his update videos and perhaps it could even be added to Main.

Do you plan to work on any more cores?

Re: Nand2Tetris/Hack Core

Posted: Fri May 29, 2020 8:12 am
by sajattack
Pretty much the only game it runs is one player Pong. Get the Pong.bin here https://github.com/sajattack/Hack_MiSTe ... aster/roms and place it in /media/fat/games/Hack . I was disappointed many of the games written for the platform have larger memory requirements than what are actually specified. The repository links to the website for nand2tetris which has a video that explains what it is. I also ported the CHIP-8 core from MiST and have thought about doing Fairchild Channel F.

Re: Nand2Tetris/Hack Core

Posted: Tue Jun 02, 2020 2:37 pm
by Moondandy
A Fairchild F core would be great, that is one glaring hole in Mister's coverage of the early consoles. Hopefully it isn't too tricky. Quite surprised no one has done it already.

Re: Nand2Tetris/Hack Core

Posted: Tue Jun 02, 2020 8:50 pm
by ragnar
A Channel F core would be really great but... i wonder, since the Channel F has a "second layer of controls" on the button, how would it work on a regular joypad?

Re: Nand2Tetris/Hack Core

Posted: Wed Jun 03, 2020 2:06 pm
by sajattack
Moondandy wrote: Tue Jun 02, 2020 2:37 pm Hopefully it isn't too tricky. Quite surprised no one has done it already.
It has a very unusual CPU. So not a drop-in z80 or 6502 like a lot of other cores. But it's fairly simplistic in it's operation. Should be doable.

Re: Nand2Tetris/Hack Core

Posted: Wed Jun 03, 2020 5:02 pm
by Moondandy
Good luck and godspeed, keep us updated! I will be getting the games on my SD in anticipation.

Re: Nand2Tetris/Hack Core

Posted: Wed Jun 03, 2020 9:50 pm
by sajattack
Haha don't get too excited yet.

Re: Nand2Tetris/Hack Core

Posted: Mon Jun 22, 2020 6:44 pm
by Moondandy
I had a play of Pong, a basic but fun one player version. Do any other games run on it or have they all failed to adhere to the memory restrictions?

Re: Nand2Tetris/Hack Core

Posted: Sun Jun 28, 2020 3:44 am
by sajattack
Yeah it's really quite unfortunate that the course encourages students to develop their games in a simulator with no memory restrictions. Because if you actually try to run them with the specified memory limit, they fail. I have a friend who started developing a game within the memory limits but it's unfinished. I believe it's in the repo under "pumpkin"

Re: Nand2Tetris/Hack Core

Posted: Fri Jul 03, 2020 12:46 am
by Moondandy
Any plans to add the core into Main? Is there more you are wanting to do to it?

Hopefully more people make games that actually run on the spec.

Re: Nand2Tetris/Hack Core

Posted: Fri Jul 03, 2020 2:58 am
by sajattack
Sorg didn't want it on Main last time I asked.

Re: Nand2Tetris/Hack Core

Posted: Fri Jul 03, 2020 8:19 am
by lomdar67
It's a nice core, but including it into Main somehow contradicts the whole Nand2Teris project.

The whole purpose of the project is to build a "computer" in software (emulation) or in fpga yourself. It's not about running software on that "computer" but to understand the principles of a modern computer.

Re: Nand2Tetris/Hack Core

Posted: Thu Sep 24, 2020 2:48 pm
by Moondandy
Question for Sorg: now there is an "other" section, are there objections to this core being merged into Main?

Re: Nand2Tetris/Hack Core

Posted: Sun Sep 27, 2020 6:31 pm
by Zorro
As soon that I've got my Jack compiler done, I'll maybe create another Hack Game, just to get some ideas about the design of OO high level languages. I plan to make my own Hack core for the DE-10 nano, but as I'm still on the 2nd nand2tetris course yet, both projects might take some time.

Re: Nand2Tetris/Hack Core

Posted: Mon Sep 28, 2020 4:24 pm
by Zorro

Code: Select all

// I'd love to make this out of nand gates but my fpga would explode  
module RAM16K(
    input clk,
    input [15:0] in,
    
   ...

endmodule
Hahahaha, this is my favorite part of your code. :lol:
I will have a deeper look into your implementation. My own verilog knowledge is very rudimentary.

Re: Nand2Tetris/Hack Core

Posted: Thu Mar 18, 2021 8:28 pm
by cmstar0
I'm taking a class based on the Coursera / Nand2Tetris course as well and had the same thought of trying to make the core. Glad to see someone else had the same thought. I'll have to check this out after the class is finished. I think it would be great to have a 'Hack' core here for further educational value, or perhaps a write up guide to help others create their own.

Re: Nand2Tetris/Hack Core

Posted: Fri Mar 19, 2021 1:32 am
by pgimeno
What are the specs of this machine?

Re: Nand2Tetris/Hack Core

Posted: Fri Mar 26, 2021 2:11 pm
by pgimeno
pgimeno wrote: Fri Mar 19, 2021 1:32 am What are the specs of this machine?
Anyone?

I haven't found anything concrete in the Nand2Tetris course pages. How does it compare to Gigatron? I wrote a full spec of Gigatron here: viewtopic.php?p=11342#p11342

Re: Nand2Tetris/Hack Core

Posted: Wed Apr 21, 2021 2:26 am
by sajattack
It's a 16 bit machine that runs at about 1 million instructions per sec in my implementation, but the instructions are very RISC and hardly do anything. For example iirc a memory access requires two instructions. Resolution is 512x256 1bpp. 16384 16 bit words of RAM and 32768 16 bit words of instruction ROM.