CHIP missing error

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

CHIP missing error

Cyzicos
This post was updated on .
Hi, I am stuck in project 01. I can't open Or.hdl. I get the message code missing CHIP keyword in Line 6.
At first I did Not.hdl and And.hdl in TextEdit and it worked fine. Or.hdl didn't work. I read in this Forum that I need to save it with ANSI encoding. I got Sublime Text 2 and saved it as western(1252). It still didn't work. So I deleted Or.hdl and replaced it with an unopend version of Or.hdl and the hardware simulator couldn't even open this unopend file. This was previously possible. It is always the same error code.
I have no idea what I should try now. I deleted all my nand2tetris files and downloaded it again. I even downloaded the solution Or.hdl from github and the hardware simulator couldn't open it with the same error but in Line 5. I am on a mac with Yosemite.

Best regards Cyzicos
Reply | Threaded
Open this post in threaded view
|

Re: CHIP missing error

cadet1620
Administrator
Cyzicos wrote
Hi, I am stuck in project 01. I can't open Or.hdl. I get the message code missing CHIP keyword in Line 6.
The version of Or.hdl currently in the download has a broken comment that is causing this problem,
 1: // This file is part of www.nand2tetris.org
 2: // and the book "The Elements of Computing Systems"
 3: // by Nisan and Schocken, MIT Press.
 4: // File name: projects/01/Or.hdl
 5: 
 6:  **
 7:  * Or gate:
 8:  * out = 1 if (a == 1 or b == 1)
 9:  *       0 otherwise
10:  */
11:
12: CHIP Or {
 line 6 should read "/**"

Because of the missing "/", this line is not interpreted as a comment, and the first non-comment line in an HDL file must be the CHIP line.

--Mark