The Museum of HP Calculators

HP Forum Archive 20

[ Return to Index | Top of Index ]

wp34s / 16C Compatibility Items #2 and #3
Message #1 Posted by Jake Schwartz on 9 May 2011, 1:12 p.m.

Hi,

As I have been continuing through the HP16C manual, exercising the examples with the wp34s (currently with version 843), two additional items were encountered:

1. Pages 40-41 discuss the Out-of-Range flag with respect to the arithmetic operations, and it mentions that "when a result is out-of-range, the lower bits ...of the full answer will be returned. If the operations was multiply or divide in 1's or 2's Compliment mode, the most significant bit (sign bit) returned will match the sign bit of the full answer." At the top of page 41 is an example where with 2's compliment mode and word size 16, the decimal number 32767 is entered, followed by [2] [multiply] and the result on the 16C is decimal 32766 with the out-of-range flag set. On the wp34s, the result displayed is "-2" decimal. This would represent the entire lower 16 bits of the result (65534), had the word size been large enough to hold the entire result. It would seem important to me to preserve the sign of the result, like in the 16C.

2. In this same section, there is discussion of the absolute value function (ABS). It appears, however, that ABS does not apply to integers in the 34s, both from trying it out and from reading the manual's Index of Operations. Would it be possible to extend ABS to be relevant to integers as well?

Thanks,

Jake

      
Re: wp34s / 16C Compatibility Items #2 and #3
Message #2 Posted by Walter B on 9 May 2011, 2:38 p.m.,
in response to message #1 by Jake Schwartz

Hi Jake,

Thanks for testing. Again, both calculators obviously do not match. I agree on ABS should work for integers, too, unless in UNSIGN. Our software maintenance division is asleep now, however, so I ask for your patience.

Walter

            
Re: wp34s / 16C Compatibility Items #2 and #3
Message #3 Posted by Kiyoshi Akima on 9 May 2011, 2:58 p.m.,
in response to message #2 by Walter B

Is there any reason the absolute value shouldn't work in unsigned mode as well? I should think the implementation would be quite simple.

                  
Re: wp34s / 16C Compatibility Items #2 and #3
Message #4 Posted by Walter B on 9 May 2011, 3:47 p.m.,
in response to message #3 by Kiyoshi Akima

By definition, the unsigned mode uses all bits for the mantissa and *none* for the sign. So there can't be negative numbers ...

                        
Re: wp34s / 16C Compatibility Items #2 and #3
Message #5 Posted by Kiyoshi Akima on 9 May 2011, 4:40 p.m.,
in response to message #4 by Walter B

Quote:
By definition, the unsigned mode uses all bits for the mantissa and *none* for the sign. So there can't be negative numbers ...

Exactly. The absolute value should leave the number unchanged. It should not give an error, or the number of steps needed by Ulam's conjecture to reach one, or any other number.

            
Re: wp34s / 16C Compatibility Items #2 and #3
Message #6 Posted by Jake Schwartz on 9 May 2011, 3:58 p.m.,
in response to message #2 by Walter B

Quote:
Our software maintenance division is asleep now, however, so I ask for your patience.

Not a problem at all. I thought I'd simply mention the findings as they are found.

                  
Re: wp34s / 16C Compatibility Items #2 and #3
Message #7 Posted by Marcus von Cube, Germany on 9 May 2011, 4:13 p.m.,
in response to message #6 by Jake Schwartz

As you've probably already seen: If you are using the hardware port, please update. I had to fix some nasty bugs in the last few days.

As for ABS in integer unsigned mode: If it doesn't through an error, everything is fine as ABS is a NOP here. I agree that in the signed modes, ABS should be implemented.

                        
Re: wp34s / 16C Compatibility Items #2 and #3
Message #8 Posted by Kiyoshi Akima on 10 May 2011, 2:48 a.m.,
in response to message #7 by Marcus von Cube, Germany

Should ABS be a NOP? Shouldn't it set LASTx?

                              
Re: wp34s / 16C Compatibility Items #2 and #3
Message #9 Posted by Paul Dale on 10 May 2011, 2:53 a.m.,
in response to message #8 by Kiyoshi Akima

It sets last x.

It also terminates digit entry and sets stack lift.

i.e. all the usual things you'd expect of a single value single answer function.

- Pauli

                                    
Re: wp34s / 16C Compatibility Items #2 and #3
Message #10 Posted by Marcus von Cube, Germany on 10 May 2011, 6:05 a.m.,
in response to message #9 by Paul Dale

I still have to learn a lot about RPN. ;-)

      
Re: wp34s / 16C Compatibility Items #2 and #3
Message #11 Posted by Paul Dale on 9 May 2011, 5:50 p.m.,
in response to message #1 by Jake Schwartz

I'm confused. ABS is implemented for integers and I just checked it on my 30b and it appears to work fine.

The minus sign is shown way off to the left in base ten only. The base ten only part is correct, the sign placement is silly & I'll see about a fix.

Fixing the sign problem will be more involved. The basic arithmetic operations work a bit differently to most others in the way they handle the numbers -- needed for overflow and carry computation without resorting to assembly.

- Pauli

            
Re: wp34s ABS with Integers
Message #12 Posted by Jake Schwartz on 9 May 2011, 9:06 p.m.,
in response to message #11 by Paul Dale

Hi Pauli,

Quote:
I'm confused. ABS is implemented for integers and I just checked it on my 30b and it appears to work fine.

I was working with the reflashed 30b at my work before and I am now trying it on my reflashed 20b at home. It appears to work with 1's compliment mode, but not 2's compliment mode. For instance, in 1's compliment mode with WSIZE at 16 bits and base decimal, if you enter 252 +/- ENTER, then |x| changes the sign from negative to positive. Now change it to 2's compliment mode and re-enter 252 +/- and press |x| and the sign does not change to positive.

Thanks, Jake

                  
Re: wp34s ABS with Integers
Message #13 Posted by Paul Dale on 9 May 2011, 9:25 p.m.,
in response to message #12 by Jake Schwartz

Found the problem. It worked for some values but not most.

Fixed in next build.

- Pauli

      
Re: wp34s / 16C Compatibility Items #2 and #3
Message #14 Posted by Paul Dale on 9 May 2011, 6:54 p.m.,
in response to message #1 by Jake Schwartz

These should be fixed in the next build. I've probably broken other things in the process :-(

- Pauli


[ Return to Index | Top of Index ]

Go back to the main exhibit hall