<?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>Software Engineer Training</title>
	<atom:link href="http://www.software-engineer-training.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.software-engineer-training.com</link>
	<description>Knowledge, tools, and methods for defining requirements and performing design, implementation, testing and maintenance</description>
	<lastBuildDate>Wed, 21 May 2008 14:17:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Having Trouble with php_sessions?</title>
		<link>http://www.software-engineer-training.com/questions-and-answers/having-trouble-with-php_sessions/</link>
		<comments>http://www.software-engineer-training.com/questions-and-answers/having-trouble-with-php_sessions/#comments</comments>
		<pubDate>Wed, 21 May 2008 14:17:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Questions and Answers]]></category>

		<guid isPermaLink="false">http://www.software-engineer-training.com/questions-and-answers/having-trouble-with-php_sessions/</guid>
		<description><![CDATA[Are you have trouble with your PHP powered application? Are you receiving an error that mentions problems with php_sessions? If so, we may have the solution for you!
Recently the webhost Ipower migrated to a new hosting platform called Vdeck 3.0. In so doing, some of the changes have caused certain php powered applications to stop [...]]]></description>
			<content:encoded><![CDATA[<p>Are you have trouble with your PHP powered application? Are you receiving an error that mentions problems with php_sessions? If so, we may have the solution for you!</p>
<p>Recently the webhost Ipower migrated to a new hosting platform called Vdeck 3.0. In so doing, some of the changes have caused certain php powered applications to stop working. I believe this also affects a few other hosts such as Powweb and Ipowerweb, and any Ipower reseller hosts that just upgraded to vdeck 3.0.There are two ways to solve the problem. The best way would be to edit your php.ini file. However, out of fear of breaking all my working PHP applications, I decided to simply made a change in the applications not currently working to fix the issue.</p>
<p>The following is the solution I used.</p>
<p>I created a folder called &#8220;phpsessions&#8221; outside of my public_html folder. That is to say, if the following is the path to my public_html folder:</p>
<p>/home/users/blah/blah/public_html</p>
<p>then I created:</p>
<p>/home/users/blah/blah/phpsessions/</p>
<p>Next, open up your PHP application and look for the file where you start your sessions using  &#8220;session_start();&#8221;</p>
<p style="margin: 5px 20px 20px">Look for:</p>
<p class="smallfont" style="margin-bottom: 2px">Quote:</p>
<table border="0" cellpadding="6" cellspacing="0" width="100%">
<tr>
<td class="alt2" style="border: 1px inset ">//Start the session<br />
session_start();</td>
</tr>
</table>
<p>Replace with:</p>
<p class="smallfont" style="margin-bottom: 2px">Quote:</p>
<table border="0" cellpadding="6" cellspacing="0" width="100%">
<tr>
<td class="alt2" style="border: 1px inset ">//Start the session	ini_set(&#8221;session.save_path&#8221;,&#8221;/home/users/blah/blah/phpsessions/&#8221;);<br />
session_start();</td>
</tr>
</table>
<p>Hopefully this solution will help others experiencing problems with their PHP applications!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.software-engineer-training.com/questions-and-answers/having-trouble-with-php_sessions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is this Mysterious SQLDebugger Windows User Account</title>
		<link>http://www.software-engineer-training.com/questions-and-answers/what-is-this-mysterious-sqldebugger-windows-user-account/</link>
		<comments>http://www.software-engineer-training.com/questions-and-answers/what-is-this-mysterious-sqldebugger-windows-user-account/#comments</comments>
		<pubDate>Wed, 21 May 2008 14:16:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Questions and Answers]]></category>

		<guid isPermaLink="false">http://www.software-engineer-training.com/questions-and-answers/what-is-this-mysterious-sqldebugger-windows-user-account/</guid>
		<description><![CDATA[Have you just discovered a mysterious SQLDebugger Windows User Account on your system? Are you wondering what the heck it&#8217;s doing there or maybe how it even got there? Have you been thinking about just deleting the SQLDebugger account and crossing your fingers that this does not lead to any nasty side effects? If you&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<p>Have you just discovered a mysterious SQLDebugger Windows User Account on your system? Are you wondering what the heck it&#8217;s doing there or maybe how it even got there? Have you been thinking about just deleting the SQLDebugger account and crossing your fingers that this does not lead to any nasty side effects? <strong>If you&#8217;re not running an SQL Server and have no plans of doing any SQL Server Debugging, then go ahead and just delete the SQLDebugger account, it&#8217;s safe to do so! </strong></p>
<p>The SQLDebugger Windows user account is created when the <strong>SQL Debugger Registry2</strong> DCOM server process (Sqldbreg2.exe) is registered. If you&#8217;ve installed SQL Server, then this process will be registered and therefore the SQLDebugger Windows user account will be created on your system. This account is used for connecting to a database server for debugging purposes. In such a case, you may actually want to keep the user account&#8230; But what if you haven&#8217;t even installed SQL Server&#8230; What the heck is SQLDebugger doing on your computer then?</p>
<p>Microsoft Visual Studio .NET applications use SQL Server Debugging to debug SQL Server stored procedures. So guess what that means? If you&#8217;ve installed Microsoft Visual Studio .NET, then you&#8217;ll have the<strong> </strong>SQLDebugger Windows user account created on your machine, even if you have no intentions of ever using it. While there is no danger in keeping the SQLDebugger account around, since it was created without your permission or without you even knowing about it and since it serves no purpose unless you are doing database debugging, JUST DELETE IT!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.software-engineer-training.com/questions-and-answers/what-is-this-mysterious-sqldebugger-windows-user-account/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Place Ads After the First Post in a phpBB Topic?</title>
		<link>http://www.software-engineer-training.com/questions-and-answers/how-to-place-ads-after-the-first-post-in-a-phpbb-topic/</link>
		<comments>http://www.software-engineer-training.com/questions-and-answers/how-to-place-ads-after-the-first-post-in-a-phpbb-topic/#comments</comments>
		<pubDate>Wed, 21 May 2008 14:15:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Questions and Answers]]></category>

		<guid isPermaLink="false">http://www.software-engineer-training.com/uncategorized/how-to-place-ads-after-the-first-post-in-a-phpbb-topic/</guid>
		<description><![CDATA[Have you ever been reading a phpBB forum when all of a sudden you were confronted with an advertisement after reading a post? An ad so cleverly situated you just had to take the time to notice it and give it a click just out of respect for how it was delivered so sneakily to [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever been reading a phpBB forum when all of a sudden you were confronted with an advertisement after reading a post? An ad so cleverly situated you just had to take the time to notice it and give it a click just out of respect for how it was delivered so sneakily to you after you finished reading something useful rather than before&#8230; If you had not finished reading the post because it wasn&#8217;t any good you would have never seen the ad. By placing ads after the first post in a topic in phpBB you are displaying your sponsors only after having earned the right to do so rather than bombarding visitors right away. You are also increasing the chance that your ad gets noticed.</p>
<p>That being said, how the heck do you actually do it?</p>
<p>First, open up &#8220;viewforum_body.html&#8221;. If you are using the prosilver theme you can find this file here:</p>
<blockquote><p> styles/prosilver/template/viewforum_body.html</p></blockquote>
<p>Now search that file for the following text:</p>
<blockquote><p><code>&lt;!-- END postrow --&gt;</code></p></blockquote>
<p>Right before the line above, paste the following code into the file:</p>
<blockquote><p>   &lt;!&#8211; IF postrow.S_FIRST_ROW &#8211;&gt;<br />
&lt;div class=&#8221;post bg2&#8243;&gt;<br />
&lt;div class=&#8221;inner&#8221;&gt;&lt;span class=&#8221;corners-top&#8221;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;</p>
<p>&lt;div class=&#8221;postbody&#8221;&gt;<br />
&lt;h3&gt;Sponsor&lt;/h3&gt;</p>
<p>&lt;div class=&#8221;content&#8221; style=&#8221;text-align: center;&#8221;&gt;<br />
<strong>THE CODE FOR YOUR AD GOES HERE</strong><br />
&lt;/div&gt;<br />
&lt;/div&gt;</p>
<p>&lt;dl class=&#8221;postprofile&#8221; id=&#8221;profile0000&#8243;&gt;<br />
&lt;dt&gt;<br />
&lt;strong&gt;&lt;u&gt;Featured Sites&lt;/u&gt;&lt;/strong&gt;<br />
&lt;/dt&gt;</p>
<p>&lt;dd&gt;&lt;a href=&#8221;http://www.looble.com&#8221;&gt;Looble Network&lt;/a&gt;&lt;/dd&gt;<br />
&lt;dd&gt;&lt;a href=&#8221;http://www.free-games-center.com/&#8221;&gt;Free Games Center&lt;/a&gt;&lt;/dd&gt;<br />
&lt;dd&gt;&lt;a href=&#8221;http://www.software-engineer-training.com/&#8221;&gt;Software Engineer Training&lt;/a&gt;&lt;/dd&gt;<br />
&lt;dd&gt;&lt;a href=&#8221;http://flogger.looble.com/&#8221;&gt;Flogger&lt;/a&gt;&lt;/dd&gt;<br />
&lt;dd&gt;&lt;a href=&#8221;http://www.writerdatabase.com/&#8221;&gt;Writer Database&lt;/a&gt;&lt;/dd&gt;<br />
&lt;dd&gt;&lt;a href=&#8221;http://www.tamramaew.com/&#8221;&gt;Tamra Maew&lt;/a&gt;&lt;/dd&gt;<br />
&lt;dd&gt;&lt;a href=&#8221;http://www.squishyrecords.com/&#8221;&gt;Squishy Records&lt;/a&gt;&lt;/dd&gt;<br />
&lt;/dl&gt;</p>
<p>&lt;div class=&#8221;back2top&#8221;&gt;&lt;a href=&#8221;#wrap&#8221; class=&#8221;top&#8221; title=&#8221;{L_BACK_TO_TOP}&#8221;&gt;{L_BACK_TO_TOP}&lt;/a&gt;&lt;/div&gt;<br />
&lt;span class=&#8221;corners-bottom&#8221;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;hr class=&#8221;divider&#8221; /&gt;<br />
&lt;!&#8211; ENDIF &#8211;&gt;</p></blockquote>
<p>Make sure you place your ad code where I have bolded text above. Upload your new file and you are set! Out of love, we highly recommend you at least keep the Software Engineer Training  link as one of your featured sites.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.software-engineer-training.com/questions-and-answers/how-to-place-ads-after-the-first-post-in-a-phpbb-topic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is Subversion?</title>
		<link>http://www.software-engineer-training.com/questions-and-answers/what-is-subversion/</link>
		<comments>http://www.software-engineer-training.com/questions-and-answers/what-is-subversion/#comments</comments>
		<pubDate>Wed, 21 May 2008 14:13:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Questions and Answers]]></category>

		<guid isPermaLink="false">http://www.software-engineer-training.com/questions-and-answers/what-is-subversion/</guid>
		<description><![CDATA[Subversion (SVN) is a version control system used to maintain current and old versions of files such as source code, web pages and documents. It can be downloaded for free at http://subversion.tigris.org.The following are the current features listed on the official website:

Most current CVS features.Subversion is meant to be a better CVS, so it has [...]]]></description>
			<content:encoded><![CDATA[<p>Subversion (SVN) is a version control system used to maintain current and old versions of files such as source code, web pages and documents. It can be downloaded for free at <a href="http://subversion.tigris.org/" title="Subversion">http://subversion.tigris.org</a>.The following are the current features listed on the official website:</p>
<ul>
<li><strong>Most current CVS features.</strong>Subversion is meant to be a better CVS, so it has most of CVS&#8217;s features. Generally, Subversion&#8217;s interface to a particular feature is similar to CVS&#8217;s, except where there&#8217;s a compelling reason to do otherwise.</li>
<li><strong>Directories, renames, and file meta-data are versioned.</strong>Lack of these features is one of the most common complaints against CVS. Subversion versions not only file contents and file existence, but also directories, copies, and renames. It also allows arbitrary metadata (&#8221;properties&#8221;) to be versioned along with any file or directory, and provides a mechanism for versioning the `execute&#8217; permission flag on files.</li>
<li><strong>Commits are truly atomic.</strong>No part of a commit takes effect until the entire commit has succeeded. Revision numbers are per-commit, not per-file; log messages are attached to the revision, not stored redundantly as in CVS.</li>
<li><strong>Apache network server option, with WebDAV/DeltaV     protocol.</strong>Subversion can use the HTTP-based WebDAV/DeltaV protocol for network communications, and the Apache web server to provide repository-side network service. This gives Subversion an advantage over CVS in interoperability, and provides various key features for free: authentication, wire compression, and basic repository browsing.</li>
<li><strong>Standalone server option.</strong>Subversion also offers a standalone server option using a custom protocol (not everyone wants to run Apache 2.x). The standalone server can run as an inetd service, or in daemon mode, and offers basic authentication and authorization. It can also be tunnelled over ssh.</li>
<li><strong>Branching and tagging are cheap (constant time) operations</strong>There is no reason for these operations to be expensive, so they aren&#8217;t.Branches and tags are both implemented in terms of an underlying &#8220;copy&#8221; operation. A copy takes up a small, constant amount of space. Any copy is a tag; and if you start committing on a copy, then it&#8217;s a branch as well. (This does away with CVS&#8217;s &#8220;branch-point tagging&#8221;, by removing the distinction that made branch-point tags necessary in the first place.)</li>
<li><strong>Natively client/server, layered library design</strong> Subversion is designed to be client/server from the beginning; thus avoiding some of the maintenance problems which have plagued CVS. The code is structured as a set of modules with well-defined interfaces, designed to be called by other applications.</li>
<li><strong>Client/server protocol sends diffs in both directions</strong>The network protocol uses bandwidth efficiently by transmitting diffs in both directions whenever possible (CVS sends diffs from server to client, but not client to server).</li>
<li><strong>Costs are proportional to change size, not data size</strong>In general, the time required for a Subversion operation is proportional to the size of the changes resulting from that operation, not to the absolute size of the project in which the changes are taking place. This is a property of the Subversion repository model.</li>
<li><strong>Choice of database or plain-file repository implementations</strong>Repositories can be created with either an embedded database back-end (BerkeleyDB) or with normal flat-file back-end, which uses a custom format.</li>
<li><strong>Versioning of symbolic links</strong>Unix users can place symbolic links under version control. The links are recreated in Unix working copies, but not in win32 working copies.</li>
<li><strong>Efficient handling of binary files</strong>Subversion is equally efficient on binary as on text files, because it uses a binary diffing algorithm to transmit and store successive revisions.</li>
<li><strong>Parseable output</strong>All output of the Subversion command-line client is carefully designed to be both human readable and automatically parseable; scriptability is a high priority.</li>
<li><strong>Localized messages</strong>Subversion uses gettext() to display translated error, informational, and help messages, based on current locale settings.</li>
<li><strong>Repository mirroring</strong>Subversion supplies a utility, <tt>svnsync</tt> for synchronizing      (via either push or pull) a read-only slave repository with a      master repository.</li>
</ul>
<p>For those using Windows, you should also install <a href="http://tortoisesvn.tigris.org/download.html" title="TortoiseSVN">TortoiseSVN</a>. TortoiseSVN will allow you to easily interact with Subversion directly through Windows Explorer. While viewing files saved on your system, if you right-click the screen you&#8217;ll see some new commands that will allow you to connect to your SVN repository and add or checkout files.</p>
<p>In order to use TortoiseSVN you need to first install Subversion and set up a Subversion repository where the program can keep the copies of the documents that you&#8217;ve checked in. Subversion will then only save differences between versions of files that you&#8217;re storing in its repository. This is much more efficient than making copies of all files and ending up with multiple copies of the same files.</p>
<p>To create a repository, at a command prompt issue the following command:</p>
<p><strong>svnadmin create &#8211;fs-type=fsfs</strong><nobr><strong> </strong><wbr></wbr></nobr><strong>/data/SvnRepository</strong></p>
<p>The directory specified above should be an empty directory!</p>
<p>The next step once everything is installed is to just play with it and figure out how to work it before using it on an actual project. Remember, always play before work!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.software-engineer-training.com/questions-and-answers/what-is-subversion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transmission Control Protocol (TCP)</title>
		<link>http://www.software-engineer-training.com/higher-layer-network-protocols/transmission-control-protocol-tcp/</link>
		<comments>http://www.software-engineer-training.com/higher-layer-network-protocols/transmission-control-protocol-tcp/#comments</comments>
		<pubDate>Sun, 09 Dec 2007 16:09:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Higher Layer Network Protocols]]></category>

		<guid isPermaLink="false">http://www.software-engineer-training.com/higher-layer-network-protocols/transmission-control-protocol-tcp/</guid>
		<description><![CDATA[The Transmission Control Protocol (TCP) is used to provide reliable, in-order delivery of messages over a network.
Reasons for TCP 
The Internet Protocol (IP) works by exchanging groups of information called packets. Packets are short sequences of bytes consisting of a header and a body. The header describes the packet&#8217;s destination, which routers on the Internet [...]]]></description>
			<content:encoded><![CDATA[<p>The Transmission Control Protocol (TCP) is used to provide reliable, in-order delivery of messages over a network.</p>
<p><strong>Reasons for TCP </strong></p>
<blockquote><p>The Internet Protocol (IP) works by exchanging groups of information called packets. Packets are short sequences of bytes consisting of a header and a body. The header describes the packet&#8217;s destination, which routers on the Internet use to pass the packet along, in generally the right direction, until it arrives at its final destination. The body contains the application data.</p>
<p>In cases of congestion, the IP can discard packets, and, for efficiency reasons, two consecutive packets on the internet can take different routes to the destination. Then, the packets can arrive at the destination in the wrong order.</p>
<p>The TCP software libraries use the IP and provides a simpler interface to applications by hiding most of the underlying packet structures, rearranging out-of-order packets, minimizing network congestion, and re-transmitting discarded packets. Thus, TCP very significantly simplifies the task of writing network applications.</p>
<p>Source: <a href="http://en.wikipedia.org/wiki/Transmission_Control_Protocol" title="TCP">http://en.wikipedia.org/wiki/Transmission_Control_Protocol</a></p></blockquote>
<p><!-- Begin BidVertiser code --><br />
<script src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=84388&amp;bid=238068" language="JavaScript1.1" type="text/javascript"></script><br />
<noscript>&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;a href=&#8221;http://www.bidvertiser.com&#8221;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;marketing&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;</noscript><br />
<!-- End BidVertiser code --></p>
<p><strong> Applicability of TCP<br />
</strong></p>
<blockquote><p> TCP is used extensively by many of the Internet&#8217;s most popular application protocols and resulting applications, including the World Wide Web, E-mail, File Transfer Protocol, Secure Shell, and some streaming media applications.However, because TCP is optimized for accurate delivery rather than timely delivery, TCP sometimes incurs long delays while waiting for out-of-order messages or retransmissions of lost messages, and it is not particularly suitable for real-time applications such as Voice over IP. For such applications, protocols like the Real-time Transport Protocol (RTP) running over the User Datagram Protocol (UDP) are usually recommended instead.</p>
<p>Source: <a href="http://en.wikipedia.org/wiki/Transmission_Control_Protocol" title="TCP">http://en.wikipedia.org/wiki/Transmission_Control_Protocol</a></p></blockquote>
<p style="padding: 10px; text-align: center"><!-- Begin BidVertiser code --><br />
<script src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=84388&amp;bid=237969" language="JavaScript1.1" type="text/javascript"></script><br />
<noscript>&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;a href=&#8221;http://www.bidvertiser.com&#8221;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;marketing&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;</noscript><br />
<!-- End BidVertiser code --></p>
<p><strong>Using TCP </strong></p>
<blockquote><p>Using TCP, applications on networked hosts can create connections to one another, over which they can exchange streams of data using stream sockets. TCP also distinguishes data for multiple connections by concurrent applications (e.g., Web server and e-mail server) running on the same host.</p>
<p>In the Internet protocol suite, TCP is the intermediate layer between the Internet Protocol (IP) below it, and an application above it. Applications often need reliable pipe-like connections to each other, whereas the Internet Protocol does not provide such streams, but rather only best effort delivery (i.e., unreliable packets). TCP does the task of the transport layer in the simplified OSI model of computer networks. The other main transport-level Internet protocols are UDP and SCTP.</p>
<p>Applications send streams of octets (8-bit bytes) to TCP for delivery through the network, and TCP divides the byte stream into appropriately sized segments (usually delineated by the maximum transmission unit (MTU) size of the data link layer of the network to which the computer is attached). TCP then passes the resulting packets to the Internet Protocol, for delivery through a network to the TCP module of the entity at the other end. TCP checks to make sure that no packets are lost by giving each packet a sequence number, which is also used to make sure that the data is delivered to the entity at the other end in the correct order. The TCP module at the far end sends back an acknowledgment for packets which have been successfully received; a timer at the sending TCP will cause a timeout if an acknowledgment is not received within a reasonable round-trip time (or RTT), and the (presumably) lost data will then be re-transmitted. The TCP checks that no bytes are corrupted by using a checksum; one is computed at the sender for each block of data before it is sent, and checked at the receiver.</p>
<p>Source: <a href="http://en.wikipedia.org/wiki/Transmission_Control_Protocol" title="TCP">http://en.wikipedia.org/wiki/Transmission_Control_Protocol</a></p></blockquote>
<p><!-- Begin BidVertiser code --><br />
<script src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=84388&amp;bid=238068" language="JavaScript1.1" type="text/javascript"></script><br />
<noscript>&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;a href=&#8221;http://www.bidvertiser.com&#8221;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;marketing&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;</noscript><br />
<!-- End BidVertiser code --></p>
<p><strong>Services Provided by TCP</strong></p>
<p>TCP provides more services than UDP because it is connection oriented whereas UDP is not. TCP allows for point-to-point communication, adressing, multiplexing, demultiplexing, reliability, full-duplex communication, flow control and congestion control.</p>
<p>The reason the whole internet can actually even work is in part thanks to the design of TCP which can dynamically adapt to different properties such as bandwidth, delay and packet loss as well as recover from errors.</p>
<p>TCP splits user data into pieces no larger than 64K bytes and then sends each of these pieces as separate IP datagrams. When these IP datagrams are received at the destination, TCP reconstructs the original byte stream. In order to establish the connection between the sender and destination, sockets are used. Sockets are really just the combination of an IP address and a port number.</p>
<p style="padding: 10px; float: right"><!-- Begin BidVertiser code --><br />
<script src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=84388&amp;bid=237977" language="JavaScript1.1" type="text/javascript"></script><br />
<noscript>&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;a href=&#8221;http://www.bidvertiser.com&#8221;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;marketing&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;</noscript><br />
<!-- End BidVertiser code --></p>
<p>A connection is established between two computers using what is called a &#8220;three-way handshake&#8221;.</p>
<blockquote><p>The originator (you, hopefully)  sends an initial packet called a &#8220;SYN&#8221; to establish communication and &#8220;synchronize&#8221; sequence numbers in counting bytes of data which will be exchanged.  The destination then sends a &#8220;SYN/ACK&#8221; which again &#8220;synchronizes&#8221; his byte count with the originator and acknowledges the initial packet.  The originator then returns an &#8220;ACK&#8221; which acknowledges the packet the destination just sent him.  The connection is now &#8220;OPEN&#8221; and ongoing communication between the originator and the destination are permitted until one of them issues a &#8220;FIN&#8221; packet, or a &#8220;RST&#8221; packet, or the connection times out.  All the protocols of the Internet which need &#8220;connections&#8221; are built on the TCP protocol.  The &#8220;three way handshake&#8221; establishes the communication.  Much like you picking up your phone, getting a dial tone, dialing the number, hearing ringing, and then the other party saying &#8220;hello&#8221; or &#8220;mushi mushi.&#8221;</p>
<p>Source: <a href="http://www.pccitizen.com/threewayhandshake.htm" title="Three Way Handshake">http://www.pccitizen.com/threewayhandshake.htm</a></p></blockquote>
<p>TCP also closes a connection gracefully. Upon closing, the last data segment is followed by a FIN which also has a sequence number associated with it. This way, if the FIN arrives before all segments are received, it will wait for the expected data before closing.</p>
<p>The biggest source of errors in message transmission come from segments damaged in transmission or segments which entirely fail to arrive. The sender obviously does not know if the message sent has been received at the destination or not so it is necessary in TCP for the receiver to acknowledge receipt. In UDP, since reliability is not a concern and since it is a connectionless protocol, this acknowledgment does not occur.</p>
<p>Of course, we need to switch our point of view as soon as the destination sends an acknowledgment because at this point the receiver is acting as a sender. It is therefore entirely possible that the acknowledgment message gets lost or damaged in transmission as well. Therefore, it is necessary to have timers on both the sender and receiver which trigger a re-send after a certain amount of time to make sure the application does not end up in a dead-lock state where both sides are waiting to receive something from the other.</p>
<p style="padding: 10px; float: left"><!-- Begin BidVertiser code --><br />
<script src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=84388&amp;bid=237963" language="JavaScript1.1" type="text/javascript"></script><br />
<noscript>&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;a href=&#8221;http://www.bidvertiser.com&#8221;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;marketing&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;</noscript><br />
<!-- End BidVertiser code --></p>
<p>What is the value of the timer? It is possible to have a fixed timer or to use an adaptive scheme. Depending on the network, different value will be more appropriate for different situations and even for a given network, the perfect value can change depending on the amount of traffic on the network. If the timer value is set to be too short, re-transmission will clog the network causing further delay and therefore leading to even more ACK&#8217;s being sent!  This can therefore become a rather messy situation.  Of course, if the timer is set too high, performance will suffer because the delay before re-transmission leads to the application sitting and waiting. Therefore, the ideal timer will have some functionality to be aware of network conditions and then use this information in order to dynamically increase or decrease the timer.</p>
<p>Another problem thatmust be dealt with arises from the fact that TCP re-transmits messages as stated above in order to guarantee transmission. Since messages and ACK&#8217;s may be re-transmitted, we suddenly end up in a situation where it is possible for the destination to receive duplicates. For example, imagine that the receiver sends an ACK in order to confirm receipt of a message but high network traffic causes this ACK to travel slowly. Meanwhile the sender is waiting for the ACK when suddenly it&#8217;s timer expires and it therefore decides to re-transmit the message. Right after sending the message the ACK might finally arrive, however the duplicate has already been sent! The sender will now not send the message a third time because the ACK was received but the receiver will need to deal with the duplicate message that will soon be arriving! In order to deal with duplicates, the receiver can use the sequence number to determine if the message has already been received. However, for this to work correctly we are assuming that the sequence number space is large enough that it does not restart within the life-span of a packet. In a nutshell, the sequence space is a fixed number. When a connection is established the first message always starts at the first sequence number and eventually, if the connections has been open long enough and many messages have been sent, eventually the last available sequence number is reached. At this point, the next message sent will start back at the first sequence number.  Therefore, it is possible for two messages with the same sequence number to exist and not be duplicates!</p>
<p style="padding: 10px; float: right"><!-- Begin BidVertiser code --><br />
<script src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=84388&amp;bid=237977" language="JavaScript1.1" type="text/javascript"></script><br />
<noscript>&amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;a href=&#8221;http://www.bidvertiser.com&#8221;&amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;marketing&amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;</noscript><br />
<!-- End BidVertiser code --></p>
<p>Congestion is caused when too much traffic is flowing through a network that individual messages are delayed because messages are arriving more quickly than can be processed. When this occurs, routers will begin dropping packets, starting with those it feels are of a lower priority. Therefore, as congestion occurs, time-outs start to happen causing messages to be re-transmitted. This of course is done in order to make sure the message does in fact arrive, but for a system experiencing congestion, this reliability feature imply contributes to the congestion. TCP congestion control handles this by estimating the round trip delay by observing patterns of delay and then setting the timer so a value greater than the time estimated. The timer is set higher in order to account for round trip time variance.</p>
<p><strong>RTO &#8211; Re-transmission timeout</strong></p>
<p>As discussed above, a timer is set on both the sender and receiver upon transmitting a message. If an acknowledgment is not received before this timer expires then a time-out occurs which triggers the re-transmission of the message. Using a fixed timer is not a good idea because the main cause for such occurring is congestion. If congestion occurs on your network and you message times-out, if you re-transmit the same message and keep the timer at the same value, chances are the message will time-out yet again if network conditions have not improved. Therefore, if we assume congestion is the culprit, it is important to give the message some extra time upon re-transmission in order to see if this extra time is enough for it to reach the destination and be acknowledged. The act of increasing the timer each time a message is re-transmitted is referred to as re-transmission timeout backoff. The most common type of RTO backoff is binary exponential  backoff which takes the current timer value and multiplies it by two each time a message is re-transmitted.</p>
<p style="padding: 10px; float: left"><!-- Begin BidVertiser code --><br />
<script src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=84388&amp;bid=237977" language="JavaScript1.1" type="text/javascript"></script><br />
<noscript>&amp;amp;amp;lt;a href=&#8221;http://www.bidvertiser.com&#8221;&amp;amp;amp;gt;marketing&amp;amp;amp;lt;/a&amp;amp;amp;gt;</noscript><br />
<!-- End BidVertiser code --></p>
<p>Another issue that is important to consider is with respect to shrinking the timer back down. Re-transmitted messages should never be used as a guage when measuring RTT (round trip time) because the acknowledgment received could actually be for the first message transmitted and not for the re-transmitted one! Therefore, the RTO backoff should continue to be used until an ACK arrives for a message that has not been re-transmitted. At this point, it is up to the designer to decide how to implement the system. The timer can be left constant for a given amount of time and then upon receiving a certain number of messages without needing to re-transmit, the timer value can be divided by two in order to shrink it back down, meaning that perhaps network conditions have improved.</p>
<p><strong>Window Management</strong></p>
<p>Slow-start is part of the congestion control used in TCP in order to avoid sending more data than the network is able to handle.</p>
<p><strong>Slow-Start Algorithm </strong></p>
<blockquote><p>A slow-start algorithm consists of two distinct phases: the exponential growth phase, and the linear growth phase.</p>
<p>During the exponential growth phase, Slow-start works by increasing the TCP congestion window each time the acknowledgment is received. It increases the window size by number of segments acknowledged. This happens until either an acknowledgment is not received for some segment or a predetermined threshold value is reached. If a loss event occurs, TCP assumes this it is due to network congestion and takes steps to reduce the offered load on the network. Once a loss event has occurred or the threshold has been reached, TCP enters the linear growth (congestion avoidance) phase. At this point, the window is increased by 1 segment for each RTT. This happens until a loss event occurs.</p>
<p>Although the strategy is referred to as &#8220;slow-start&#8221;, its congestion window growth is quite aggressive.</p>
<p>The algorithm begins in the exponential growth phase initially with a congestion window size (cwnd) of 1 or 2 segments and increases it by 1 Segment Size (SS) for each ACK received. This behavior effectively doubles the window size each round trip of the network. This behavior continues until the cwnd reaches the size of the receivers advertised window or until a loss occurs.</p>
<p>When a loss occurs half of the current cwnd is saved as a Slow Start Threshold (SSThresh) and slow start begins again from its initial cwnd. Once the cwnd reaches the SSThresh TCP goes into congestion avoidance mode where each ACK increases the cwnd by SS*SS/cwnd. This results in a linear increase of the cwnd.</p>
<p>Source: <a href="http://en.wikipedia.org/wiki/Slow-start" title="TCP Slow-start">http://en.wikipedia.org/wiki/Slow-start</a></p></blockquote>
<p><strong>TCP Data Transfer</strong></p>
<p>When a TCP connection is established, a stream of bytes is what will actually be sent between communicating entities, not messages. Messages themselves can be sent by any combination of pieces which give a total of 2048 bytes.  Therefore, is you wish to send 4 messages each of which are 512 bytes, TCP might not actually send your message right away if it is set to wait for a total of 2048 bytes before transmitting. If this is the case, it will not send your 512 byte messages until 4 of these such messages are ready to be sent. TCP could also instead be set to send 2 pieces each of size 1024 bytes, and therefore only 2 messages need be ready in order to be transmitted. The important thing to understand is that a message being ready to be sent does not mean that this message itself is sent, but rather pieces of bytes which are then re-combined in order to re-create the message. Also, its important to note that TCP may decide to wait with your message and collect more data before transmitting. Certain flags can be used in order to request no delay.</p>
<p><strong>TCP Header</strong></p>
<p><a href="http://www.software-engineer-training.com/higher-layer-network-protocols/transmission-control-protocol-tcp/tcp-header/" rel="attachment wp-att-96" title="TCP Header"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/12/tcp_header.png" title="TCP Header" alt="TCP Header" height="80%" width="80%" /></a></p>
<p>Source: <a href="http://www.visi.com/~mjb/Drawings/" title="TCP Header">http://www.visi.com/~mjb/Drawings/</a></p>
<p><strong>TCP Header Fields </strong></p>
<p>Source and destination port &#8211; 16 bit address corresponding to the port which is associated with the value defined in the socket used to establish the connection.</p>
<p>Sequence and acknowledgment numbers &#8211;  These are both 32 bit numbers which are used to help ensure reliable delivery of messages. Every TCP packet send has a sequence number associated with it and the acknowledgment is used to communicate to the other entity which sequence number is expected next.</p>
<p>URG &#8211; this will be set to 1 if the urgent pointer is used. The pointer will indicate an offset from the current sequence number which informs the receiver at which point the urgent data ends.</p>
<p>ACK &#8211; set to 1 to indicate the acknowledgment is valid.</p>
<p>PSH &#8211; set to 1 to indicate pushed data. Pushed data is data that the sender force-delivered without waiting for the buffer to fill.</p>
<p>RST &#8211; set to 1 to indicate a reset. This can be used to reject a connection or to refuse an invalid segment. It can also be used if the host has become confused for whatever reason and therefore would like to re-establish the connection.</p>
<p>SYN &#8211; used in order to establish a connection. If SYN = 1 an ACK = 0 then a connection request is in progress. If SYN = 1 and ACK = 1 then a connection acceptance is in progress.</p>
<p>FIN &#8211; this is set to 1 in order to indicate the end of user data and to therefore close the connection. As discussed earlier, data may still be received after the FIN because the FIN also has a sequence number associated with it and it is possible that messages with an earlier sequence number arrive after the FIN which should actually be processed and which are.</p>
<p><strong>TCP Error Checking</strong></p>
<p>Error checking is accomplished by using the checksum field available in the TCP header. The receiver performs a calculation on the checksum field and the user data and if the result is not 0, this indicates that there is an error somewhere.</p>
<p style="padding: 10px; float: right"><!-- Begin BidVertiser code --><br />
<script src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=84388&amp;bid=237963" language="JavaScript1.1" type="text/javascript"></script><br />
<noscript>&amp;amp;amp;lt;a href=&#8221;http://www.bidvertiser.com&#8221;&amp;amp;amp;gt;marketing&amp;amp;amp;lt;/a&amp;amp;amp;gt;</noscript><br />
<!-- End BidVertiser code --></p>
<p><strong>TCP Options</strong></p>
<p>The options field available in the TCP header allows for extra features to be used or certain settings to be set. Below are some example:</p>
<p>- During connection, this field is used for connecting entities to negotiate an acceptable maximum segment size.</p>
<p>- Since network speeds have increased dramatically since TCP was first introduced, 16 bits used for sequence numbers is actually no longer enough and the problem of incorrect duplicate detection becomes a major concern. It is therefor possible to also use the options field to allow for an increase in the number of available sequence numbers from 2^16 to 2^32.</p>
<p>- The options field can also be used to include a time-stamp which can then be used in order to determine round trip time, information that can then be used for congestion control.</p>
<p><strong>Additional Time Issues</strong></p>
<p>Given all of the information presented above, there are some other issues to consider with respect to the timer.  As mentioned a persistence timer is essential in order to avoid deadlock situations. This timer will expire and cause the last message to be re-transmitted if no acknowledgment is received in a timely fashion. When using congestion control, it is possible for the available window size to go down to 0, which causes the sender to stop sending messages temporarily until it is notified that there is space again in the window. Therefore, even in this situation it is still important to occasionally have a timer expire causing the sender to ask the receiver if it has space in its window. This is necessary because imagine if an acknowledgment sent increasing the window size is lost, the system would be stuck waiting forever!</p>
<p>Of course, the above assumes that the problem is due to congestion. It is possible that there is no connection but that the entity you are communicating with is no longer available or has gone offline.  Is is therefore also important not to continue trying to send messages to this user forever, but to instead also maintain a keep-alive timer which will occasionally cause a message to be sent to the receiver asking, &#8220;are you still there?&#8221;. If no response is received, the connection should be terminated so resources are not wasted sending messages to an entity which is no longer available to receive these messages.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.software-engineer-training.com/higher-layer-network-protocols/transmission-control-protocol-tcp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Transport Layer and UDP</title>
		<link>http://www.software-engineer-training.com/higher-layer-network-protocols/the-transport-layer-and-udp/</link>
		<comments>http://www.software-engineer-training.com/higher-layer-network-protocols/the-transport-layer-and-udp/#comments</comments>
		<pubDate>Sat, 08 Dec 2007 22:12:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Higher Layer Network Protocols]]></category>

		<guid isPermaLink="false">http://www.software-engineer-training.com/higher-layer-network-protocols/the-transport-layer-and-udp/</guid>
		<description><![CDATA[Transport Layer 
The transport layer is one of the 7 layers of the OSI model.  It&#8217;s purpose is to provide robust end-to-end service to to the upper layers and is responsible for end-to-end delivery of the message. Therefore, the transport layer must consider addressing, reliability, flow control and multiplexing in order to accomplish it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Transport Layer </strong></p>
<p>The transport layer is one of the 7 layers of the OSI model.  It&#8217;s purpose is to provide robust end-to-end service to to the upper layers and is responsible for end-to-end delivery of the message. Therefore, the transport layer must consider addressing, reliability, flow control and multiplexing in order to accomplish it&#8217;s main goals.</p>
<p>Reliable delivery is not a compulsory service for the transport layer, however since this layer is expected to be responsible for delivering the messages from end-to-end, it only makes sense to implement reliable delivery at this layer. Reliable delivery is provided by using error control, sequence control,  loss control and duplication control.</p>
<p style="padding: 10px; float: right"><!-- Begin BidVertiser code --><br />
<script src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=84388&amp;bid=237977" language="JavaScript1.1" type="text/javascript"></script><br />
<noscript>&amp;lt;a href=&#8221;http://www.bidvertiser.com&#8221;&amp;gt;marketing&amp;lt;/a&amp;gt;</noscript><br />
<!-- End BidVertiser code --></p>
<p>Sequence control is very important because messages not arriving in order can cause very important information to be lost or even overwritten. For example, when one process relies on another, the order in which messages arrive will influence the final result meaning that sequence errors will lead to errors in the application. This is similar to the complexities encountered when working with databases or other applications that are multi-threaded. Consider performing a mathematical calculation. If one process retrieves the stored value to be used in the calculation just before the second process updates that value, then even if that value is updated, the first process is unfortunately using the incorrect value for its calculation.</p>
<p>Of course, if sequence control is an important issue, obviously so it loss control! If messages are not even received, the complexity in dealing with such is far more complex than worrying about putting messages back in order which can be accomplished by the use of sequence numbers. If messages are being lost after transmission over a network, it is not necessary to somehow make sure the lost messages are re-sent in a timely fashion. All this must be accomplished in a way such that performance of the system and entire network is not compromised.</p>
<p style="padding: 10px; float: left"><!-- Begin BidVertiser code --><br />
<script src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=84388&amp;bid=237963" language="JavaScript1.1" type="text/javascript"></script><br />
<noscript>&amp;amp;amp;lt;a href=&#8221;http://www.bidvertiser.com&#8221;&amp;amp;amp;gt;marketing&amp;amp;amp;lt;/a&amp;amp;amp;gt;</noscript><br />
<!-- End BidVertiser code --></p>
<p>Duplication control is important to consider as well because as the speed of networks continue to increase, it becomes possible for different messages to be identified as duplicated and discarded. Similarly, if a packet can become corrupted or erroneous, it is possible then for the sequence number of a real message to be incorrect and cause a duplicate. Also it is entirely possible for a duplicate message to be sent by the sender itself, and therefore this duplicate should be detected to avoid errors.</p>
<p>Flow control is yet another important component of transport to consider. Imagine all these messages that are being delivered over a network, some coming from very high-speed users, others from slower users possibly still using a dial-up connection. Without flow control, a slower user could quickly become completely flooded with messages and suddenly be unable to do anything. Flow control therefore establishes window sizes to try and make sure the network or users do not run into this problem.</p>
<p>Multiplexing refers to the process where multiple messages are combined into a single signal. Demultiplexing is the reverse process of taking a single signal and splitting it into multiple messages. The transport layer performs a multiplexing (to data link layer)/demultiplexing(from data link layer) function with respect to the interface between itself and the layers below it.</p>
<p>With regard to the transport layer, a connection is not necessarily required since messages can be sent by UDP which is connectionless. Therefore, a connection is only required when a connection-oriented transport protocol is being used. If using a connection-oriented transport protocol, then it is important to consider the complexities involved with connection establishment and connection release. Establishing a connection is a rather straight-forward concept. A connection request is sent, and then the sender waits for an acknowledgment confirming the connection. However, problems can occur when duplicate or expired connection requests or acknowledgments show up!</p>
<p><strong>UDP &#8211; User Datagram Protocol</strong></p>
<p style="padding: 10px; float: right"><!-- Begin BidVertiser code --><br />
<script src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=84388&amp;bid=237977" language="JavaScript1.1" type="text/javascript"></script><br />
<noscript>&amp;lt;a href=&#8221;http://www.bidvertiser.com&#8221;&amp;gt;marketing&amp;lt;/a&amp;gt;</noscript><br />
<!-- End BidVertiser code --></p>
<p>UDP is a way of sending data over a network, however unlike TCP, ordering and reliability is not part of the protocol. Because this reduces a significant amount of overhead, UDP is actually faster and more efficient than TCP. However, for applications that require reliable or guaranteed delivery, UDP will not be acceptable.  There is also no flow control or congestion control. UDP can have optional error detection, but does not have any method for recovery. Unlike TCP, UDP is compatible with packet broadcasting which is the sending of a message to everyone on a network</p>
]]></content:encoded>
			<wfw:commentRss>http://www.software-engineer-training.com/higher-layer-network-protocols/the-transport-layer-and-udp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Propositional Logic Rules</title>
		<link>http://www.software-engineer-training.com/telecommunicatins-software-design-and-analysis/propositional-logic-rules/</link>
		<comments>http://www.software-engineer-training.com/telecommunicatins-software-design-and-analysis/propositional-logic-rules/#comments</comments>
		<pubDate>Sun, 04 Nov 2007 18:32:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Telecommunicatins Software Design and Analysis]]></category>

		<guid isPermaLink="false">http://www.software-engineer-training.com/telecommunicatins-software-design-and-analysis/propositional-logic-rules/</guid>
		<description><![CDATA[Commutative Law:


Associative Law:


Distributive Law:


Tautology Law:


Absorption Law:


Demorgan&#8217;s Law:


Double Complementation:

Implication:

Complementation:


Disjunction:


Conjunction:


&#8212;
[1] &#8211; Images from Thomas Jefferson High School for Sciene and Technology
]]></description>
			<content:encoded><![CDATA[<p>Commutative Law:</p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/commutative1.gif" title="Commutative Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/commutative1.gif" alt="Commutative Law Propositional Logic" /></a></p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/commutative2.gif" title="Commutative Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/commutative2.gif" alt="Commutative Law Propositional Logic" /></a></p>
<p>Associative Law:</p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/associative1.gif" title="Associative Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/associative1.gif" alt="Associative Law Propositional Logic" /></a></p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/associative2.gif" title="Associative Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/associative2.gif" alt="Associative Law Propositional Logic" /></a></p>
<p>Distributive Law:</p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/distributive1.gif" title="Distributive Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/distributive1.gif" alt="Distributive Law Propositional Logic" /></a></p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/distributive2.gif" title="Distributive Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/distributive2.gif" alt="Distributive Law Propositional Logic" /></a></p>
<p>Tautology Law:</p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/tautology1.gif" title="Tautology Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/tautology1.gif" alt="Tautology Law Propositional Logic" /></a></p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/tautology2.gif" title="Tautology Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/tautology2.gif" alt="Tautology Law Propositional Logic" /></a></p>
<p>Absorption Law:</p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/absorption1.gif" title="Absorption Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/absorption1.gif" alt="Absorption Law Propositional Logic" /></a></p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/absorption2.gif" title="Absorption Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/absorption2.gif" alt="Absorption Law Propositional Logic" /></a></p>
<p>Demorgan&#8217;s Law:</p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/demorgan1.gif" title="Demorganâ€™s Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/demorgan1.gif" alt="Demorganâ€™s Law Propositional Logic" /></a></p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/demorgan2.gif" title="Demorganâ€™s Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/demorgan2.gif" alt="Demorganâ€™s Law Propositional Logic" /></a></p>
<p>Double Complementation:</p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/doublecomplementation.gif" title="Double Complementation Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/doublecomplementation.gif" alt="Double Complementation Law Propositional Logic" /></a></p>
<p>Implication:</p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/implication.gif" title="Implication Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/implication.gif" alt="Implication Law Propositional Logic" /></a></p>
<p>Complementation:</p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/complementation1.gif" title="Complementation Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/complementation1.gif" alt="Complementation Law Propositional Logic" /></a></p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/complementation2.gif" title="Complementation Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/complementation2.gif" alt="Complementation Law Propositional Logic" /></a></p>
<p>Disjunction:</p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/disjunction1.gif" title="Disjunction Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/disjunction1.gif" alt="Disjunction Law Propositional Logic" /></a></p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/disjunction2.gif" title="Disjunction Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/disjunction2.gif" alt="Disjunction Law Propositional Logic" /></a></p>
<p>Conjunction:</p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/conjunction1.gif" title="Conjunction Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/conjunction1.gif" alt="Conjunction Law Propositional Logic" /></a></p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/conjunction2.gif" title="Conjunction Law Propositional Logic"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/conjunction2.gif" alt="Conjunction Law Propositional Logic" /></a></p>
<p>&#8212;</p>
<p>[1] &#8211; Images from <em><a href="http://www.tjhsst.edu/%7Erlatimer/ai/Logic/logicTable/node1.html" title="Thomas Jefferson High School for Sciene and Technology">Thomas Jefferson High School for Sciene and Technology</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.software-engineer-training.com/telecommunicatins-software-design-and-analysis/propositional-logic-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deterministic Finite State Automaton (DFA)</title>
		<link>http://www.software-engineer-training.com/telecommunicatins-software-design-and-analysis/deterministic-finite-state-automaton-dfa/</link>
		<comments>http://www.software-engineer-training.com/telecommunicatins-software-design-and-analysis/deterministic-finite-state-automaton-dfa/#comments</comments>
		<pubDate>Sun, 04 Nov 2007 15:34:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Telecommunicatins Software Design and Analysis]]></category>

		<guid isPermaLink="false">http://www.software-engineer-training.com/telecommunicatins-software-design-and-analysis/deterministic-finite-state-automaton-dfa/</guid>
		<description><![CDATA[A deterministic  finite state automaton (DFA) is a simple language recognition device. It can be seen as a state machine where for each pair of state and input symbol there is one and only one transition to a next state. It will take in a string of input symbols and then for each symbol [...]]]></description>
			<content:encoded><![CDATA[<p>A deterministic  finite state automaton (DFA) is a simple language recognition device. It can be seen as a state machine where for each pair of state and input symbol there is one and only one transition to a next state. It will take in a string of input symbols and then for each symbol it will transition to another state according to a transition function. <a href="http://en.wikipedia.org/wiki/Deterministic_finite_automaton" title="Deterministic Finite State Automaton (DFA)">More about DFA can be found here</a>.</p>
<p>Examples from [<a href="http://www.mec.ac.in/resources/notes/notes/automata/dfa.htm" title="Finite Automata">1</a>]:</p>
<p>1) Construct a DFA to accept a string containing a zero followed by a one.</p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/answer1.gif" title="Construct a DFA to accept a string containing a zero followed by a one"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/answer1.gif" alt="Construct a DFA to accept a string containing a zero followed by a one" /></a></p>
<p>2) Construct a DFA to accept a string containing two consecutive zero&#8217;s followed by two consecutive ones.</p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/answer2.gif" title="Construct a DFA to accept a string containing two consecutive zeroâ€™s followed by two consecutive ones"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/answer2.gif" alt="Construct a DFA to accept a string containing two consecutive zeroâ€™s followed by two consecutive ones" /></a></p>
<p>3) Construct a DFA to accept a string containing even number of zeros and any number of ones.</p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/answer3.gif" title="Construct a DFA to accept a string containing even number of zeros and any number of ones"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/answer3.gif" alt="Construct a DFA to accept a string containing even number of zeros and any number of ones" /></a></p>
<p>4) Construct a DFA to accept all stings which do not contain three consecutive zeros.</p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/answer4.gif" title="Construct a DFA to accept all stings which do not contain three consecutive zeros"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/answer4.gif" alt="Construct a DFA to accept all stings which do not contain three consecutive zeros" /></a></p>
<p>5) Construct a DFA to accept all strings containing even number of zeros and even number of ones.</p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/answer5.gif" title="Construct a DFA to accept all strings containing even number of zeros and even number of ones."><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/answer5.gif" alt="Construct a DFA to accept all strings containing even number of zeros and even number of ones." /></a></p>
<p>6) Construct a DFA to accept all strings which satisfy #(x)mod5=2.</p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/answer6.gif" title="Construct a DFA to accept all strings which satisfy #(x)mod5=2"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/answer6.gif" alt="Construct a DFA to accept all strings which satisfy #(x)mod5=2" /></a></p>
<p>7) Construct a DFA to accept all strings (0+1)* with an equal number of zeros and ones such that each prefix has at most one more zero than ones and at most one more one than zeros.</p>
<p><a href="http://www.software-engineer-training.com/wp-content/uploads/2007/11/answer7.gif" title="Construct a DFA to accept all strings (0+1)* with an equal number of zeros and ones such that each prefix has at most one more zero than ones and at most one more one than zeros"><img src="http://www.software-engineer-training.com/wp-content/uploads/2007/11/answer7.gif" alt="Construct a DFA to accept all strings (0+1)* with an equal number of zeros and ones such that each prefix has at most one more zero than ones and at most one more one than zeros" /></a></p>
<p>&#8212;</p>
<p>[1] &#8211; Model Engineering College &#8211; <em><a href="http://www.mec.ac.in/resources/notes/notes/automata/dfa.htm" title="Finite&lt;/p"> </a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.software-engineer-training.com/telecommunicatins-software-design-and-analysis/deterministic-finite-state-automaton-dfa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HCS12 Instruction Set</title>
		<link>http://www.software-engineer-training.com/computer-architecture-2/hcs12-instruction-set/</link>
		<comments>http://www.software-engineer-training.com/computer-architecture-2/hcs12-instruction-set/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 01:28:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computer Architecture 2]]></category>

		<guid isPermaLink="false">http://www.software-engineer-training.com/computer-architecture-2/hcs12-instruction-set/</guid>
		<description><![CDATA[The MC68HCS12 microcontroller contains a CISC processor, not a RISC processor.

Read more about CISC (Complex Instruction Set Computer)
Read more about RISC ( Reduced Instruction Set Computer)

Load/Store/Load Effective Address [2]



LDAA
Load A
(M) -&#62; A


LDAB
Load B
(M)-&#62; B


LDD
Load D
(M : M + 1) -&#62; (A:B)


LDS
Load SP
(M : M + 1) -&#62; (SP_h:SP_l)


LDX
Load Index Register X
(M : M + 1) [...]]]></description>
			<content:encoded><![CDATA[<p>The MC68HCS12 microcontroller contains a CISC processor, not a RISC processor.</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Complex_instruction_set_computer" title="CISC">Read more about CISC (Complex Instruction Set Computer)</a></li>
<li><a href="http://en.wikipedia.org/wiki/Reduced_instruction_set_computer" title="RISC">Read more about RISC ( Reduced Instruction Set Computer)</a></li>
</ul>
<p><strong>Load/Store/Load Effective Address [2]<br />
</strong></p>
<table>
<tr>
<td>LDAA</td>
<td>Load A</td>
<td>(M) -&gt; A</td>
</tr>
<tr>
<td valign="top">LDAB</td>
<td valign="top">Load B</td>
<td valign="top">(M)-&gt; B</td>
</tr>
<tr>
<td valign="top">LDD</td>
<td valign="top">Load D</td>
<td valign="top">(M : M + 1) -&gt; (A:B)</td>
</tr>
<tr>
<td valign="top">LDS</td>
<td valign="top">Load SP</td>
<td valign="top">(M : M + 1) -&gt; (SP_h:SP_l)</td>
</tr>
<tr>
<td valign="top">LDX</td>
<td valign="top">Load Index Register X</td>
<td valign="top">(M : M + 1) -&gt; X_h:X_l</td>
</tr>
<tr>
<td valign="top">LDY</td>
<td valign="top">Load Index Register Y</td>
<td valign="top">(M : M + 1) -&gt; Y_h:Y_l</td>
</tr>
<tr>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
</tr>
<tr>
<td valign="top">STAA</td>
<td valign="top">Store A</td>
<td valign="top">(A) -&gt; M</td>
</tr>
<tr>
<td valign="top">STAB</td>
<td valign="top">Store B</td>
<td valign="top">(B) -&gt; M</td>
</tr>
<tr>
<td valign="top">STD</td>
<td valign="top">Store D</td>
<td valign="top">(A) -&gt; M, (B) -&gt; M+1</td>
</tr>
<tr>
<td valign="top">STS</td>
<td valign="top">Store SP</td>
<td valign="top">(SP_h:SP_l) -&gt; M : M+1</td>
</tr>
<tr>
<td valign="top">STX</td>
<td valign="top">Store X</td>
<td valign="top">(X_h:X_l) -&gt; M : M+1</td>
</tr>
<tr>
<td valign="top">STY</td>
<td valign="top">Store Y</td>
<td valign="top">(Y_h:Y_l) -&gt; M : M+1</td>
</tr>
<tr>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
</tr>
<tr>
<td valign="top">LEAS</td>
<td valign="top">Load effective address into SP</td>
<td valign="top">Effective Address -&gt; SP</td>
</tr>
<tr>
<td valign="top">LEAX</td>
<td valign="top">Load effective address into X</td>
<td valign="top">Effective Address -&gt;X</td>
</tr>
<tr>
<td valign="top">LEAY</td>
<td valign="top">Load effective address into Y</td>
<td valign="top">Effective Address -&gt;Y</td>
</tr>
</table>
<p>Ex: X = $1234, Y=$1000, SP=$0A00</p>
<table>
<tr>
<td>Instruction</td>
<td>Result</td>
</tr>
<tr>
<td valign="top">LEAX 10,X</td>
<td valign="top">X=$1234+$000A = $123E</td>
</tr>
<tr>
<td valign="top">LEAX $10,Y</td>
<td valign="top">Y=$1000+$0010 = $1010</td>
</tr>
<tr>
<td valign="top">LEAS -10,SP</td>
<td valign="top">SP=$0A00-$000A = $09F6</td>
</tr>
</table>
<p><strong>Stack Instructions [2]</strong><br />
SP is decremented before information is transferred</p>
<table>
<tr>
<td>PSHA</td>
<td>Push A</td>
<td>(SP) &#8211; 1 -&gt; SP; (A) -&gt; M_(sp)</td>
</tr>
<tr>
<td valign="top">PSHB</td>
<td valign="top">Push B</td>
<td valign="top">(SP) &#8211; 1 -&gt; SP; (B) -&gt; M_(sp)</td>
</tr>
<tr>
<td valign="top">PSHC</td>
<td valign="top">Push CCR</td>
<td valign="top">(SP) &#8211; 1 -&gt; SP; (CCR) -&gt; M_(sp)</td>
</tr>
<tr>
<td valign="top">PSHD</td>
<td valign="top">Push D</td>
<td valign="top">(SP) &#8211; 2 -&gt; SP; (A : B) -&gt; M_(sp):M_(sp+1)</td>
</tr>
<tr>
<td valign="top">PSHX</td>
<td valign="top">Push X</td>
<td valign="top">(SP) &#8211; 2 -&gt; SP; (X) -&gt; M_(sp):M_(sp+1)</td>
</tr>
<tr>
<td valign="top">PSHY</td>
<td valign="top">Push Y</td>
<td valign="top">(SP) &#8211; 2 -&gt; SP; (Y) -&gt; M_(sp):M_(sp+1)</td>
</tr>
<tr>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
</tr>
<tr>
<td valign="top">PULA</td>
<td valign="top">Pull A</td>
<td valign="top">(M_(sp))-&gt; A; (SP) + 1 -&gt; SP</td>
</tr>
<tr>
<td valign="top">PULB</td>
<td valign="top">Pull B</td>
<td valign="top">(M_(sp))-&gt; B; (SP) + 1 -&gt; SP</td>
</tr>
<tr>
<td valign="top">PULC</td>
<td valign="top">Pull CCR</td>
<td valign="top">(M_(sp))-&gt; CCR; (SP) + 1 -&gt; SP</td>
</tr>
<tr>
<td valign="top">PULD</td>
<td valign="top">Pull D</td>
<td valign="top">(M_(sp): M_(sp+1))-&gt; A:B; (SP) + 2 -&gt; SP</td>
</tr>
<tr>
<td valign="top">PULX</td>
<td valign="top">Pull X</td>
<td valign="top">(M_(sp): M_(sp+1))-&gt; X; (SP) + 2 -&gt; SP</td>
</tr>
<tr>
<td valign="top">PULY</td>
<td valign="top">Pull Y</td>
<td valign="top">(M_(sp): M_(sp+1))-&gt; Y; (SP) + 2 -&gt; SP</td>
</tr>
</table>
<p><strong>Increment/Decrement [2]</strong></p>
<table>
<tr>
<td>DEC</td>
<td>Decrement Memory</td>
<td>(M) &#8211; $01 -&gt; M</td>
</tr>
<tr>
<td valign="top">DECA</td>
<td valign="top">Decrement A</td>
<td valign="top">(A) &#8211; $01 -&gt; A</td>
</tr>
<tr>
<td valign="top">DECB</td>
<td valign="top">Decrement B</td>
<td valign="top">(B) &#8211; $01 -&gt; B</td>
</tr>
<tr>
<td valign="top">DES</td>
<td valign="top">Decrement SP</td>
<td valign="top">(SP) &#8211; $0001 -&gt; SP</td>
</tr>
<tr>
<td valign="top">DEX</td>
<td valign="top">Decrement X</td>
<td valign="top">(X) &#8211; $0001 -&gt; X</td>
</tr>
<tr>
<td valign="top">DEY</td>
<td valign="top">Decrement Y</td>
<td valign="top">(Y) &#8211; $0001 -&gt; Y</td>
</tr>
<tr>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
</tr>
<tr>
<td valign="top">INC</td>
<td valign="top">Increment Memory</td>
<td valign="top">(M) + $01 -&gt; M</td>
</tr>
<tr>
<td valign="top">INCA</td>
<td valign="top">Increment A</td>
<td valign="top">(A) + $01 -&gt; A</td>
</tr>
<tr>
<td valign="top">INCB</td>
<td valign="top">Increment B</td>
<td valign="top">(B) + $01 -&gt; B</td>
</tr>
<tr>
<td valign="top">INS</td>
<td valign="top">Increment SP</td>
<td valign="top">(SP) + $0001 -&gt; SP</td>
</tr>
<tr>
<td valign="top">INX</td>
<td valign="top">Increment X</td>
<td valign="top">(X) + $0001 -&gt; X</td>
</tr>
<tr>
<td valign="top">INY</td>
<td valign="top">Increment Y</td>
<td valign="top">(Y) + $0001 -&gt; Y</td>
</tr>
</table>
<p><strong>Addition and Subtraction [2]</strong></p>
<table>
<tr>
<td>ABA</td>
<td>Add B to A</td>
<td>(A) + (B) -&gt; A</td>
</tr>
<tr>
<td valign="top">ADCA</td>
<td valign="top">Add with carry to A</td>
<td valign="top">(A) + (M) + C -&gt; A</td>
</tr>
<tr>
<td valign="top">ADCB</td>
<td valign="top">Add with carry to B</td>
<td valign="top">(B) + (M) + C -&gt; B</td>
</tr>
<tr>
<td valign="top">ADDA</td>
<td valign="top">Add without carry to A</td>
<td valign="top">(A) + (M) -&gt; A</td>
</tr>
<tr>
<td valign="top">ADDB</td>
<td valign="top">Add without carry to B</td>
<td valign="top">(B) + (M) -&gt; B</td>
</tr>
<tr>
<td valign="top">ADDD</td>
<td valign="top">Add to D</td>
<td valign="top">(A:B) + (M:M+1) -&gt; A:B</td>
</tr>
<tr>
<td valign="top">SBA</td>
<td valign="top">Subtract B from A</td>
<td valign="top">(A) &#8211; (B) -&gt; A</td>
</tr>
<tr>
<td valign="top">SBCA</td>
<td valign="top">Subtract with borrow from A</td>
<td valign="top">(A) &#8211; (M) &#8211; C -&gt; A</td>
</tr>
<tr>
<td valign="top">SBCB</td>
<td valign="top">Subtract with borrow from B</td>
<td valign="top">(B) &#8211; (M) &#8211; C -&gt; B</td>
</tr>
<tr>
<td valign="top">SUBA</td>
<td valign="top">Subtract memory from A</td>
<td valign="top">(A) &#8211; (M) -&gt; A</td>
</tr>
<tr>
<td valign="top">SUBB</td>
<td valign="top">Subtract memory from B</td>
<td valign="top">(B) &#8211; (M) -&gt; B</td>
</tr>
<tr>
<td valign="top">SUBD</td>
<td valign="top">Subtract memory from D (A:B)</td>
<td valign="top">(D) &#8211; (M:M+1) -&gt; D</td>
</tr>
</table>
<p>&#8212;</p>
<p>[1] Fredrick M. Cady, <em>Software and Hardware Engineering: Assembly and C Programming for the Freescale HCS12 Microcontroller</em><br />
[2] Prof. Gilbert Arbez, <em>University of Ottawa CSI3531 Course Notes</em>, Module 4</p>
]]></content:encoded>
			<wfw:commentRss>http://www.software-engineer-training.com/computer-architecture-2/hcs12-instruction-set/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction to Assembly Language Programming</title>
		<link>http://www.software-engineer-training.com/computer-architecture-2/introduction-to-assembly-language-programming/</link>
		<comments>http://www.software-engineer-training.com/computer-architecture-2/introduction-to-assembly-language-programming/#comments</comments>
		<pubDate>Mon, 22 Oct 2007 01:38:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computer Architecture 2]]></category>

		<guid isPermaLink="false">http://www.software-engineer-training.com/computer-architecture-2/introduction-to-assembly-language-programming/</guid>
		<description><![CDATA[Assembly programming is low-level programming using some basic syntax to represent machine code for a specific CPU. An assembler is used to translate the assembly code into the machine code for the target computer.
A program created from assemblhy can be more efficient and faster than a program created with a compiler. One example of why [...]]]></description>
			<content:encoded><![CDATA[<p>Assembly programming is low-level programming using some basic syntax to represent machine code for a specific CPU. An assembler is used to translate the assembly code into the machine code for the target computer.</p>
<p>A program created from assemblhy can be more efficient and faster than a program created with a compiler. One example of why this occurs is because a compiler will store intermediate values used in a calculation in memory whereas a program written in assembly can store the intermediate values in a register which is much faster. However, while there may be performance benefits to programming so close to the machine level, there is a great deal of added complexity which a high-level programming language can remove.</p>
<p><strong>Table 5.1 Source Code Fields [1]</strong></p>
<table>
<tr>
<td><strong>Label Field</strong></td>
<td><strong>Opcode Field</strong></td>
<td><strong>Operand(s) Field</strong></td>
<td><strong>Comment Field</strong></td>
</tr>
<tr>
<td valign="top">Example:</td>
<td valign="top">ldaa</td>
<td valign="top">#$64</td>
<td valign="top">; Initialize A with hexadecimal 64</td>
</tr>
</table>
<ul>
<li>A label must start with an alphabetic character</li>
<li>The label must start in the first column of the source code line unless it ends with a colon.</li>
<li>Uppercase and lowercase characters are distinct by default but case sensitivity may be turned off.</li>
<li>A label may end with a colon (:)</li>
<li>A label may appear on a line by itself</li>
<li>The label is optional but when used it can provide a symbolic memory reference such as a branch instruction address, or a symbol for a constant.</li>
</ul>
<ul>
<li>The opcode field contains either a mnemonic for the operation, an assembler directive or pseudo-operation, or a macro name. For the opcode field, the assembler will convert all uppercase letters to lowercase so this field is not case sensitive.</li>
</ul>
<ul>
<li>The interpretation of the operand field depends on the opcode.</li>
<li>The operand must follow the opcode.</li>
<li>Operands can be the symbols, constants, or expressions that are evaluated by the assembler.</li>
<li>The operand field also specifies the addressing mode for the instruction.</li>
</ul>
<p><strong>Using Macros</strong></p>
<p>A macro can be used to give a symbolic name to a group of instructions that are used often. In the source code the macro should be given a name using the label field and then two commands (MACRO &amp; ENDM) are used to indicate the start and finish of the macro. The assembler will then replace every occurrence of the macro with the set of instructions.</p>
<table>
<tr>
<td>Add_B_and_C:</td>
<td>MACRO</td>
</tr>
<tr>
<td valign="top">&nbsp;</td>
<td valign="top">MOV A,C<br />
ADD A,B<br />
MOV C,A<br />
ENDM</td>
</tr>
</table>
<p><strong>Macro vs Sub-Routine</strong></p>
<p>A macro and a sub-routine are similar except for the following differences:</p>
<ul>
<li>With a sub-routine the code is present only once. With a macro, the code is inserted in the place of the macro whenever it is used. Therefore, if macros are used instead of sub-routines, the code will end up being longer.</li>
<li>With a sub-routine a jump must occur in order to find and execute the sub-routine code. With a macro, this is not required because the code has already been inserted directly. Therefore, a sub-routine will be slightly slower than a macro.</li>
</ul>
<p>Using either a sub-routine or a macro makes changing the code much easier because changes can be done in one place rather than in each specific location where the code would be used. They also make the code easier to understand.</p>
<p><strong>Assembler Instructions</strong></p>
<p>ORG &#8211; Set the program counter to the origin of the program</p>
<p>EQU &#8211; Associate the value of an expression with a symbol</p>
<p>SET &#8211; Can be used instead of equal. With set, the value can be redefined</p>
<p>DC &#8211; Define a constant value</p>
<p>DCB &#8211; Define a constant block</p>
<p>DS &#8211; Define storage</p>
<p><strong>Example 5-9 ORG &#8211; Set Program Counter to Origin for Absolute Assembly [1]<br />
</strong></p>
<table>
<tr>
<td>0000 c000</td>
<td>ROM:</td>
<td>EQU</td>
<td>$c000</td>
<td>; Location of ROM</td>
</tr>
<tr>
<td valign="top">0000 0800</td>
<td valign="top">RAM:</td>
<td valign="top">EQU</td>
<td valign="top">$0800</td>
<td valign="top">; Location of RAM</td>
</tr>
<tr>
<td valign="top">0000 0A00</td>
<td valign="top">STACK:</td>
<td valign="top">EQU</td>
<td valign="top">$0a00</td>
<td valign="top">; Location of stack</td>
</tr>
<tr>
<td valign="top">&nbsp;</td>
<td valign="top">;</td>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
</tr>
<tr>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td valign="top">ORG</td>
<td valign="top">ROM</td>
<td valign="top">; Set program counter to ROM</td>
</tr>
<tr>
<td valign="top">&nbsp;</td>
<td valign="top">;</td>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
</tr>
<tr>
<td valign="top">00c000 CF0a 00</td>
<td valign="top">&nbsp;</td>
<td valign="top">lds</td>
<td valign="top">#STACK</td>
<td valign="top">; Initialize SP</td>
</tr>
<tr>
<td valign="top">00c003 B608 00</td>
<td valign="top">&nbsp;</td>
<td valign="top">ldaa</td>
<td valign="top">Data_1</td>
<td valign="top">; Load from memory address RAM</td>
</tr>
<tr>
<td valign="top">&nbsp;</td>
<td valign="top">;</td>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
</tr>
<tr>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td valign="top">ORG</td>
<td valign="top">RAM</td>
<td valign="top">; set program counter</td>
</tr>
<tr>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td valign="top">; to RAM for the data</td>
</tr>
<tr>
<td valign="top">000800</td>
<td valign="top">Data_1:</td>
<td valign="top">DS.B</td>
<td valign="top">$20</td>
<td valign="top">; Set aside $20 bytes</td>
</tr>
</table>
<p><strong>Software Development Process</strong></p>
<p>When programming in any language, following a good development process is necessary in order to deliver a successful product. It is important to resist the urge to jump right into the code immediately, especially when programming in assembly which is extremely complex.</p>
<p>The first step should always be to clearly identify the problem and define a solution to solve that problem. Create and understand the solution in diagrams or pseudo-code before beginning to code in assembly. Translating these diagrams into code will be much easier than trying envision the solution entirely in your mind.</p>
<p>Debugging and tracing through your assembly program will also be a very good way at finding and correcting bugs.</p>
<p><strong>Typical Bugs Include:</strong></p>
<ul>
<li>Incorrect transfer to sub-routine</li>
<li>Forgetting to initialize the stack pointer</li>
<li>Not enough memory in the stack</li>
<li>Sub-routines corrupting registers</li>
<li>Forgetting to initialize index registers</li>
<li>Modifying the condition code registers before branching</li>
<li>Using the wrong branching instruction</li>
<li>Using the wrong addressing mode</li>
</ul>
<p><strong>D-Bug12</strong><br />
The D-Bug12 is the debugging tool stored in the EEPROM of our microcontroller that will be used for debugging as well as for downloading programs onto the card and controlling the assembler.</p>
<p><strong>D-Bug12 Commands</strong></p>
<p>ASM &#8211; Assemble/Dissasemble</p>
<p>BF &#8211; Block Fill Memory</p>
<p>BR &#8211; Set Breakpoint</p>
<p>CALL &#8211; Call and execute subroutine</p>
<p>G &#8211; Go, run program</p>
<p>GT &#8211; Go till an address</p>
<p>HELP &#8211; Prints summary of available commands</p>
<p>LOAD &#8211; Set in state ready to accept program download from MiniIDE</p>
<p>MD &#8211; Display Contents of Memory</p>
<p>MM &#8211; Modify Memory</p>
<p>MOVE &#8211; Copy block of memory</p>
<p>NOBR &#8211; Remove breakpoints</p>
<p>RD &#8211; Display register contents</p>
<p>T &#8211; Trace through program</p>
<p>UPLOAD &#8211; Upload memory to PC</p>
<p>USEHDB &#8211; Use EVB/Target hardware breakpoints</p>
<p>VERIF &#8211; Compare memory to download file</p>
<p>&#8212;</p>
<p>[1] Fredrick M. Cady, <em>Software and Hardware Engineering: Assembly and C Programming for the Freescale HCS12 Microcontroller<br />
</em> [2] Prof. Gilbert Arbez, <em>University of Ottawa CSI3531 Course Notes</em>, Module  3</p>
]]></content:encoded>
			<wfw:commentRss>http://www.software-engineer-training.com/computer-architecture-2/introduction-to-assembly-language-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
