Regarding the MPC555 & Binary Arrays   I am writing a...

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Regarding the MPC555 & Binary Arrays   I am writing a...

1,845 Views
me
Contributor I

Regarding the MPC555 & Binary Arrays

 

I am writing a program that stores binary data (with a radix point) in an array and performs math operations on this data.  The result is stored in the array.

 

Is there a way to initialize the array so that it stores and displays data only in the binary format?  The issue is that the array displays the result in the Decimal format.

 

For example, I would like the following data entered to the array to yield the result shown:

 

      11  operand1 (binary)

   + 01  operand2 (binary)

    100  result (binary)

 

However, the result appears as '12'.

 

Your suggestions would be most appreciated.

 

Regards,

CodeMan

0 Kudos
Reply
1 Reply

866 Views
mr_venkatarao
Contributor I
Hi
   compiler take(convert into) data in hexadecimal whatever the data format we give.if we give 11 then it takes as 0xB.so 0xB+0x1=0xc(12 in decimal)
 
so  give like this operand1=0b11
                          operand1=0b01                   0b stands for binary,0x stands for hexadecimal
then you will ge result 4 (decimal)
 
 
0 Kudos
Reply