Questions tagged [nand2tetris]

For questions regarding the Nand2Tetris course assignments (and the accompanying book "The elements of computing systems") by Shimon Schocken and Noam Nisan. Including the Hack assembly language, the Jack VM and high level languages.

The Nand2Tetris course teaches how to build a modern computer from the first principles, and can be taken by each person with some programming knowledge in any language. All the CS related materials are taught and explained during the course.

The course can be taken in Coursera, and has two parts:

It has an accompanying software that can be found on the website, and a book named The Elements of Computing Systems: Building a Modern Computer from First Principles.

See also: Nand2Tetris forum

116 questions
0
votes
1 answer

Problem with an infinite loop in Memory Chip implementation (Nand2Tetris)

I have two almost identical Memory chip implementations, except that one works and the other, when I test in the hardware simulator with the Memory.tst, give an infinite loop when the program expects me to press Y key. The implementation that WORKS…
0
votes
1 answer

nand2tetris 16bit PC using 8bit registers

I have been asked to make a 16bit PC from the nand2tetris course using 2 8bit registers instead of 1 16bit one. I need to get these 2 8bit registers to function as 1 16bit register.I cant seem to get it to work, any help would be much…
Gaben
  • 21
  • 3
0
votes
1 answer

Initializing an array in Hack Assembly Code

What is the syntax for declaring initialized data, such as: initializing a global array in the hack assembly language? ex. int [] arr = {1, 2, 3, 4, 5} initializing a string literal? "hello world\n"
nccallaway
  • 13
  • 2
0
votes
1 answer

NAND gate not working properly in this HDL?

Whenever I input a = 1 and b = 1 I still get 0 and my inner pin of aAndNotb shows 1, however if I delete the Not gate I get a normally functioning Nand gate, what's the deal? /** * And gate: * out = 1 if (a == 1 and b == 1) * 0 otherwise …
zxzx28
  • 15
  • 4
0
votes
1 answer

HDL - PC.hdl but starting off with x2 8 bit registers

So, I basically need to create a PC.hdl, but starting off with x2 8 bit registers. Here's the starting point: // This file is BASED ON part of www.nand2tetris.org // and the book "The Elements of Computing Systems" // by Nisan and Schocken, MIT…
Ed2221
  • 9
  • 3
0
votes
1 answer

Nand2tetris Project4- Test failed - of Fill.asm: Comparison failure at line 3

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…
kirti purohit
  • 401
  • 1
  • 4
  • 18
0
votes
1 answer

I want to know how to calculate the jump instructions of a given virtual machine command in computer systems

I am learning about Hack Assembly Language and Jump Instructions. Could anyone please give me elaborate explanations of how you could calculate the jump instructions for a given virtual machine code. I would like to understand how to find the Jump…
0
votes
1 answer

C# opening a file stream passed as argument (Nand2Tetris Project 7)

Regarding the Nand2Tetris course, I've gotten to project 7 in the book and, being a huge C# noob, I thought I'd try to implement it in this language as practice. Specifically I'm trying to follow the Parser module's specification and I'm already…
Jaime Salazar
  • 349
  • 1
  • 2
  • 11
0
votes
2 answers

How to make a bit select chip in HDL?

BitSelect chip has: 3-bit input and 8-bit output. CHIP BitSelect { IN bit[3]; OUT out[8]; PARTS: // what parts to use? } How to achieve behaviour described by the truth table below? in out 000. 00000001 001. …
ezyzw1
  • 1
0
votes
1 answer

Mux(8-bits input and 4-bits output) in HDL

If sel = false, then out should contain the lower 4-bits of in (i.e. in[0], in[1], in[2], in[3]) If sel = true, then out should contain the upper 4-bits of in (i.e. in[4], in[5], in[6], in[7]) Here is my code and how to modify it....? CHIP…
ezyzw1
  • 1
0
votes
1 answer

Signed binary numbers multiplication - chip HDL code

As a part of Nand2Tetris course I'm taking this term, I have to build a binary number multiplication chip. I have built some chip which probably treats the most cases well enough. But it has some bugs when I multiply number likes -5 and -2. It gives…
HelpMe
  • 91
  • 10
0
votes
1 answer

Splitting symbols out of a string with specific symbols and other characters

I have written code to split a specific symbol out of a symbols list, but it is buggy and does not work properly. I hope someone can clarify and help me. What I would like to do is to split this string (for example) - 'game.run();' to this list of…
Daniel Sapir
  • 23
  • 1
  • 4
0
votes
1 answer

nand2tetris CPU.cmp line 17 problem; outM/(RAM[A]) decrements twice with MD=D-1 instruction;

I'm trying to work through the CPU.cmp file, to write out the instructions and see if what's written in CPU.cmp makes sense. On line 17 (time 8) |time| inM | instruction |reset| outM |writeM |addre| pc |DRegiste| |6+ | 0|0000001111101001|…
0
votes
1 answer

What is the point of '@R0', ..., '@R15', instead of '@0', ..., '@15'?

What is the point of this mnenomic? '@R0', ..., '@R15', instead of '@0', ..., '@15'? They likely have have mentioned it in the course, but I forgot, and it quite difficult to get an answer without having to go through several pages of text.
xing Zì
  • 391
  • 4
  • 16
0
votes
2 answers

Translate "let static 2 = argument 1" to VM code

Translate "let static 2 = argument 1" to VM code. VM code (the answer): push argument 1 pop static 2 My question Aren't we forgetting let. Shouldn't we push another argument 1 to the stack, and then pop it to local 2 too? In order to preserve the…
xing Zì
  • 391
  • 4
  • 16