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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×