help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bitcmp error in octave 3.6.2 ?


From: Andreas Corneliussen
Subject: bitcmp error in octave 3.6.2 ?
Date: Tue, 11 Jun 2013 13:06:14 +0200

Hi

I were in the middle of using octave to generate input files for some VHDL testbench development I am doing. What I use it for is to make some calculations and save both input and output values as bit-vectors in a file.
This time, however, i had some negative numbers in both input and output values and I needed therefore to use the bitcmp function to calculate the two's-complement of the negative numbers.
Here I think that I maybe have found an error. The negative numbers are calculated simply as an bitwise XOR with the largest representable value in the unsigned datatype (i.e. 0xFF for 8 bit), whereas the correct two's-complement should be calculated as (a bitwise xor with the largest possible number) +1

I have changed this locally on my PC really easy, but I do not know where to file bugs and patches so that others can get information about this.

Med venlig hilsen / Best Regards / Mit frendlichen Grüssen

Andreas Corneliussen     Ektos A/S
Development Engineer       Farvervej 35
                                        DK-8800 Viborg

Mobile: +45 3135 0886

reply via email to

[Prev in Thread] Current Thread [Next in Thread]