My add16.hdl file is not working, and I can't figure out why. Everything seems to be right to me, but it keeps saying comparison failure at line 3.
Here is my code:
Working code emitted Here are pictures of the output and compare:
For project01 my hardware simulator was acting weird. It did this same thing for the Add.hld file, although the implementation of Add.hdl was correct. Is this the same thing happening, or am I really missing something?
If anything, could someone copy and paste my code and run it against the Add16.tst on your machine and reply with your results?
Your code is correct and passes the test on my system.
When the test is failing for you, all 'a' bits are 0 and all 'b' bits are 1.
All the internal 'carryN' bits can be seen to be 0, so all HalfAdder and FullAdder 'sum' bits should be 1.
That the 'out' value is 0 implies that the HalfAdder and FullAdder parts are not outputting the correct values.
Have you implemented and tested HalfAdder and FullAdder?
You can test your Add16 in isolation by creating an 02/test directory and copying only Add16.hdl, Add16.tst, and Add16.cmp into that directory. That will force the HardwareSimulator to use the built-in versions of HalfAdder and FullAdder.