comparison failure

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

comparison failure

lonelyjohner
the add16 run and failed. At the bottom program indicated that the comparison failure.
I wondered What could be the potential trigger of it? Thx.
Reply | Threaded
Open this post in threaded view
|

Re: comparison failure

cadet1620
Administrator
lonelyjohner wrote
the add16 run and failed. At the bottom program indicated that the comparison failure.
I wondered What could be the potential trigger of it? Thx.
Select View: Output and see what your Add16 is outputting. Select View: Compare to see what it should be outputting.
Sometimes it is easier to open Add16.cmp and Add16.out simultaneously in a text editor to compare them.

Also be aware that hardware bits are numbered from least to most signigicant. a[0] is the 2^0 bit and a[15] is the 2^15 bit.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re:Re: comparison failure

lonelyjohner

I see. I mistakenly type the 14th-way of input b to its 15th position. But it does not make any grammar mistake.I thought it should run to the end and just show different results. Does this mean even if there is little difference between comparison and output the program will treat it pretty "seriously" like some kind of grammar error?




At 2013-12-30 22:06:06,"cadet1620 [via Nand2Tetris Questions and Answers Forum]" <[hidden email]> wrote:
lonelyjohner wrote
the add16 run and failed. At the bottom program indicated that the comparison failure.
I wondered What could be the potential trigger of it? Thx.
Select View: Output and see what your Add16 is outputting. Select View: Compare to see what it should be outputting.
Sometimes it is easier to open Add16.cmp and Add16.out simultaneously in a text editor to compare them.

Also be aware that hardware bits are numbered from least to most signigicant. a[0] is the 2^0 bit and a[15] is the 2^15 bit.

--Mark


If you reply to this email, your message will be added to the discussion below:
http://nand2tetris-questions-and-answers-forum.32033.n3.nabble.com/comparison-failure-tp4027575p4027576.html
To unsubscribe from comparison failure, click here.
NAML


Reply | Threaded
Open this post in threaded view
|

Re: Re:Re: comparison failure

cadet1620
Administrator
lonelyjohner wrote
I see. I mistakenly type the 14th-way of input b to its 15th position. But it does not make any grammar mistake.I thought it should run to the end and just show different results. Does this mean even if there is little difference between comparison and output the program will treat it pretty "seriously" like some kind of grammar error?
The test will pause whenever there is a miscompare. You can use the step or run command to continue the test. It will stop again on the next miscompare.

This is more or less like a program that compiles correctly but fails during runtime, say with a divide-by-zero error.

--Mark

[It's better to reply using the forum rather that to reply to the notification e-mail; direct e-mail replies look really ugly. You should be able to hit the link at the bottom of the notification e-mail and get directly to the forum post.]