Jump to content

xor operation


amitk3553

Recommended Posts

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

Link to comment
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...