-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"bitwise AND" and "bitwise XOR" are not working #18
Comments
Hi, |
Hi I used this instruction to generate asm file and this is the asm code for "XOR" and this is for "AND" |
I think the problem in the execution unit itself |
Why do you think so? |
Hi skordal, I have three scenarios: All programs that I tried (and - or - xor - not -add - sub) are working perfectly on scenario 1 and 3. That is because the instructions aren't executed continuously. But when I tried using the second scenario the error I mentiond before is present due to continuously execution. The output is double executed! How? That is why I think the problem in execution unit as it double execute the instruction when it is pipelined |
Hi I synthesised your potato SoC and I tried a "bitwise AND" and "bitwise XOR" and thehre is a bug while execute these operations
This is the "AND" code. In the comment you will find the result that is expected

This is the simulation of "AND" code on modelsim. You will find at 86988ps alu_x = 0x11, alu_y = 0x5B, and alu_result = 0x11.

alu_x should be 0x31 and this is wrong to be sure I will show you the contents of the memory
the output is right as expected because the alu_x is the result as you will understand in "XOR" code.
This is the contents of memory and all is right.

This is the "XOR" code. In the comment you will find the result that is expected

This is the simulation of "XOR" code on modelsim. You will find at 25754ps alu_x = 0x31, alu_y = 0x5B, and alu_result = 0x6A.


and all is right as expected
but in the second image you will find at 25805ps alu_x = 0x6A, alu_y = 0x5B, and alu_result = 0x31.
alu_x has the result of the previus operation and this is not expected so the output is 0x31.
This output is stored in the memory as it is not right.
This is the contents of the memory (XOR)

z y x
31 31 5B 00
The text was updated successfully, but these errors were encountered: