<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>EmbLogic &#187; Abhilash Singh</title>
	<atom:link href="https://www.emblogic.com/blog/author/abhilash-singh/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.emblogic.com/blog</link>
	<description>Embedded System and ARM Training</description>
	<lastBuildDate>Tue, 03 Mar 2020 13:00:06 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>Adding two numbers without using operators</title>
		<link>https://www.emblogic.com/blog/02/adding-two-numbers-without-using-operators/</link>
		<comments>https://www.emblogic.com/blog/02/adding-two-numbers-without-using-operators/#comments</comments>
		<pubDate>Tue, 11 Feb 2014 10:22:36 +0000</pubDate>
		<dc:creator><![CDATA[Abhilash Singh]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8285</guid>
		<description><![CDATA[we have provided many utilities in printf ,in which one of it is adding two positive number (only for positive numbers).here it goes like this, we all now that printf() On success,returns the total number of characters written. On failure, &#8230; <a href="https://www.emblogic.com/blog/02/adding-two-numbers-without-using-operators/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>we have provided many utilities in printf ,in which one of it is adding two positive number (only for positive numbers).here it goes like this,</p>
<p>we all now that printf() On success,returns the total number of characters written. On failure, a negative number is returned.now the new thing might some of you know that ,The &#8220;%*d&#8221; format specifier causes printf() to read two integers from its arguments, the first to set the field width and the second here it is a decimal number(depends on specifier).</p>
<p>now using           <strong>printf(&#8220;%*c%*c&#8221;,a,&#8217;  &#8216;,b,&#8217;  &#8216;);</strong>     we can get the sum of the number of a and b;</p>
<p>but how:- the first specifier * will be width (suppose a=3 and b=2) which gives the width 3 and 2 respectively and the second is blank spaces that means the blank spaces will print on 3rd and 2nd widths and printf will return 5 is is the sum (a+b=5)</p>
<p>sample program</p>
<p>printf(&#8220;enter the 1st number\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;a);<br />
printf(&#8220;enter the 2nd number\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;b);</p>
<p>printf(&#8220;%d&#8221;,printf(&#8220;%*c%*c&#8221;,a,&#8217; &#8216;,b,&#8217; &#8216;));<br />
By Mukund and Abhilash</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/adding-two-numbers-without-using-operators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PARALLEL PORT</title>
		<link>https://www.emblogic.com/blog/10/parallel-port-6/</link>
		<comments>https://www.emblogic.com/blog/10/parallel-port-6/#comments</comments>
		<pubDate>Sun, 06 Oct 2013 17:01:41 +0000</pubDate>
		<dc:creator><![CDATA[Abhilash Singh]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=7291</guid>
		<description><![CDATA[compatibility mode:    checked with hardware working fine now moving on Nibble mode]]></description>
				<content:encoded><![CDATA[<p>compatibility mode:    checked with hardware working fine now moving on Nibble mode</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/10/parallel-port-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiple data compression</title>
		<link>https://www.emblogic.com/blog/08/multiple-data-compression/</link>
		<comments>https://www.emblogic.com/blog/08/multiple-data-compression/#comments</comments>
		<pubDate>Wed, 07 Aug 2013 05:10:02 +0000</pubDate>
		<dc:creator><![CDATA[Abhilash Singh]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=7019</guid>
		<description><![CDATA[completed mdc of code lenght 4 now going ahead for next code lenght.]]></description>
				<content:encoded><![CDATA[<p>completed mdc of code lenght 4 now going ahead for next code lenght.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/08/multiple-data-compression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>find whether the number is power of 2 or not in one line expression</title>
		<link>https://www.emblogic.com/blog/08/find-whether-the-number-is-power-of-2-or-not-in-one-line-expression/</link>
		<comments>https://www.emblogic.com/blog/08/find-whether-the-number-is-power-of-2-or-not-in-one-line-expression/#comments</comments>
		<pubDate>Mon, 05 Aug 2013 06:48:09 +0000</pubDate>
		<dc:creator><![CDATA[Abhilash Singh]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=7007</guid>
		<description><![CDATA[Logic- when u convert a decimal number to its binary number then u get series of 1 and 0 ,Now if a number is power of two then u will observe it has only one (bit 1) and if you &#8230; <a href="https://www.emblogic.com/blog/08/find-whether-the-number-is-power-of-2-or-not-in-one-line-expression/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Logic- when u convert a decimal number to its binary number then u get series of 1 and 0 ,Now if a number is power of two then u will observe it has only one (bit 1) and if you perform binary and operation  of it with just a number previous to it ,then u will get Zeros.</p>
<p>For example</p>
<p>8=1000(binary form ) here u can see only one (bit 1) is there rest are zeros,<br />
Now the number just previous to 8 is 7<br />
so, 7=0111 and if u perform binary and operation on it as<br />
1000(8)<br />
(AND) 0111(7)<br />
&#8212;&#8212;&#8212;<br />
0000(0)<br />
&#8212;&#8212;&#8212;<br />
So if we perform AND operation between the number (which we want to check is a power of two or not) and the number just previous to it and result comes as zeros then its power of two otherwise it is not.</p>
<p>so here is the one line expression</p>
<p>if(!(num &amp; (num-1))&amp;&amp;num)</p>
<p>if the above condition true then the number is of power of two otherwise it is not.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/08/find-whether-the-number-is-power-of-2-or-not-in-one-line-expression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
