<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>Comments on: how to rotate  bits of unsigned integer to  left/right by specific number of bits???</title>
	<atom:link href="https://www.emblogic.com/blog/09/how-to-rotate-bits-of-unsigned-integer-to-leftright-by-specific-number-of-bits/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.emblogic.com/blog/09/how-to-rotate-bits-of-unsigned-integer-to-leftright-by-specific-number-of-bits/</link>
	<description>Embedded System and ARM Training</description>
	<lastBuildDate>Mon, 07 Oct 2013 04:00:03 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>By: msiddarth</title>
		<link>https://www.emblogic.com/blog/09/how-to-rotate-bits-of-unsigned-integer-to-leftright-by-specific-number-of-bits/#comment-209</link>
		<dc:creator><![CDATA[msiddarth]]></dc:creator>
		<pubDate>Fri, 09 Sep 2011 08:43:58 +0000</pubDate>
		<guid isPermaLink="false">http://emblogic.org/blog/?p=837#comment-209</guid>
		<description><![CDATA[Go through this program and execute it you will get the result

#include
#define INT_BITS 32

/* Driver program to test below functions */
int main()
{
  int n = 16;
  int d = 2;
  printf(&quot;Left Rotation of %d by %d is &quot;, n, d);
  printf(&quot;%d&quot;, leftRotate(n, d));
  printf(&quot;\nRight Rotation of %d by %d is &quot;, n, d);
  printf(&quot;%d&quot;, rightRotate(n, d));
  getchar();
}
 
/*Function to left rotate n by d bits*/
int leftRotate(int n, unsigned int d)
{
   /* In n&lt;&lt;d, last d bits are 0. To put first 3 bits of n at
     last, do bitwise or of n&lt;&gt;(INT_BITS - d) */
   return (n &lt;&gt; (INT_BITS - d));
}
 
/*Function to right rotate n by d bits*/
int rightRotate(int n, unsigned int d)
{
   /* In n&gt;&gt;d, first d bits are 0. To put last 3 bits of at
     first, do bitwise or of n&gt;&gt;d with n &lt;&gt; d)&#124;(n &lt;&lt; (INT_BITS - d));
}]]></description>
		<content:encoded><![CDATA[<p>Go through this program and execute it you will get the result</p>
<p>#include<br />
#define INT_BITS 32</p>
<p>/* Driver program to test below functions */<br />
int main()<br />
{<br />
  int n = 16;<br />
  int d = 2;<br />
  printf(&#8220;Left Rotation of %d by %d is &#8220;, n, d);<br />
  printf(&#8220;%d&#8221;, leftRotate(n, d));<br />
  printf(&#8220;\nRight Rotation of %d by %d is &#8220;, n, d);<br />
  printf(&#8220;%d&#8221;, rightRotate(n, d));<br />
  getchar();<br />
}</p>
<p>/*Function to left rotate n by d bits*/<br />
int leftRotate(int n, unsigned int d)<br />
{<br />
   /* In n&lt;&lt;d, last d bits are 0. To put first 3 bits of n at<br />
     last, do bitwise or of n&lt;&gt;(INT_BITS &#8211; d) */<br />
   return (n &lt;&gt; (INT_BITS &#8211; d));<br />
}</p>
<p>/*Function to right rotate n by d bits*/<br />
int rightRotate(int n, unsigned int d)<br />
{<br />
   /* In n&gt;&gt;d, first d bits are 0. To put last 3 bits of at<br />
     first, do bitwise or of n&gt;&gt;d with n &lt;&gt; d)|(n &lt;&lt; (INT_BITS &#8211; d));<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mandeeshc</title>
		<link>https://www.emblogic.com/blog/09/how-to-rotate-bits-of-unsigned-integer-to-leftright-by-specific-number-of-bits/#comment-207</link>
		<dc:creator><![CDATA[mandeeshc]]></dc:creator>
		<pubDate>Thu, 08 Sep 2011 20:17:19 +0000</pubDate>
		<guid isPermaLink="false">http://emblogic.org/blog/?p=837#comment-207</guid>
		<description><![CDATA[I guess Shift Left and Shift Right may help. &lt;&gt; ?]]></description>
		<content:encoded><![CDATA[<p>I guess Shift Left and Shift Right may help. &lt;&gt; ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kuldeep Dhanotia</title>
		<link>https://www.emblogic.com/blog/09/how-to-rotate-bits-of-unsigned-integer-to-leftright-by-specific-number-of-bits/#comment-206</link>
		<dc:creator><![CDATA[Kuldeep Dhanotia]]></dc:creator>
		<pubDate>Tue, 06 Sep 2011 13:26:55 +0000</pubDate>
		<guid isPermaLink="false">http://emblogic.org/blog/?p=837#comment-206</guid>
		<description><![CDATA[use array in this program as bits]]></description>
		<content:encoded><![CDATA[<p>use array in this program as bits</p>
]]></content:encoded>
	</item>
</channel>
</rss>
