<?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>Compiled Thoughts by John Ciacia &#187; logic</title>
	<atom:link href="http://www.johnciacia.com/tag/logic/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.johnciacia.com</link>
	<description>Science, Technology, and Beyond</description>
	<lastBuildDate>Fri, 06 Jan 2012 15:46:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>NAND and NOR</title>
		<link>http://www.johnciacia.com/2009/08/13/nand-and-nor/</link>
		<comments>http://www.johnciacia.com/2009/08/13/nand-and-nor/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 13:45:39 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[logic]]></category>
		<category><![CDATA[nand]]></category>
		<category><![CDATA[nor]]></category>

		<guid isPermaLink="false">http://www.johnciacia.com/?p=351</guid>
		<description><![CDATA[In addition to the logical operations defined here &#8211; computer scientists have defined two other operations (which are merely abstractions of operations defined in my previous article) since they are used so often. They are NAND and NOR, symbolically ↑ (&#124;) and ↓ (⊥). I say they are abstractions because they are simply the negation [...]]]></description>
			<content:encoded><![CDATA[<p>In addition to the logical operations defined <a href="http://www.johnciacia.com/2009/08/basic-logic/">here</a> &#8211; computer scientists have defined two other operations (which are merely abstractions of operations defined in my previous article) since they are used so often. They are NAND and NOR, symbolically ↑ (|) and ↓ (⊥). I say they are abstractions because they are simply the negation of AND and OR operations</p>
<h3>NAND</h3>
<table style="border:1px solid #666;border-collapse:collapse;text-align:center;" border="1" width="300">
<tbody>
<tr>
<td><strong>A</strong></td>
<td><strong>B</strong></td>
<td><strong>A AND B</strong></td>
<td><strong>NOT (A AND B)</strong></td>
<td><strong>A NAND B</strong></td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
</tr>
</tbody>
</table>
<p></p>
<h3>NOR</h3>
<table style="border:1px solid #666;border-collapse:collapse;text-align:center;" border="1" width="300">
<tbody>
<tr>
<td><strong>A</strong></td>
<td><strong>B</strong></td>
<td><strong>A OR B</strong></td>
<td><strong>NOT (A OR B)</strong></td>
<td><strong>A NOR B</strong></td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
</tr>
</tbody>
</table>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnciacia.com/2009/08/13/nand-and-nor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Illogical PHP Logic</title>
		<link>http://www.johnciacia.com/2009/07/17/illogical-php-logic/</link>
		<comments>http://www.johnciacia.com/2009/07/17/illogical-php-logic/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 22:50:31 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[logic]]></category>

		<guid isPermaLink="false">http://www.johnciacia.com/?p=218</guid>
		<description><![CDATA[In algebra, after we learn the basic distributive, commutative, and associative properties, the transitive property of equality is usually next in the curriculum. For those of you who do not recall the terminology, the transitive property of equality says if $a == $b and $b == $n then $a == $n. Using this age old [...]]]></description>
			<content:encoded><![CDATA[<p>In algebra, after we learn the basic distributive, commutative, and associative properties, the transitive property of equality is usually next in the curriculum. For those of you who do not recall the terminology, the transitive property of equality says if $a == $b and $b == $n then $a == $n. Using this age old logic, you can prove FALSE == TRUE and 0 == 1 in PHP. Here is how:</p>
<p>[code]<br />
$a = 0;<br />
$b = "Hooray for PHP logic and dynamic type casting?";<br />
var_dump(((FALSE == $a) == ($a == $b)) == ($b == TRUE));<br />
var_dump((((0 == $a) == ($a == $b)) == ($b == TRUE) == (TRUE == 1));[/code]<br />
Returns<br />
<code>bool(true)<br />
bool(true)<br />
</code><br />
Q.E.D</p>
<p>Note: I am comparing values not types. That being said, forgive me when I flame you for using PHP inappropriately. A string is NOT an integer and an integer is NOT a boolean. They should not be used as such.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnciacia.com/2009/07/17/illogical-php-logic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

Served from: www.johnciacia.com @ 2012-02-05 10:42:02 -->
