ALU test

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

ALU test

huskeyw
I do not understand how the ALU would calculate test part 2 as 0000000000000001
see compare file
|        x                     |        y                     |zx |nx |zy |ny | f |no|       out                   |zr |ng |
| 0000000000000000 | 1111111111111111 | 1 | 1 | 1 | 1 | 1 | 1 | 0000000000000001 | 0 | 0 |

so we have a as zero and b as 1's.. in any case steeping through the flags we have:
1 so zero x  so x = 0000000000000000
1 so neg x so x =  1111111111111111
1 so zero z so z =  0000000000000000
1 so neg z so z =   1111111111111111

at this point x and z are all 1's

now f =1  so we and, which an and of all 1's is all 1's
now no = 1 so we neg the output, a not of all 1's is all zeros'
so how is not the answer output should be 0000000000000000?

Reply | Threaded
Open this post in threaded view
|

Re: ALU test

huskeyw
so my ALU works, I passed all the test, I see my mistake.. the 1 for F mean to add not and... same issues I had with my ALU, but writing out my issue cause me to reread the definition in the header..

Reply | Threaded
Open this post in threaded view
|

Re: ALU test

WBahn
Administrator
Glad you found the mistake -- often when we try to explain the problem clearly to someone else it forces us to look at the problem more clearly ourselves and the issue becomes apparent. I've been known to explain problems to our dog and that's all it took.