nand2tetris | Computer System Elements - Building a Modern Computer

 by   woai3c JavaScript Version: Current License: MIT

kandi X-RAY | nand2tetris Summary

kandi X-RAY | nand2tetris Summary

nand2tetris is a JavaScript library. nand2tetris has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Computer System Elements - Building a Modern Computer from Scratch
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              nand2tetris has a medium active ecosystem.
              It has 2321 star(s) with 409 fork(s). There are 48 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 0 open issues and 15 have been closed. On average issues are closed in 1 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of nand2tetris is current.

            kandi-Quality Quality

              nand2tetris has 0 bugs and 0 code smells.

            kandi-Security Security

              nand2tetris has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              nand2tetris code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              nand2tetris is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              nand2tetris releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of nand2tetris
            Get all kandi verified functions for this library.

            nand2tetris Key Features

            No Key Features are available at this moment for nand2tetris.

            nand2tetris Examples and Code Snippets

            No Code Snippets are available at this moment for nand2tetris.

            Community Discussions

            QUESTION

            How to implement nand2tetris processor on a real FPGA?
            Asked 2021-Mar-18 at 14:19

            I followed the nand2tetris course (https://www.nand2tetris.org/course) with the main intent to learn how to build a soft processor on a real FPGA.

            While the course was simple enough, now that I am starting with the FPGA implementation I feel a bit lost.

            I bought an Intel de10 nano FPGA(http://de10-nano.terasic.com/), and, having some Verilog knowledge from Uni, I was able to download "Quartus Prime Lite" and bootstrap with simple things like led blinking, etc...

            However, when it comes to implement the processor there are several things that are not clear to me:

            • How do I implement data memory? I saw there is a DDR3 module attached to the HPS of the FPGA. Is this something I need to directly use? Could I simply use a big 16bit register vector in HDL?
            • How do I implement the ROM from where the program is read? And how can I store the binary I assembled to then bootstrap the fetch-decode-execute loop?
            • How do I implement the screen and the keyboard? Indeed, there is also an HDMI controller on the board: do I have to implement all the logic myself?

            Those are the main questions I am struggling with at the moment. Could you point me out to any resource useful for a complete novice?

            Thanks,

            ...

            ANSWER

            Answered 2021-Mar-16 at 16:41

            For something as simple as a CPU from nand2tetris you'll be just ok with block RAMs, there's plenty of it on DE10Nano, likely enough for all your needs. Plus some more distributed memory.

            In case if you still want an access to DDR, DE10Nano is an SoC, with a hard DDR controller managed by the processor subsystem. It's very easy to interface with it over an Avalon bus (don't bother with AXI unless you really need maximum possible performance).

            For the ROM, just use LUTs. A simple static case in Verilog will be translated into an efficient LUT-based ROM.

            For accessing HDMI on DE10Nano, you can take a look at this example: https://github.com/combinatorylogic/soc/blob/a1d282d793548030cba940496bed90ff3a29c0ba/backends/c2/hw/de10nano/vga1080p.v (you can also take a look at the DDR access in the same project). Before you can use HDMI you'll need to set up the ADV7513 chip over i2c, see a copy of a library from Terasic under the same project.

            For a monochrome 800x600 video you'll be ok with a block RAM. For higher resolutions, as in the example above, you'll have to use DDR.

            Source https://stackoverflow.com/questions/66627417

            QUESTION

            The logic of designing a HDL parts from the beginning : DM
            Asked 2021-Feb-25 at 01:03

            I am taking the nand2tetris coursera course. I am trying to understand how you guys, can design the underlying mental process of finding the HDL core parts. For exemple, let's take the DMUX4way. What is the complete mental process to achieve the parts? I understand the logic behind once I see the result but I have difficulties to find out by myself Thanks

            ...

            ANSWER

            Answered 2021-Feb-25 at 01:03

            I find that it helps to break things down, and in complex situations, write down the truth table for the various signals (including the intermediate signals). Sometimes this will lead to an "aha" moment where you see a connection you can use to simplify things.

            You may also find it helpful to draw a graph that maps the flow of the signals through the circuit.

            Finally, the adage that "first make it work, then make it pretty" applies. Once you have something working, you can look at the design and find simplifications and optimizations. A good example of this is building the XOR circuit. Once you have the straightforward version, if you look at it hard, you can find the clever optimization.

            I suppose it is just one of those things where you have to practice until you get the knack of it. You may find it useful to revisit earlier projects with an eye to making them cleaner and easier for you to understand. There are often several ways to build the required circuit, but some ways may be more comprehensible to you. Also, I would recommend you get in the habit of commenting your designs; it is helpful to have a reminder what you were thinking when you did something.

            Source https://stackoverflow.com/questions/65699588

            QUESTION

            Logical expression that can catch i'th bit in 16-bit binary that corresponds to an integer value?
            Asked 2021-Feb-04 at 14:26

            I'm currently working on the last project in Nand2Tetris course.
            I've been trying to figure out how the logic expression works while implementing a bit-wise calculation.

            How Python can catch the right digits of 16-bit binary that correspond to an integer y when the twoToThe[i] == 0 (5 is 101 in binary, thus twoToThe[0] == 0 and twoToThe[2] == 0 are False and it's the right answer)
            but why does not show the exact opposite result when twoToThe[i] == 1?
            I thought it would return True on both twoTwoThe[0] == 1 and twoTwoThe[2] == 1

            Here's code below

            ...

            ANSWER

            Answered 2021-Feb-04 at 09:24

            The y & twoToThe[0] expressions evaluates to a new integer (as a result of a bitwise and operation between the bits of 5 and the bits of twoToThe[i]), not to a boolean as I think you were expecting. Check it:

            Source https://stackoverflow.com/questions/66041305

            QUESTION

            C++ regex capture group confusion
            Asked 2021-Jan-16 at 00:05

            I'm implementing the nand2tetris Assembler in C++ (I'm pretty new to C++), and I'm having a lot of trouble parsing a C-instruction using regex. Mainly I really don't understand the return value of regex_search and how to use it.

            Setting aside the various permutations of a C instruction, the current example I'm having trouble with is D=D-M. The result should have dest = "D"; comp = "D-M".

            With the current code below, the regex appears to find the results correctly (confirmed by regex101.com), but, not really correctly, or something, or I don't know how to get to it. See the debugger screenshot. matches[n].second (which appears to contain the correct comp value) is not a string but an iterator.

            Note that the 3rd capture group is correctly empty for this example.

            ...

            ANSWER

            Answered 2021-Jan-16 at 00:05

            gcc warns about unknows escape sequence \- Demo.

            You have to escape \,

            Source https://stackoverflow.com/questions/65745013

            QUESTION

            chip Mux4way16 not run ontil the end on ‏HardwareSimulator (VHDL)
            Asked 2021-Jan-12 at 20:46

            I'm tryng to build this chip:

            ...

            ANSWER

            Answered 2021-Jan-12 at 20:15

            Your logic for selecting what input to pass through appears to be incorrect. You should test it by creating a truth table for finalSel, notFinalSel, aAndB, cAndd and out for each of the 4 control conditions.

            In general, when doing these kinds of problems, the KISS principle holds; Keep It Simple and Stupid. You don't need any fancy logical manipulation of your sel[] bits, you can just use them directly. So once you get your version fixed (and understand where you went wrong), try doing a version that just consists of 3 Mux16's and nothing else. Once you have both versions working, you'll then understand the error that caused you to go down the wrong path in your first attempt, and that will be a valuable lesson going forward.

            Have fun!

            Source https://stackoverflow.com/questions/65690709

            QUESTION

            Confusion related to virtual machine in nand2tetris
            Asked 2020-Dec-15 at 00:33

            So while doing a course on nand2tetris I got stuck in this question.

            Basically this question is related to building a virtual machine. The virtual machine is quite similar to JVM.

            ...

            ANSWER

            Answered 2020-Dec-15 at 00:33

            There are 2 main parts to consider here:

            1. call foo 2 : this instruction tells vm to call funcion foo that takes 2 arguments ( which should be pushed on top of the stack before this call ).
              Calling any function means that you should take these steps as follow: push return address on top of stack (SP++), then push LCL, ARG, THIS,THAT ( SP+4). At this point SP should equal 310.
            2. function foo 4 : this is NOT the first instruction in function foo, but still it has an effect on SP as this means that functionfoo has 4 local variables. And these variables must be located somewhere. Where? On top of the stack. This means that before first 'real' instruction of foo gets executed, we must push 4 values onto the stack. What values? Well - according do vm specification it should be 0's, resulting in local variables being initiated to 0. This also means that we increase SP for every local variable ( SP + 4)

            This leads to conclusion that SP, after calling foo but before executing 1st instruction of this function will have value of 314.

            Source https://stackoverflow.com/questions/65292819

            QUESTION

            Nand2tetris Project4- Test failed - of Fill.asm: Comparison failure at line 3
            Asked 2020-Nov-23 at 01:34

            Not mentioning much about the Nand2tetris course and uploading the assembly file which interacts with the keyboard.

            Basically what this program does is when a key is pressed on the keyboard the screen turns black i.e. every pixel of the screen is supposed to turn black and when the keyboard is idle the screen stays white .

            Here is my code and it works well on my computer's hardware simulator but fails when I upload it for submission on coursera.

            ...

            ANSWER

            Answered 2020-Nov-23 at 01:34

            I'm sorry, but the solution you posted does not solve the problem. I think this is why coursera is rejecting it.

            When I run your solution through an assembler and then a cpu emulator I do not see the behavior required of Fill.asm. I'm comparing your solution to a solution I know to be correct and I am seeing different behavior.

            Here's a screenshot of the cpu emulator while pressing the keyboard using your solution:

            Here's what I expect to see:

            I suggest reviewing your solution.

            Hint Something missing from your solution is code to fill the screen.

            Here's why I think it's missing:

            1. Line 19 M=0 of your solution is where I believe the color is set to white
            2. I change line 19 to M=-1, setting the white color to black
            3. I expect to see the screen always painted black, but instead, I see only a small line of black in the top left corner of the emulator screen as seen below

            Hint: You have one loop ((LOOP)) that repeatedly listens for the keyboard. I expect to see another loop ((FILL), or whatever) which fills the entire section of memory dedicated to the SCREEN with white or black.

            Good luck.

            Source https://stackoverflow.com/questions/64398746

            QUESTION

            Resolving valgrind "possibly lost" memory leak
            Asked 2020-Jul-26 at 06:59

            I'm having trouble interpreting and debugging the valgrind output for a C program I just finished from an online course (nand2tetris) that is now functioning as expected. Here is a link to the source code: https://github.com/salario/nand2tetris/blob/master/assembler.c

            Here is the output from valgrind showing the possibly lost memory leak message. I compiled using this command: cc -g -o assembler assembler.c

            ...

            ANSWER

            Answered 2020-Jul-26 at 06:59

            These memory leaks are from the runtime, like /usr/lib/system/libdispatch.dylib, /usr/lib/libSystem.B.dylib, /usr/lib/dyld.

            I ran your program on linux (valgrind --leak-check=full ./a.out Pong.asm):

            Source https://stackoverflow.com/questions/63095324

            QUESTION

            Is there a way regex will match all the combinations of the tokens in `|` operator
            Asked 2020-Mar-07 at 08:47

            I am doing a parser for nand2tetris project. I want to check if the destination field is either M|D|MD|A|AM|AD|AMD and their different ways of combinations like MA not only AM.

            ...

            ANSWER

            Answered 2020-Mar-07 at 08:47

            QUESTION

            Comparison error when implementing a MUX gate in nand2tetris
            Asked 2020-Jan-15 at 09:43

            I am trying to implement a MUX (Multiplexor) gate in the nand2tetris course. I first tried myself, and I got an error. But no matter what I changed I always got the error. So I tried checking some code online, and this is what most people use:

            ...

            ANSWER

            Answered 2020-Jan-13 at 22:56

            From what can be seen your input pins are:

            Source https://stackoverflow.com/questions/59723931

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install nand2tetris

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/woai3c/nand2tetris.git

          • CLI

            gh repo clone woai3c/nand2tetris

          • sshUrl

            git@github.com:woai3c/nand2tetris.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular JavaScript Libraries

            freeCodeCamp

            by freeCodeCamp

            vue

            by vuejs

            react

            by facebook

            bootstrap

            by twbs

            Try Top Libraries by woai3c

            visual-drag-demo

            by woai3cJavaScript

            Front-end-articles

            by woai3cJavaScript

            MIT6.828

            by woai3cC

            vue-form-maker

            by woai3cJavaScript

            mini-vue

            by woai3cJavaScript