Jump to content
amitk3553

xor operation

Recommended Posts

Hello,

 

I have to perform xor operation between two following numbers 

 

Numbers

unsigned int a;

unsigned int b;

 

Result

a xor_reduce b;

 

 

Is it possible as in above or some other way?

 

 

 

 

Regards

cam

Share this post


Link to post
Share on other sites

Cam,
 

I have to perform xor operation between two following numbers 

 

Numbers

unsigned int a;

unsigned int b;

 

Result

a xor_reduce b;

 

Why do you call the operation "xor reduce"?  A bitwise "xor" operation has the same number of bits as its operands.
Have you tried the (C++) operator "xor"?

unsigned int a = 42;
unsigned int b = 21;
unsigned int c = (a xor ; // or in short notation (a ^ 

An "xor reduce" operation as provided by the SystemC datatypes would be defined on a single operand and return a single bit after applying the "xor" bit by bit.  This is not defined for the built-in C++ datatypes.

hth,
  Philipp

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...