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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

1,847 次查看
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 项奖励
回复
1 回复

868 次查看
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 项奖励
回复