if-then-else icon indicating copy to clipboard operation
if-then-else copied to clipboard

Undefined behaviour in BINAC example

Open DestyNova opened this issue 4 years ago • 1 comments

This whole thing is really fascinating. I noticed that the BINAC instructions specify what to do for IF (A) < 0 and IF (A) > 0, but that leaves the behaviour for (A) == 0 undefined. It might be worth mentioning in the corresponding text, since it's treated as the "otherwise" case. I'd guess that they really meant IF (A) >= 0 there.

DestyNova avatar Dec 24 '20 07:12 DestyNova

Thanks for pointing out the discrepancy. The BINAC documentation is not very clear on what happens when the accumulator contains 0. Given the reference elsewhere to a "sign digit," it sounds like numbers were probably represented in such a way that there were both positive and negative representations of 0, depending on how the 0 happened to have been calculated. The instruction probably looked only at the sign, so 0 could probably go either way depending on the circumstances.

e-n-f avatar Dec 28 '20 08:12 e-n-f