OpenCores
Issue List
Signed multiplication/division #46
Closed fujieda_at_arch opened this issue over 12 years ago
fujieda_at_arch commented over 12 years ago

I found two problems in signed multiplication and division.

Problem 1 -- multiplying a negative number by zero gives an incorrect answer. Example: -1 * 0 I expect: 0 Plasma gives: -0x100000000 I think sign_reg should be '0' when either of the operands is zero.

Problem 2 -- a division with a negative dividend gives a positive remainder. Example: -6 % 12 I expect: -6 Plasma gives: 6 I think resulting upper_reg should be negated in this case.

Thank you for your consideration.

rhoads was assigned over 12 years ago
rhoads commented over 12 years ago

Thank you for reporting the bugs. I modified mult.vhd as you suggested and added test cases in opcodes.asm. Now "0 * -1" should equal 0 and "-5 % 12" should equal -5.

rhoads closed this over 12 years ago

Assignee
rhoads
Labels
Bug