Error in testing the memory.hdl line 39

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

Error in testing the memory.hdl line 39

antble
Memory.cmp line 37-38:
|     -1 |  1  | 100111111001111 |     -1 |
|     -1 |  1  | 101000001001111 |     -1 |
|     -1 |  1  | 000111111001111 |      0 |

I was testing this part of the memory.tst on my memory.hdl file. It output the following



I did a paper tracing for this code and it seems that my output is correct but the memory.cmp says otherwise. For instance, since the load is 1, it will look at the previous load which is 1 since it's 1 it then take the previous input, which is -1, and save that in the memory address `010111111001111` thus expected output should be -1. Why is the expected output in the memory.cmp file zero (0)? What did I miss?
 
Reply | Threaded
Open this post in threaded view
|

Re: Error in testing the memory.hdl line 39

blazk
because thats the first time the memory address is accessed. It doesnt have any value yet (0).
the previous load and input is for different address, so its not counted.

If you notice all the address that is accessed for the first time, the out is 0