<?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>electrofriends.com &#187; Computer Programming</title>
	<atom:link href="http://electrofriends.com/category/projects/computer-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://electrofriends.com</link>
	<description>...bringing innovative minds together</description>
	<lastBuildDate>Tue, 07 Feb 2012 08:43:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.6</generator>
		<item>
		<title>Remote System Monitoring and Controlling via Web based Mobile or Desktop Application</title>
		<link>http://electrofriends.com/projects/computer-programming/remote-system-monitoring-controlling-web-based-mobile-desktop-application/</link>
		<comments>http://electrofriends.com/projects/computer-programming/remote-system-monitoring-controlling-web-based-mobile-desktop-application/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 09:41:22 +0000</pubDate>
		<dc:creator>Ranjan</dc:creator>
				<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=2631</guid>
		<description><![CDATA[Introduction The idea of remote system monitoring and controlling application is to do some of the actions like ex: Shutdown, Reboot, Hibernate of the users systems remotely. The user can also make use of this application to query additional details of the systems. Consider a scenario where you have a set of systems (Computers) and [...]]]></description>
			<content:encoded><![CDATA[<h2><span style="font-weight: bold"><!--pagetitle:Remote System Monitoring and Controlling via Web based Mobile or Desktop Application-->Introduction</span></h2>
<p>The idea of remote system monitoring and controlling application is to do some of the actions like ex: Shutdown, Reboot, Hibernate of the users systems remotely. The user can also make use of this application to query additional details of the systems.</p>
<p>Consider a scenario where you have a set of systems (Computers) and you want to control them from your mobile or any other desktop anywhere from the world. So this started as initial requirement of how we can implement the same to control numerous systems remotely.</p>
<p>Consider another scenario of how you can retrieve the information of a particular system remotely from your handheld devices or through desktops. By retrieving information, one may be interested in knowing the following</p>
<ol>
<li>Machine Name</li>
<li>CPU information</li>
<li>Username</li>
<li>Domain Name</li>
<li>OS Version</li>
</ol>
<h2><strong>Software Requirements Specification</strong></h2>
<ol>
<li>Aim: The aim of this project is to provide a facility for the end user to remotely control their systems through desktop or mobile based web application.</li>
<li>Purpose: The purpose of this project is to implement a proof or concept of the same. And to show how easily it can be done with .NET technology</li>
<li>Scope: The scope of this project is very limited to controlling the system with few actions like Shutdown, Reboot, Hibernate, Logoff, Force close all applications etc. The user registration is done only at the client application and the it should be always running in-order to control the system remotely.</li>
<li>User Characteristics:  The Following things are taken into consideration with this software development
<ol>
<li>Users can have multiple systems for controlling. There is absolutely no limit in the number of systems being controlled by the users.</li>
<li>The user can either control her/his systems through mobile or desktop based web application.</li>
<li>Each user can control his/her system only and don’t have access to control others systems.</li>
<li>Right now there is only one type of user of this system i.e. the System Administrators who will be using this system to control or fetch additional information of the system on their own interest.</li>
</ol>
</li>
</ol>
<p><strong><br />
</strong></p>
<p><strong> </strong></p>
<h2><strong>Software and Hardware Requirement</strong></h2>
<p><strong>Software Requirements:</strong></p>
<ul>
<li>Operating system: Microsoft Windows XP / Win 7 / Vista</li>
<li>.NET framework 4.0</li>
<li>SQL Server 2008</li>
</ul>
<p><strong>Hardware Requirements:</strong></p>
<ul>
<li>Processor Pentium 4</li>
<li>RAM- 256Mb</li>
<li>HDD-10GB</li>
</ul>
<p><span style="font-weight: bold">Technologies Used</span></p>
<p>Visual Studio.NET</p>
<ul>
<li>The       Client Application is developed with .NET C# Winform technology</li>
<li>The Server       side web application is developed with ASP.NET MVC3 technology.</li>
</ul>
<p>Internet based / Cloud based Microsoft SQL Server 2008</p>
<ul>
<li>This       software is designed with Software as a Service model with a common single       cloud database which stores all the users and their system information.</li>
</ul>
<h2><strong>How does the software functions?</strong><strong> </strong></h2>
<p>Client Application:</p>
<p>When you run the client application for the first time, you will have to register yourself with the username and password. The same has to be provided as log on information which will authenticate the user in client and server applications.</p>
<p>Once authenticated, the user has to click on the Start button for continuous monitoring of the system behind the scene. The system registers by itself by putting an entry in database (this happens only for the first usage of the client app) so that the user can control that particular machine.  When the user closes the client application, the entry in the database for that system will be deactivated.  For subsequent usable of the client application, the system will be activated for monitoring and controlling.</p>
<p>Server Application:</p>
<p>It is a web based application, on requesting the user will be authenticated. The use has to provide the same username and password he/she has provided at the time of user registration in client app.</p>
<p>On successful authentication, the list of active systems will be displayed in a screen. The user can select one and perform the actions like Shutdown, Reboot etc.</p>
<p><strong> </strong></p>
<p><strong><br />
</strong></p>
<p><strong> </strong></p>
<h2><strong>Database Entity Relationship Design Diagram</strong></h2>
<p><a href="http://electrofriends.com/wp-content/uploads/2012/01/DatabaseEntityDiagram-e1327829836286.png"><img class="alignleft size-full wp-image-2632" src="http://electrofriends.com/wp-content/uploads/2012/01/DatabaseEntityDiagram-e1327829836286.png" alt="" width="500" height="760" /></a></p>
<p><strong><br />
</strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<h2><span style="font-weight: bold"></p>
]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/projects/computer-programming/remote-system-monitoring-controlling-web-based-mobile-desktop-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>M-TICKET – Mobile Booking</title>
		<link>http://electrofriends.com/projects/computer-programming/mticket-mobile-booking/</link>
		<comments>http://electrofriends.com/projects/computer-programming/mticket-mobile-booking/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 11:09:00 +0000</pubDate>
		<dc:creator>chitra</dc:creator>
				<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[ADO.net]]></category>
		<category><![CDATA[AT Commands]]></category>
		<category><![CDATA[class diagram]]></category>
		<category><![CDATA[GSM]]></category>
		<category><![CDATA[MSComm]]></category>
		<category><![CDATA[requirement]]></category>
		<category><![CDATA[SMS]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[test case]]></category>
		<category><![CDATA[ticket booking]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=1713</guid>
		<description><![CDATA[Chapter 1: INTRODUCTION Nowadays SMS or Short Messaging Service is a major communication alternative. Also, in this modern world all the facilities should be available at our fingertips whenever required, wherever we are. So we thought of developing the “SMS based movie ticket reservation”. The main purpose of our project named “M-TICKET – Mobile Booking” [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Chapter 1: </strong><strong>INTRODUCTION</strong></p>
<p>Nowadays SMS or Short Messaging Service is a major communication alternative. Also, in this modern world all the facilities should be available at our fingertips whenever required, wherever we are.  So we thought of developing the “SMS based movie ticket reservation”. The main purpose of our project named <strong>“M-TICKET – Mobile Booking”</strong> is to make the ticket reservation simple and easy.</p>
<p>In the counter based movie ticket reservation, the user has to go to the counter and stand in a queue to reserve the ticket which is time consuming. Also, in the Online reservation the user should have the internet facility. Compared with these systems of ticket reservations, our system makes the reservation easy and quick.</p>
<p>In this application, the user can use his cell phone to send SMS to reserve the movie tickets. Also, he can get the movie updates from time to time through his Cell Phone in the form of SMS.</p>
<p>We try to implement this concept in small way using SMS technology. Here we show how to access the movie information that is stored in the database and reserve the ticket just by sending an SMS from your cell phone to SMS server and get back the required information on your Cell Phone.</p>
<p><strong>Chapter 2: </strong><strong>SOFTWARE REQUIREMENTS SPECIFICATION</strong></p>
<p><strong>2.1 Aim:</strong></p>
<p>The aim of our project named <strong>“M-TICKET – Mobile Booking”</strong> is to develop a software which helps the user to reserve movie tickets just by sending an SMS.  To access this software, the user need not load any application to his cell phone or he need not have internet facility. He needs to just send an SMS in a prescribed format to reserve the ticket.</p>
<p><strong>2.2 Purpose:</strong></p>
<p>The purpose of our project is to make ticket reservation simple and easy and to provide a cheaper way of reserving the ticket just by sending an SMS.</p>
<p><strong>2.3 Scope:</strong></p>
<p>This project will provide a simple way to reserve tickets. A user can reserve the tickets in two ways- SMS based reservation and counter based reservation. For the SMS based reservation the user has the facilities to register his mobile phone, reserve the tickets, request for movie updates, cancel the tickets and unregister his mobile number. The user will get an appropriate reply through SMS to his cell phone. The user can also come to the counter to reserve the tickets. The payment can be done either through credit card or in the counter.</p>
<p><strong>2.4 User Characteristics:</strong></p>
<p>A customer will be having the certain requirements that must be provided by the system. Hence at the initial stage of the software development, a requirement analysis is performed to identify the needs of the customer. Our software is movie ticket reservation software which can be used in any theatre. To make it applicable in any of the theatres, we have taken into consideration the following requirements:</p>
<ul>
<li>Theatre can have any number of screens.</li>
<li>Each screen can have any number of classes.</li>
<li>The price of the ticket is based on the class.</li>
<li>Each class can have any number of rows.</li>
<li>Each row can      have any number of seats.</li>
<li>Each screen can have certain number of shows per day.</li>
<li>The screen can have different movies in different      shows.</li>
<li>Two different screens can have different movies      running simultaneously.</li>
</ul>
<p>There are two types of users of the system. One is the customer and the other is the administrator</p>
<p>The <strong>Customer </strong>should be able to</p>
<ol>
<li>
<ul>
<li>Register with his username and credit card number       (optional)</li>
<li>Reserve the ticket</li>
<li>Make payment either through credit card or through       the counter</li>
<li>Cancel some or all the reserved tickets</li>
<li>Get the movie updates of the theatre</li>
<li>Unregister</li>
</ul>
</li>
</ol>
<p>The <strong>Administrator</strong> should be able to</p>
<ol>
<li>
<ul>
<li>Register himself by giving his details along with       the user name and password</li>
<li>Login into the system</li>
<li>Update his information</li>
<li>Change password</li>
<li>View seat status</li>
<li>Edit the screen, class, price, movie, seat, show       time information etc.</li>
<li>Perform reservation, cancellation, payment       operations in the counter</li>
<li>Delete the old records</li>
</ul>
</li>
</ol>
<p>The reservation can be done only for 2 days – today and tomorrow. After reserving the ticket, the payment must be done and the ticket must be collected before 45 minutes of the show.  Otherwise the reserved tickets will be cancelled.</p>
<p>There are 2 modes of reservation:</p>
<ol>
<li>Counter based reservation</li>
<li>SMS based reservation</li>
</ol>
<p>In the counter based reservation, seats are reserved manually by the Administrator. The customer should come to the counter, and specify the movie, date of show, time of show, class and the number of seats required. Then the Admin will check the availability of seats. If the seats are available, then the reservation will be done and the reservation code will be given to the customer. The customer can also cancel some or all the reserved seats.</p>
<p>In the SMS based system, all the operations are done automatically by the system. The customer should first register himself through the SMS. A registered customer can reserve the seats, cancel the reserved seats, request for the movie updates of the theatre and unregister all by sending the SMS in the specified format.</p>
<p>Two payment options are available to the registered customer:</p>
<ol>
<li>Credit card based payment</li>
<li>Counter payment<br />
When the reservation code is entered, the system should automatically show the amount of money needs to be paid.</li>
</ol>
<p><strong>2.5 Feasibility Study:</strong></p>
<p>The process of analyzing the requirements of the system should always be preceded by the feasibility study of the system to be developed. It involves knowing what the system must achieve and whether these requirements can be satisfied with the current software and hardware technologies available.</p>
<p>The SMS based reservation software should provide the following basic features:</p>
<ol>
<li>It must enable designing the user friendly front end.</li>
<li>It must provide means to connect to the database      where the data is stored.</li>
<li>It should provide the means to transfer the messages      between the cell phone and the computer system.</li>
<li>It should provide the means to process the message.</li>
</ol>
<p>Considering all these needs, we can use Visual Basic.NET Framework to develop the front end and to process the message, MS-SQL Server to create the database, ADO objects to database connectivity and ATtention (AT) commands to transfer the messages between the cell phone and the computer.</p>
<p><strong>Feasibility of the system:</strong></p>
<table border="1" cellspacing="0" cellpadding="0" align="left">
<tbody>
<tr>
<td width="295" valign="top"><strong>The feature required in the software</strong></td>
<td width="295" valign="top"><strong>Technology used to provide   the feature</strong></td>
</tr>
<tr>
<td width="295" valign="top">1. User friendly front end</td>
<td width="295" valign="top">VisualBasic .NET   Framework</td>
</tr>
<tr>
<td width="295" valign="top">2. Database</td>
<td width="295" valign="top">MS-SQL Server</td>
</tr>
<tr>
<td width="295" valign="top">3. Database connectivity</td>
<td width="295" valign="top">ADO.NET objects</td>
</tr>
<tr>
<td width="295" valign="top">4. Message transfer between cell phone and computer</td>
<td width="295" valign="top">ATtention (AT) commands</td>
</tr>
</tbody>
</table>
<p><strong><br />
2.6 Software Requirements:</strong></p>
<ul>
<li>Operating system: Microsoft Windows XP</li>
<li>Microsoft Visual Studio 2005</li>
<li>SQL Server 2005</li>
</ul>
<p><strong>2.7 Hardware requirements:</strong></p>
<ul>
<li>Processor Pentium 4</li>
<li>RAM- 256Mb</li>
<li>HDD-10GB</li>
<li>USB cable</li>
<li>Cell Phone</li>
</ul>
<p>We will try to implement our project in a small way using SMS technology. Here we will show how to access the movie information stored in the database and reserve the ticket just by sending an SMS from your cell phone to SMS server and get back the required information on your Cell Phone. This application is implemented using <strong>VB.NET</strong> (Visual Basic .NET) as front end, <strong>MS-SQL Server</strong> as backend, <strong>ADO.NET</strong> for connectivity and the <strong>AT (ATtention) commands</strong> are used to transfer the messages from the cell phone to the computer through <strong>Comport.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/projects/computer-programming/mticket-mobile-booking/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Design and Verification of a PCI Based System using SystemC</title>
		<link>http://electrofriends.com/projects/computer-programming/design-verification-pci-based-system-systemc/</link>
		<comments>http://electrofriends.com/projects/computer-programming/design-verification-pci-based-system-systemc/#comments</comments>
		<pubDate>Sun, 06 Feb 2011 08:04:16 +0000</pubDate>
		<dc:creator>Ranjith</dc:creator>
				<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[arbitor]]></category>
		<category><![CDATA[bus]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[interfaces]]></category>
		<category><![CDATA[master]]></category>
		<category><![CDATA[modeling]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[pci]]></category>
		<category><![CDATA[PCI protocol]]></category>
		<category><![CDATA[pci verification]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[slaves]]></category>
		<category><![CDATA[system design]]></category>
		<category><![CDATA[systemc]]></category>
		<category><![CDATA[testbench]]></category>
		<category><![CDATA[testcases]]></category>
		<category><![CDATA[tlm]]></category>
		<category><![CDATA[verification]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=622</guid>
		<description><![CDATA[Study about PCI Bus protocol before reading this project 1.1. System Design Introduction: The present design is of a PCI based system consisting of three Masters and six Slaves. The masters communicate with the slaves using the PCI bus. The transaction is governed by the standard PCI bus transaction protocol. Whenever a master needs to [...]]]></description>
			<content:encoded><![CDATA[<p>Study about <a title="PCI Bus protocol tutorial" href="http://electrofriends.com/articles/computer-science/protocol/introduction-to-pci-protocol/" target="_blank">PCI Bus protocol</a> before reading this project</p>
<p><strong>1.1. System Design Introduction:</strong><br />
The present design is of a PCI based system consisting of three Masters and six Slaves. The masters communicate with the slaves using the PCI bus. The transaction is governed by the standard PCI bus transaction protocol. Whenever a master needs to communicate with any of the slaves through the PCI bus it requests for the control of the bus to the arbiter. The arbiter grants the master control of the bus depending on the availability of the bus and also on the requesting master’s priority. Once the master is granted control of the bus it starts the transaction by keeping the address of the target slave along with the transaction command. The address thus kept is read by all the slaves. This address is decoded by each of them individually. If the address belongs to them, that particular slave acknowledges the call. This is the address phase. The address phase lasts for just one clock cycle. Once the address phase is finished the data phase begins. If none of the slaves acknowledge the masters call then the master aborts the transaction.</p>
<p>The design verification is done using the testbench. The testbench is connected to the design using channels. The testbench tells the master what transaction is to be carried out and also inspects the data sent and received at the slave end. The block diagram is as given below.</p>
<div id="attachment_1358" class="wp-caption aligncenter" style="width: 503px"><img class="size-full wp-image-1358" title="General system block diagram" src="http://electrofriends.com/wp-content/uploads/2011/02/General-block-diagram.jpg" alt="General system block diagram" width="493" height="276" /><p class="wp-caption-text">General system block diagram</p></div>
<p><strong>1.2. System</strong></p>
<p>This section describes the working of the present design in brief. The block diagram of the system is as shown in below fig.</p>
<p>The DUT consists of Master module, Slave module, Arbiter module, Channel declaration and a top file which connects all the instances. Just one module of the master is defined and three objects are instantiated in top file. The same is being done with the slave module, just one slave module is being described and six objects are being instantiated from it in the top file.</p>
<p>The interconnections of all the modules are shown below. Each of the blocks is as described below.</p>
<div id="attachment_1359" class="wp-caption aligncenter" style="width: 469px"><img class="size-full wp-image-1359" title="General block diagram of the system" src="http://electrofriends.com/wp-content/uploads/2011/02/General-block-diagram-of-the-system.jpg" alt="General block diagram of the system" width="459" height="635" /><p class="wp-caption-text">General block diagram of the system</p></div>
<p><strong>1.2.1 Master :</strong><br />
In the fig5.2 Master 1, Master 2 and Master 3 are all instances of the main module Master. The master receives packets of information from the test bench. This packet contains information regarding address of the destination, command definition and data. It also tells which master is to carry out the transaction. Once the master receives and decodes this packet it begins the required transaction.</p>
<p>Whenever a master has to undertake any transaction it first requests the arbiter for permission to take over the bus. Once the arbiter has granted the request, the master begins the required transaction.</p>
<p>The transaction begins with the master by asserting FRAME#. At the same time it keeps the address of the destination along with the transaction command definition. This is called ‘Address phase’. Once the address phase is done, the master asserts IRDY# and waits for the addressed slave to asserts DEVSEL#. If DEVSEL# is not asserted until the latency time runs out, the master ends the transaction with ‘Master abort’. If DEVSEL# is asserted the ‘Data phase’ begins. The data transaction between the master and slave takes place only when both IRDY# and TRDY# are asserted. As soon as TRDY# is asserted the master places the data on the AD lines during write transaction and during read transaction it reads the data from the bus after assertion of TRDY#. All signal assertions are done during the negative clock edge and are sampled during the positive clock edge. Care should be taken to see that the signals or data on the AD lines are stable during the positive edge of the clock pulse. The master can make the target wait for the data by deasserting the IRDY# signal.</p>
<p>Parity of AD, C/BE and PAR are checked regularly during each phase (data/address). During write transaction the master keeps the data on the multiplexed AD lines during one clock cycle and keep its parity during next clock cycle. During a read transaction the master checks for parity during the second clock cycle of the received data. If parity is found to be odd, it asserts the PERR# during the third clock cycle. This will result in ‘Master abort’.</p>
<p>In some cases the slave might be ready to carry out the present transaction that the master is requesting. During such a situation the master should end the transaction and retry after some time, but with the same address and command definition. The end of the transaction is marked by deassertion of FRAME#. The FRAME# might be deasserted after the last data has been transferred or just before the last data phase. Once all the data are transferred or received IRDY# is deasserted.</p>
<p><strong>1.2.2 Slave : </strong></p>
<p>In fig 5.2, Slave 1 – Slave 6 are the instances derived from the module called Slave. Each slave is assigned with a unique address that is used by the master to notify which slave it wants to interact with. The address is assigned while the object of slave is instantiated.</p>
<p>Before a slave undertakes nay memory or i/o based transactions its configuration space should be configured. In the present design this is done by any of the masters. Rest of the transactions are done depending on the content present in the configuration space. In our design we have implemented the configuration space using a structure. Once the slave has been configured it is ready to undertake any of the transactions.</p>
<p>The transaction begins when the master asserts FRAME#. During the address phase all the slaves read the address placed on the AD lines. In the same clock pulse each slave compares the read address with the content stored in the base address registers present in the configuration space. If the address belongs to any particular slave it acknowledges by asserting DEVSEL# in the next clock cycle. If the slave is ready to undertake the required transaction it asserts TRDY# along with DEVSEL#. But, if the slave is not ready to undertake the required transaction it asserts STOP# instead of TRDY# telling the master to retry the same try the same transaction after some time. Once TRDY# and IRDY# are asserted the data transfer takes place. If IRDY# is not asserted then the slave has to wait until the master asserts it. The slave has to wait until the master asserts it. The slave can also make the master wait by deasserting TRDY# and asserting it only when it is ready to receive/send data.</p>
<p>The memory and i/o space are implemented in the monitor. The slave extracts the address of the destination location from the address that is being sent from the maser and sends it to the monitor along with the data to be stored or retrieved.</p>
<p>In case of blast transaction if the slave is not able to continue with any more transaction it aborts the transaction. There are three ways a slave can abort a transaction – ‘Target Abort’, ‘Target abort with data’ and ‘Target abort without data’. In ‘Target abort’, the slave needs to abort if just asserts STOP# and at the same time deasserts DEVSEL# as well as TRDY#. In ‘Master abort without data’, as soon as STOP# is asserted only TRDY# is deasserted. DEVSEL# is deasserted only clock pulse after FRAME# is deasserted. In this case no data is transmitted one the STOP# is asserted. During ‘Target abort with data’, one data phase is allowed after STOP# is asserted. After one data phase has been completed TRDY# is deasserted. The rest of the deassertion are similar to that of target abort without data.</p>
<p>Parity of AD, C/BE and PAR are checked regularly during each phase (data/address). During read transaction the slave keeps the data on the multiplexed AD lines during one clock cycle and keeps its parity during next clock cycle. During a write transaction the slave checks for parity during the second clock cycle of the received data. If parity is found to be odd, it asserts the PERR# during the third clock cycle. This will result in ‘Target abort’.</p>
<p><strong>1.2.3 Arbiter :</strong></p>
<p>Since the PCI Bus accommodates multiple masters — any of which could request the use of the bus at any time — there must be a mechanism that allocates use of bus resources in a reasonable way and resolves conflicts among multiple masters wishing to use the bus simultaneously.</p>
<p>The arbiter is used to grant permission to the requesting master. When more than one master is requesting, the arbiter takes in all the requests and decides which master should be granted the permission of using the bus. The arbiter selects the master depending on its priority i.e. the requesting master with the highest priority is selected first by asserting the GNT# signal. In case of multiple requests the grant is given using ‘Round Robin’ logic. The grant is given by asserting the respective GNT(G1,G2,G3) signal. Every master is connected to the arbiter by individual REQ(R) and GNT(G) signals as seen in the fig 1.2. REQ# and GNT# are unique on a per master basis allowing the arbiter to implement a bus fairness algorithm. Arbitration in PCI is &#8220;hidden&#8221; in the sense that it does not consume clock cycles.</p>
]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/projects/computer-programming/design-verification-pci-based-system-systemc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sudoku Solver using C++</title>
		<link>http://electrofriends.com/projects/computer-programming/sudoku-solver-using-c/</link>
		<comments>http://electrofriends.com/projects/computer-programming/sudoku-solver-using-c/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 10:01:11 +0000</pubDate>
		<dc:creator>Ranjith</dc:creator>
				<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[C codes]]></category>
		<category><![CDATA[c graphics]]></category>
		<category><![CDATA[download codes]]></category>
		<category><![CDATA[Sudoku Solver]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=249</guid>
		<description><![CDATA[You have seen it in the news papers, you have seen it in the magazines or in the web sites, you might have sat hours &#8216;n hours to solve it. Yes, it is the king of all number puzzles, it is &#8220;SUDOKU&#8221;. We bring to you the ultimate solution for all your struggles, The SUDOKU [...]]]></description>
			<content:encoded><![CDATA[<p>You have seen it in the news papers, you have seen it in the magazines or in the web sites, you might have sat hours &#8216;n hours to solve it. Yes, it is the king of all number puzzles, it is &#8220;SUDOKU&#8221;.</p>
<p>We bring to you the ultimate solution for all your struggles, The SUDOKU Solver.</p>
<p>As you know, now a days mathematical puzzle-SUDOKU is in boom all over the world. Sudoku is a 9X9 matrix with nine 3&#215;3 sub-matrices, that we need to fill by entering the numbers from 1 through 9, without the repetition of the a number in the rows, columns or in the sub matrices.</p>
<div id="attachment_250" class="wp-caption aligncenter" style="width: 285px"><img class="size-full wp-image-250" title="Figure: 1- Sudoku Problem" src="http://electrofriends.com/wp-content/uploads/2008/11/sudoku.gif" alt="Figure: 1- Sudoku Problem" width="275" height="218" /><p class="wp-caption-text">Figure: 1- Sudoku Problem</p></div>
<p>We can get the Sudoku puzzle in ease by different means, as discussed. You might have struggled a lot to solve the same. To be true, even me too. Here I developed a fast and robust package, that solves the puzzles, that are not easy to solve by hands. It will solve the Sudoku entered in fraction of a milli-second and will display the solved result.</p>
<div id="attachment_251" class="wp-caption aligncenter" style="width: 292px"><img class="size-full wp-image-251" title="Figure: 2 - Sudoku Result " src="http://electrofriends.com/wp-content/uploads/2008/11/sudoku_ans.gif" alt="Figure: 2 - Sudoku Result " width="282" height="225" /><p class="wp-caption-text">Figure: 2 - Sudoku Result </p></div>
<p style="text-align: center;"><a href="http://electrofriends.com/wp-content/uploads/2008/11/sudoku.zip">Click here to download the executable files</a></p>
<p><a href="http://electrofriends.com/wp-content/uploads/2008/11/sudoku.zip"></a> When the code executes, a blank Sudoku will be displayed with 9&#215;9 red boxes. The user is needed to enter the numbers corresponding to the source puzzle (Figure 1). To enter this, user should use the arrow keys to cruse to the required box. The selected box will be highlighted with a blue boundary. You have to enter the number through the keyboard. Once you have done entering all the numbers in the puzzle just hit the &#8216;Enter&#8217; key on the keyboard till you get the solved result (Figure 2). If the Sudoku cannot be solved by this program a message will be displayed telling that the given puzzle cannot be solved.</p>
]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/projects/computer-programming/sudoku-solver-using-c/feed/</wfw:commentRss>
		<slash:comments>76</slash:comments>
		</item>
		<item>
		<title>Shuffle game using C++</title>
		<link>http://electrofriends.com/projects/computer-programming/shuffle-game-using-c/</link>
		<comments>http://electrofriends.com/projects/computer-programming/shuffle-game-using-c/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 09:51:40 +0000</pubDate>
		<dc:creator>Ranjith</dc:creator>
				<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[c graphics]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[game programming]]></category>
		<category><![CDATA[Mouce programming]]></category>
		<category><![CDATA[Shuffle game]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=245</guid>
		<description><![CDATA[If you think playing a game as this is a child&#8217;s play, try a hand on this and think again. Its all about how you plan on making your next move. All the best, have fun. Here is a simple game developed in C graphics which is called &#8216;The Shuffle Game&#8217;. We believe u have [...]]]></description>
			<content:encoded><![CDATA[<p>If you think playing a game as this is a child&#8217;s play, try a hand on this and think again. Its all about how you plan on making your next move. All the best, have fun.</p>
<p>Here is a simple game developed in C graphics which is called &#8216;The Shuffle Game&#8217;. We believe u have already played many of such games where in you need to arrange scrambled pieces of a picture, alphabets or numbers. In the present program you have been given a matrix of 16 squares of which 15 are assigned with 15 different numbers and 1 is left out blank (empty space for movement of the remaining boxes) which are all shuffled. All you have to do is arrange these numbers in order as shown in the picture given below. The number of moves and the number that have been arranged by you in the proper position will be continuously displayed on the screen.  The controls  are as given below.</p>
<p><strong> Controls:</strong></p>
<p>You can move the boxes by using the arrow keys on your keyboard or by simply clicking on the box which you want to move into the empty space. While using the arrow keys, if you want to move the box left to the empty space just hit the left arrow button. Similarly you can move the boxes on the top, bottom or right of the empty box by hitting the up, down or right arrows respectively. In case you want to restart the game all over again just click the &#8216;RESTART&#8217; button or if you want to quit the game, all you have to do is to click the &#8216;EXIT&#8217; button on the screen.</p>
<div id="attachment_246" class="wp-caption aligncenter" style="width: 373px"><img class="size-full wp-image-246" title="Shuffle game using C++" src="http://electrofriends.com/wp-content/uploads/2008/11/shuffle.jpg" alt="Shuffle game using C++" width="363" height="285" /><p class="wp-caption-text">Shuffle game using C++</p></div>
<p><strong>Source code:</strong></p>
<p>#include&lt;stdio.h&gt;<br />
#include&lt;stdlib.h&gt;<br />
#include&lt;conio.h&gt;<br />
#include&lt;graphics.h&gt;<br />
#include&lt;dos.h&gt;<br />
#include&lt;alloc.h&gt;<br />
#include&lt;process.h&gt;<br />
union REGS in,out;<br />
void *buf;<br />
int size,count=0,px,py,rnd[4][4],correct=0;</p>
<p>float octave [7]={130.81,146.83,164.81,174.61,196,220,246.94};</p>
<p>int callmouse()<br />
{    in.x.ax=1;<br />
int86(51,&amp;in,&amp;out);<br />
return 1;</p>
<p>}<br />
void mouseposi(int &amp;xpos,int &amp;ypos,int &amp;click)<br />
{   in.x.ax=3;<br />
int86(51,&amp;in,&amp;out);<br />
click=out.x.bx;<br />
xpos=out.x.cx;<br />
ypos=out.x.dx;<br />
return ;<br />
}<br />
int  mousehide()<br />
{<br />
in.x.ax=2;<br />
int86(51,&amp;in,&amp;out);<br />
return 1;<br />
}<br />
void done(void)<br />
{<br />
int i,j;<br />
mousehide();<br />
j=0;<br />
int n;<br />
for(i=1;i&lt;=15;i++)<br />
{<br />
n=random(7);<br />
sound(octave[n]*4);<br />
delay(300);<br />
setfillstyle(1,2);<br />
bar(42+j,425,68+j,455);<br />
setfillstyle(1,0);<br />
bar(68+j,425,72+j,455);<br />
j=j+29;<br />
}<br />
nosound();<br />
delay(1000);<br />
for(j=0;j&lt;382;j+=2)<br />
{<br />
for(i=0;i&lt;575;i+=2)<br />
{<br />
putpixel(26+i,25+j,4);<br />
putpixel(26+i,460-j,4);<br />
putpixel(25+j*3/4,28+i*3/4,2);<br />
putpixel(595-j*3/4,458-i*3/4,2);<br />
delay(0);<br />
}<br />
}<br />
delay(1000);<br />
settextstyle(1,0,5);<br />
setcolor(14);</p>
<p>outtextxy(320,300,&#8221;http://electrofriends.com&#8221;);<br />
outtextxy(321,300,&#8221;http://electrofriends.com&#8221;);<br />
delay(500);<br />
getch();<br />
exit(0);<br />
}<br />
checknum(int mat[4][4])<br />
{<br />
int k=0,i,j;<br />
correct=0;<br />
for(i=0;i&lt;=3;i++)<br />
{<br />
for(j=0;j&lt;=3;j++)<br />
{<br />
k++;<br />
if(k==mat[i][j])<br />
correct++;<br />
}<br />
}<br />
gotoxy(10,11);<br />
printf(&#8220;NUMBERS ARE IN CORRECT POSITION IS ..: %d  &#8220;,correct);<br />
if(correct==15)<br />
{<br />
bar(130,40,480,80);<br />
settextstyle(1,0,4);<br />
outtextxy(300,60,&#8221;CONGRAGULATIONS !&#8221;);<br />
done();<br />
}<br />
else<br />
{<br />
bar(20,415,480,463);<br />
j=0;<br />
for(i=1;i&lt;=correct;i++)<br />
{<br />
setfillstyle(1,1);<br />
bar(42+j,425,68+j,455);<br />
setfillstyle(1,0);<br />
bar(68+j,425,72+j,455);<br />
j=j+29;<br />
}<br />
}<br />
return 0;<br />
}</p>
<p>void  move(int &amp;a,int &amp;b,int &amp;c,int &amp;d,int &amp;w,int &amp;x,int &amp;y,int &amp;z,int &amp;num)<br />
{<br />
if(a&gt;192 &amp;&amp; b&gt;190 &amp;&amp; c&lt;403 &amp;&amp; d&lt;404)<br />
{<br />
sound(600);<br />
count++;<br />
gotoxy(10,9);<br />
printf(&#8220;NUMBER OF MOVES..: %d   &#8220;,count);<br />
mousehide();<br />
size=imagesize(a,b,c,d);<br />
free(buf);<br />
buf=malloc(size);<br />
getimage(a,b,c,d,buf);<br />
bar(a,b,c,d);<br />
putimage(w,x,buf,COPY_PUT);<br />
w=a;<br />
x=b;<br />
y=c;<br />
z=d;<br />
if(num==1)<br />
{<br />
rnd[px][py]=rnd[px+1][py];<br />
rnd[px+1][py]=0;<br />
px++;<br />
}<br />
else if(num==2)<br />
{<br />
rnd[px][py]=rnd[px-1][py];<br />
rnd[px-1][py]=0;<br />
px&#8211;;<br />
}<br />
else if(num==3)<br />
{<br />
rnd[px][py]=rnd[px][py+1];<br />
rnd[px][py+1]=0;<br />
py++;<br />
}<br />
else if(num==4)<br />
{<br />
rnd[px][py]=rnd[px][py-1];<br />
rnd[px][py-1]=0;<br />
py&#8211;;<br />
}<br />
checknum(rnd);<br />
callmouse();<br />
delay(40);<br />
nosound();<br />
}<br />
return ;<br />
}</p>
<p>main()<br />
{<br />
int a1,b1,cl,a,b,c,d,w,x,y,z,key,p=0,q=0;<br />
int g=DETECT,m,ext=0,rst=0,rx,ry,num,i,j;<br />
initgraph(&amp;g,&amp;m,&#8221;c:\\TC\\bgi&#8221;);<br />
randomize();<br />
gotoxy(50,9);<br />
printf(&#8220;http://electrofriends.com&#8221;);</p>
<p>do<br />
{<br />
correct=0;<br />
count=0;<br />
gotoxy(10,9);<br />
printf(&#8220;NUMBER OF MOVES..: %d   &#8220;,count);</p>
<p>gotoxy(10,11);<br />
printf(&#8220;NUMBERS ARE IN CORRECT POSITION IS ..: %d  &#8220;,correct);<br />
setfillstyle(SOLID_FILL,4);<br />
setcolor(15);<br />
for(j=200;j&lt;360;j+=50)<br />
{<br />
for(i=200;i&lt;365;i+=50)<br />
{<br />
rectangle(j-1,i-1,j+46,i+46);<br />
bar(j,i,j+45,i+45);<br />
}<br />
}<br />
rectangle(192,190,403,404);<br />
settextstyle(1,0,3);<br />
for(i=0;i&lt;=3;i++)<br />
{<br />
for(j=0;j&lt;=3;j++)<br />
{<br />
rnd[i][j]=0;<br />
}<br />
}<br />
for(i=0;i&lt;=15;i++)<br />
{<br />
do<br />
{<br />
rx=random(4);<br />
ry=random(4);<br />
}  while(rnd[rx][ry]);<br />
rnd[rx][ry]=i;<br />
}<br />
char ab[10];<br />
settextjustify(CENTER_TEXT,CENTER_TEXT);<br />
q=p=0;<br />
for(i=0;i&lt;=3;i++)<br />
{<br />
for(j=0;j&lt;=3;j++)<br />
{<br />
if(rnd[i][j]!=0)<br />
{<br />
sprintf(ab,&#8221;%d&#8221;,rnd[i][j]);<br />
outtextxy(225+p,217+q,ab);<br />
}<br />
else<br />
{<br />
setfillstyle(1,0);<br />
px=i;py=j;<br />
bar(199+p,199+q,247+p,247+q);<br />
w=199+p;<br />
x=199+q;<br />
y=247+p;<br />
z=247+q;<br />
}<br />
p+=50 ;<br />
}<br />
p=0;<br />
q+=50 ;<br />
}<br />
bar(130,40,480,80);<br />
bar(10,425,480,455);<br />
setfillstyle(SOLID_FILL,4);<br />
rectangle(534,374,591,411);<br />
bar(535,375,590,410);<br />
outtextxy(561,390,&#8221;EXIT&#8221;);<br />
rectangle(484,419,591,456);<br />
bar(485,420,590,455);<br />
outtextxy(538,433,&#8221;RESTART&#8221;);<br />
setcolor(4);<br />
rectangle(10,10,610,470);<br />
rectangle(15,15,605,465);<br />
setcolor(14);<br />
rectangle(12,12,607,467);<br />
settextstyle(1,0,4);<br />
outtextxy(300,60,&#8221;SHUFFLE GAME&#8221;);<br />
line(150,85,450,85);</p>
<p>j=0;<br />
delay(1500);<br />
int n;<br />
for(i=1;i&lt;=15;i++)<br />
{<br />
n=random(7);<br />
sound(octave[n]*4);<br />
delay(300);<br />
setfillstyle(1,2);<br />
bar(42+j,425,68+j,455);<br />
setfillstyle(1,0);<br />
bar(68+j,425,72+j,455);<br />
j=j+29;<br />
}<br />
nosound();<br />
setfillstyle(SOLID_FILL,0);<br />
bar(30,425,480,455);<br />
settextstyle(2,0,5);<br />
outtextxy(250,425,&#8221;YOU CAN USE ARROW BUTTONS OR MOUSE TO MOVE BLOCKS.&#8221;);<br />
outtextxy(250,450,&#8221;      PRESS ANY KEY TO START&#8230;&#8230;..&#8221; );</p>
<p>getch();<br />
bar(20,415,480,463);<br />
callmouse();<br />
do<br />
{<br />
gotoxy(10,20);<br />
mouseposi(a1,b1,cl);<br />
if(a1&gt;w &amp;&amp; a1&lt;y &amp;&amp; b1&gt;x+50 &amp;&amp; b1&lt;z+50 &amp;&amp; cl==1)<br />
{<br />
num=1;<br />
move(w,x+50,y,z+50,w,x,y,z,num);                   //up<br />
}<br />
if(a1&gt;w &amp;&amp; a1&lt;y &amp;&amp; b1&gt;x-50 &amp;&amp; b1&lt;z-50 &amp;&amp; cl==1)<br />
{<br />
num=2;<br />
move(w,x-50,y,z-50,w,x,y,z,num);              //down<br />
}<br />
if(a1&gt;w+50 &amp;&amp; a1&lt;y+50 &amp;&amp; b1&gt;x &amp;&amp; b1&lt;z &amp;&amp; cl==1)<br />
{<br />
num=3;<br />
move(w+50,x,y+50,z,w,x,y,z,num);                   //left<br />
}<br />
if(a1&gt;w-50 &amp;&amp; a1&lt;y-50 &amp;&amp; b1&gt;x &amp;&amp; b1&lt;z &amp;&amp; cl==1)<br />
{<br />
num=4;<br />
move(w-50,x,y-50,z,w,x,y,z,num);                   //right<br />
}<br />
if(kbhit())<br />
{<br />
key=getch();<br />
switch(key)<br />
{<br />
case 72: num=1;<br />
move(w,x+50,y,z+50,w,x,y,z,num);           //up<br />
break;<br />
case 80: num=2;<br />
move(w,x-50,y,z-50,w,x,y,z,num);           //down<br />
break;<br />
case 75: num=3;<br />
move(w+50,x,y+50,z,w,x,y,z,num);          //left<br />
break;<br />
case 77: num=4;<br />
move(w-50,x,y-50,z,w,x,y,z,num);          //right<br />
break;<br />
}<br />
}</p>
<p>if((a1&gt;535 &amp;&amp; a1&lt;590 &amp;&amp; b1&gt;375 &amp;&amp; b1&lt;410 &amp;&amp; cl==1) || key==27)<br />
done();<br />
rst=0;<br />
if(a1&gt;485 &amp;&amp; a1&lt;590 &amp;&amp; b1&gt;420 &amp;&amp; b1&lt;455 &amp;&amp; cl==1 )<br />
rst=1;<br />
} while(rst==0);<br />
} while(rst!=0);<br />
closegraph();<br />
}</p>
<p>If you find difficult to compile the code, <a href="http://electrofriends.com/wp-content/uploads/2008/11/shuffle.zip">Download source code, executable file and supporting files here.</a></p>
<p>You have seen it, you have played it, you have seen the source code. Now its your turn to show us how creative your thinking is!! We hope you have got all the ideas that you need to build such a game with C graphic. If you are successful do send us a copy of the game. We will see through that your name comes on this site.</p>
]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/projects/computer-programming/shuffle-game-using-c/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Device Switching Using PC’s  Parallel Port</title>
		<link>http://electrofriends.com/projects/computer-programming/device-switching-using-pc%e2%80%99s-parallel-port/</link>
		<comments>http://electrofriends.com/projects/computer-programming/device-switching-using-pc%e2%80%99s-parallel-port/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 09:30:15 +0000</pubDate>
		<dc:creator>Ranjith</dc:creator>
				<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[16-line Decoder/De-Multiplexer]]></category>
		<category><![CDATA[C++ prpgram]]></category>
		<category><![CDATA[Device Switching]]></category>
		<category><![CDATA[DM74LS154]]></category>
		<category><![CDATA[Interfacing Parallel Port]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=227</guid>
		<description><![CDATA[Imagine the convenience, if we could control different devices at home/industry by using a single PC. Our project aims at the same and could be used to control the printer power, loads &#38; other household electrical appliances. The circuit comprises decoder, inverter, latch &#38; relay driver sections. To control these equipments we are using PC’s [...]]]></description>
			<content:encoded><![CDATA[<p>Imagine the convenience, if we could control different devices at home/industry by using a single PC. Our project aims at the same and could be used to control the printer power, loads &amp; other household electrical appliances. The circuit comprises decoder, inverter, latch &amp; relay driver sections. To control these equipments we are using PC’s Parallel port. The program of controlling  is  written in C language. It is compiled using Turbo C compiler.</p>
<p>The project though a bit expensive, is very efficient in control of real world peripherals.</p>
<p><strong>Contents:</strong></p>
<ol>
<li>INTRODUCTION</li>
<li>PARTS LIST</li>
<li>BLOCK DIAGRAM</li>
<li>COMPONENT DESCRIPTION
<ul>
<li>Parallel Port</li>
<li>IC 74LS154</li>
<li>IC 74LS74</li>
<li>1C 74 LS05</li>
<li>1C ULN 2803</li>
<li>Relay</li>
</ul>
</li>
<li>CIRCUIT DESCRIPTION AND WORKING</li>
<li>SOFTWARE PROGRAM</li>
<li>CONCLUSION</li>
</ol>
<p><strong>INTRODUCTION:</strong></p>
<p>The PC parallel port is an expensive yet a powerful platform for implementing projects dealing with the control of real-world peripherals. This port can be used to control the printer as also household and other electrical appliances. The computer program through the interface circuit controls the relays, which, in turn, switch the appliances on or off.</p>
<p>The parallel port has 12 outputs including 8 data lines and 4 control lines. The circuit described here can be used to control up to 255 electrical appliances using only eight data lines from the parallel port. Besides, the software program allows the users to know the current status of the loads.<br />
<strong><br />
PARTS LIST:<br />
</strong><br />
Semiconductors:<br />
ICl, IC2, IC3               &#8211; 74LS154 l-of-16 decoder<br />
IC4, IC5, IC6              &#8211; 74LSO5 inverter<br />
IC7-ICI4                     &#8211; 74LS74 D-type flip/flop<br />
ICI5, IC16                   &#8211; ULN2803 octal Darlington array driver<br />
Misc.<br />
Power supply               &#8211; 5V regulated DC, 12VregulatedDC<br />
Relay                           &#8211; 12V,200-ohm, lC/O SPDT</p>
<p><strong>BLOCK DIAGRAM:</strong></p>
<p>The block diagram in Fig. 1 depicts the main components of the switching system for 255 electrical loads using PC. The control command to switch on/off the appliances is given through the keyboard. The software program scans the input and as per the input command, the data is available at the parallel port.</p>
<div id="attachment_228" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-228" title=" FIg 1. Block Diagram" src="http://electrofriends.com/wp-content/uploads/2008/11/block2.jpg" alt=" FIg 1. Block Diagram" width="500" height="213" /><p class="wp-caption-text"> FIg 1. Block Diagram</p></div>
<p>Out of eight bits, first four bits (D0 through D3) are data signal bits and the remaining four bits (D4 through D7) are used as control signals. Control signals are given to decoder 1. The output of decoder 1 is given to Enable pins of decoders 2 and 3. Data signals are given to both decoders 2 and 3. The outputs of decoders 2 and 3 are inverted and fed to a D-type flip/flop that is used to latch the data. The latched data output is given to relay driver ICs ULN2803. The relay drivers drive the relays for switching the appliances.</p>
<p><strong> COMPONENT DESCRIPTION:</strong></p>
<p><strong> 1. THE PARALLEL PORT:</strong></p>
<p>The parallel port or line printer terminal (LPT) port is a 25-pin D-type female connector available at the back of your PC. A basic IBM PC usually comes with one or two LPT ports. The original parallel port, called standard parallel port (SPP), is a bundle of three ports (or registers), namely, data port, status port, and control port. Pins 2 through 9 form the 8-bit data port. This port is purely a write-only port. This means it can be used only to output some data through it. Pins I, 14, 16, and 17 form the control port, which is capable of reading/writing. Pins 10 through 13 and pin 15 together form the status port. The status port is a read-only port. The details of 25-pin parallel port are given in Table 1.</p>
<div id="attachment_229" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-229" title=" TABLE 1: Parallel Port Pin Details" src="http://electrofriends.com/wp-content/uploads/2008/11/pindetails.jpg" alt=" TABLE 1: Parallel Port Pin Details" width="500" height="399" /><p class="wp-caption-text"> TABLE 1: Parallel Port Pin Details</p></div>
<p>The base address of the first parallel port (LPT1) is 0378 in hexadecimal (hex) notation (or 888 in decimal notation). The base address of the second parallel port (LPT2) is 0278 in hex. In this project, we&#8217;ve used only LPT1.</p>
<p><strong> 2. DM74LS154 : 4-LINE TO 16-LINE DECODER / DE-MULTIPLEXER:</strong></p>
<p>Each of these 4-line-to-16-line decoders utilizes TTL circuitry to decode four binary-coded inputs into one of six-teen mutually exclusive outputs when both the strobe inputs, GI and G2, are LOW. The de-multiplexing function is performed by using the 4 input lines to address the out-put line, passing data from one of the strobe inputs with the other strobe input LOW. When either strobe input is HIGH, all outputs are HIGH. These de-multiplexers are ideally suited for implementing high-performance memory decoders.<br />
All inputs are buffered and input clamping diodes are provided to minimize transmission line effects and thereby simplify system design.</p>
<p><strong>3. 74LS74 : DUAL D-TYPE POSITIVE-EDGE-TRIGGERED FLIP-FLOPS:</strong></p>
<p>These devices contain two independent D-type positive-edge triggered flip-flops. A low level at the preset or clear inputs sets or resets the outputs regardless of the levels of the other inputs. When preset and clear are inactive (high), data at the D input meeting the setup time requirements are transferred to the outputs on the positive-going edge of the clock pulse. Clock triggering occurs at a voltage level and is not directly related to the rise time of the clock pulse. Following the hold time interval, data at the D input may be changed without affecting the levels at the outputs.</p>
<p><strong>4. HEX INVERTER:</strong></p>
<p>It is used for inversion of input signal. Since outputs from the de-multiplexers are active low, we invert them. This IC has 6 not-gates and hence called a hex-inverter.</p>
<p><strong>5. ULN-2803 : OCTAL PERIPHERAL DRIVER ARRAYS:</strong></p>
<p>The eight NPN Darlington connected transistors in this family of arrays are ideally suited for interfacing between low logic level digital circuitry (such as TTL, CMOS or PMOS/NMOS) and the higher current/voltage requirements of lamps, relays, printer hammers or other similar loads for a broad range of computer, industrial, and consumer applications. All devices feature open-collector outputs and freewheeling clamp diodes for transient suppression. The ULN2803 is designed to be compatible with standard TTL families while the ULN2804 is optimized for 6 to 15volt high-level CMOS or PMOS.</p>
<p><strong>6. RELAYS:</strong></p>
<p>The relay is a device by means of which an electrical circuit can be controlled (opened or closed) by sensing a change in the circuit in which it is connected. The relays can be either electromagnetic or electronic. In this circuit the electromagnetic relay is used to connect or disconnect the supply to the appliance to be controlled. It works on the principle of electromagnetic attraction and electromagnetic induction. These relays can be actuated by AC or DC quantities. In these relays there are one or more coils, movable elements, contact systems etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/projects/computer-programming/device-switching-using-pc%e2%80%99s-parallel-port/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Lexical Analyzer</title>
		<link>http://electrofriends.com/projects/computer-programming/lexical-analyzer/</link>
		<comments>http://electrofriends.com/projects/computer-programming/lexical-analyzer/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 07:37:32 +0000</pubDate>
		<dc:creator>Ranjith</dc:creator>
				<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[C codes]]></category>
		<category><![CDATA[characters to tokens]]></category>
		<category><![CDATA[Lexical Analyzer]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=223</guid>
		<description><![CDATA[Lexical analyzer converts stream of input characters into a stream of tokens. The different tokens that our lexical analyzer identifies are as follows: KEYWORDS: int, char, float, double, if, for, while, else, switch, struct, printf, scanf, case, break, return, typedef, void IDENTIFIERS: main, fopen, getch etc NUMBERS: positive and negative integers, positive and negative floating [...]]]></description>
			<content:encoded><![CDATA[<p>Lexical analyzer converts stream of input characters into a stream of tokens. The different tokens that our lexical analyzer identifies are as follows:</p>
<p>KEYWORDS: int, char, float, double, if, for, while, else, switch, struct, printf, scanf, case, break, return, typedef, void</p>
<p>IDENTIFIERS: main, fopen, getch etc</p>
<p>NUMBERS: positive and negative integers, positive and negative floating point numbers.</p>
<p>OPERATORS: +, ++, -, &#8211;, ||, *, ?, /, &gt;, &gt;=, &lt;, &lt;=, =, ==, &amp;, &amp;&amp;.</p>
<p>BRACKETS: [ ], { }, ( ).</p>
<p>STRINGS : Set of characters enclosed within the quotes</p>
<p>COMMENT LINES: Ignores single  line, multi line comments</p>
<p>For tokenizing into identifiers and keywords we incorporate a symbol table which initially consists of predefined keywords. The tokens are read from an input file. If the encountered token is an identifier or a keyword the lexical analyzer will look up in the symbol table to check  the existence  of the respective token. If an entry does exist then we proceed to the next  token. If not then that particular  token along with the token value is written into the symbol table. The rest of the tokens are directly displayed by writing into an output file.</p>
<p>The output file will consist of all the tokens present in our input file along with their respective token values.</p>
<p><strong>INTRODUCTION:</strong></p>
<p>Lexical analysis involves scanning the program to be compiled and recognizing the tokens that make up the source statements Scanners or lexical analyzers are usually designed to recognize keywords , operators , and identifiers , as well as integers, floating point numbers , character strings , and other  similar items that are written as part of the source program . The exact set of  tokens to be recognized of course, depends upon the programming language being used to describe it.</p>
<p>A sequence of input characters that comprises a single token is called a lexeme. A lexical analyzer can insulate a parser from the lexeme representation of tokens. Following are the list of functions that lexical analyzers perform.</p>
<p><strong>Removal of white space and  comment :</strong></p>
<p>Many languages allow “white space” to appear between tokens. Comments can likewise be ignored by the parser and translator , so they may also be treated as white space. If white space is eliminated by the lexical analyzer, the parser will never have to consider it.</p>
<p><strong>Constants :</strong></p>
<p>An integer constant is a sequence of digits, integer constants can be allowed by adding productions to the grammar for expressions, or by creating a token for such constants . The job of collecting digits into integers is generally given to a lexical analyzer because numbers can be treated as single units during translation. The lexical analyzer passes both the token and attribute to the parser.<br />
<strong><br />
Recognizing identifiers and keywords :</strong></p>
<p>Languages use identifiers as names of variables, arrays and functions. A grammar for a language often treats an identifier as a token. Many languages use fixed character strings such as begin, end , if, and so on, as punctuation marks or to identify certain constructs. These character strings, called keywords, generally satisfy the rules for forming identifiers.</p>
<p><strong>SYSTEM ANALYSIS:</strong></p>
<p>The operating  system used is MS-DOS.</p>
<p><strong>MS-DOS : </strong>The MS-DOS is a single user, single process, single processor operating system. Due to the confinement of the device dependent code into one layer, the porting of MS-DOS has theoretically been reduced to writing  of the BIOS code for the new hardware. At the command level it provides a hierarchical file system, input output redirection, pipes and filters. User written commands can be invoked in the same way as the standard system commands, giving the appearance as if the basic system functionality has been extended.</p>
<p>Being a single user system, it provides only file protection and access control. The disk space is allocated in terms of a cluster of consecutive sectors. The command language of MS-DOS has been designed to allow the user to interact directly with the operating system using a CRT terminal. The principal use of the command language is to initiate the execution of commands and programs. A user program can be executed under MS-DOS by simply typing the name of the executable file of the user program at the DOS command prompt.</p>
<p>The programming language used here is C programming</p>
<p><strong>SYSTEM DESIGN:</strong></p>
<p><strong>Process:</strong></p>
<p>The lexical analyzer is the first phase of  a compiler. Its main task is to read the input characters and produce as output a sequence of tokens that the parser uses for syntax analysis. This interaction, summarized schematically in fig. a.</p>
<div id="attachment_224" class="wp-caption aligncenter" style="width: 496px"><img class="size-full wp-image-224" title="fig a. Process of lexical analyzer " src="http://electrofriends.com/wp-content/uploads/2008/11/block_1.gif" alt="fig a. Process of lexical analyzer " width="486" height="179" /><p class="wp-caption-text">fig a. Process of lexical analyzer </p></div>
<p>Upon receiving a “get next token “command from the parser, the lexical analyzer reads the input characters until it can identify next token.</p>
<p>Sometimes , lexical analyzers are divided into a cascade of two phases, the first called “scanning”, and the second “lexical analysis”.</p>
<p>The scanner is responsible for doing simple tasks, while the lexical analyzer proper does the more complex operations.</p>
<p>The lexical analyzer which we have designed takes the input  from a input file. It reads one character at a time from the input file, and continues to read until end of the file is reached. It recognizes the valid identifiers, keywords and specifies the token values of the keywords.</p>
<p>It also identifies the header files, #define statements, numbers, special characters, various relational and logical operators, ignores the white spaces and comments. It prints the output in a separate file specifying the line number .</p>
<p><strong>BLOCK DIAGRAM:</strong></p>
<div id="attachment_225" class="wp-caption aligncenter" style="width: 460px"><img class="size-full wp-image-225" title="fig b. Block diagram of the project" src="http://electrofriends.com/wp-content/uploads/2008/11/block_2.gif" alt="fig b. Block diagram of the project" width="450" height="198" /><p class="wp-caption-text">fig b. Block diagram of the project</p></div>
]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/projects/computer-programming/lexical-analyzer/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Doctor&#8217;s Diary using JSP Technology</title>
		<link>http://electrofriends.com/projects/computer-programming/doctors-diary-using-jsp-technology/</link>
		<comments>http://electrofriends.com/projects/computer-programming/doctors-diary-using-jsp-technology/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 07:08:41 +0000</pubDate>
		<dc:creator>Ranjith</dc:creator>
				<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[Doctor's Diary]]></category>
		<category><![CDATA[J2EE(JSP)]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JSP Technology]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=209</guid>
		<description><![CDATA[This is the model software from electrofriends.com. We successfully implemented the need and necessary concepts of a doctor, for his stand alone clinic. We hope this software package will definitely help the students, to get an idea about their academic projects. For a doctor, it is absolutely difficult to keep all the details of his [...]]]></description>
			<content:encoded><![CDATA[<p>This is the model software from electrofriends.com. We successfully implemented the need and necessary concepts of a doctor, for his stand alone clinic. We hope this software package will definitely help the students, to get an idea about their academic projects.</p>
<p>For a doctor, it is absolutely difficult to keep all the details of his patients in such a manner that is easily retrievable in hardware domain, i.e. by keeping a booklet or file folder. So, it is the time to switch for a doctor from classic hardware book-keeping to the software domain, by storing all the details in Computer memories, databases, which are easy accessible at any time, every time. Before that, it should be implemented as the Academic projects in educational institutions. By that way, we are trying to help the students, by making the things easier. The most emerging technology, J2EE(JSP), SQL, JavaScript are the backbone of this project. This is the outcome of software professionals, from the knowledge city- Bengalooru. A student can get these codes and can find how the real time practical needs are made in such a sophisticated form and such a short size. The GUI developed is user- friendly and minimum computer knowledge is sufficient to handle the software, we can expect that now from doctor’s side on these days.</p>
<p>You can find the inner feature of the Doctor’s Diary, with static images of the Dynamic pages.</p>
<p>This software has mainly 3 modules.</p>
<ol>
<li>Entering the New patient to the clinic.</li>
<li>Manipulating with Old patient details.</li>
<li>Setting the personal details of Doctor.</li>
</ol>
<div id="attachment_210" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-210" title="Figure 1: Main page of Doctor's Diary." src="http://electrofriends.com/wp-content/uploads/2008/11/mainpage.gif" alt="Figure 1: Main page of Doctor's Diary." width="500" height="371" /><p class="wp-caption-text">Figure 1: Main page of Doctor</p></div>
<p>Here are the brief descriptions of each field. In the left side of the home page we have an array of features of the software, in the black background.</p>
<p><strong>1. New Patient:</strong></p>
<p>The very first option in the features’ list is the New Patient. Clicking the option will lead to the corresponding page in the main page of the software which will input the new patient details to the database (Shown in figure 2). An auto incrementing number display named Patient Id, will be the unique identification number for the patient. The Doctor can enter the Patient Name, address and other details. He also can enter the Symptoms and the Medicine Prescribed for the patient. These details are getting stored in the database under today’s date.</p>
<div id="attachment_211" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-211" title="Figure 2: New patient page of Doctor's Diary." src="http://electrofriends.com/wp-content/uploads/2008/11/new_patient.gif" alt="Figure 2: New patient page of Doctor's Diary." width="500" height="641" /><p class="wp-caption-text">Figure 2: New patient page of Doctor</p></div>
]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/projects/computer-programming/doctors-diary-using-jsp-technology/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Induction furnace control system</title>
		<link>http://electrofriends.com/projects/computer-programming/induction-furnace-control-system/</link>
		<comments>http://electrofriends.com/projects/computer-programming/induction-furnace-control-system/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 05:53:37 +0000</pubDate>
		<dc:creator>Ranjith</dc:creator>
				<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[furnace control system]]></category>
		<category><![CDATA[Interfacing Parallel Port]]></category>
		<category><![CDATA[LM 335Z]]></category>
		<category><![CDATA[Opto isolator]]></category>
		<category><![CDATA[Precision temperature sensor]]></category>

		<guid isPermaLink="false">http://electrofriends.com/?p=201</guid>
		<description><![CDATA[This project is an attempted step towards resolving the manual problems in controlling Induction Furnace and provides control for it, using Artificial Intelligence at a very small scale. The project deals with a simple aspect of giving information about the Induction Furnace and their control. Initially it provided a system release manual power as much [...]]]></description>
			<content:encoded><![CDATA[<p>This project is an attempted step towards resolving the manual problems in controlling Induction Furnace and provides control for it, using Artificial Intelligence at a very small scale. The project deals with a simple aspect of giving information about the Induction Furnace and their control. Initially it provided a system release manual power as much as possible from control of Induction Furnace and can be handled with merely one person, if needed. Etymologically, idea of this project is to provide security to whole system of controlling in case of any emergency.</p>
<p>In project we will develop a system, which can control Induction furnace without any help of human side. The system will be capable of delivering message of over heating of blast furnace and can take decisions accordingly.</p>
<p>The project is prepared in order to control the “INDUCTION FURNACE” in the best and easiest possible way. This system can emerge as the pioneer step in implementation of “ARTIFICIAL   INTELLIGENCE” in control of induction furnace</p>
<p><strong>Induction furnace :</strong></p>
<p>The induction furnace plays an important role in steel plants producing high quality and stainless steels. In the field of iron casting and foundries the induction furnace is known as a standard.</p>
<p>Induction furnaces offer certain advantages over other furnace systems. They include:</p>
<p><strong>Higher Yield</strong>: The absence of combustion sources reduces oxidation losses that can be significant in production economics. This can amount to 2 to 7 percent yield savings in aluminum melting.</p>
<p><strong>Faster Start up</strong>: Full power from the power supply is available, instantaneously, thus reducing the time to reach working temperature. Cold charge-to-tap times of one to two hours are common.</p>
<p><strong>Automatic Operation</strong>: Precise automatic control of power reduces furnace manpower to that required only for charging, tapping, and metallurgical measurements.</p>
<p><strong>parallel port</strong></p>
<p><strong>How to connect circuits to parallel port ?</strong></p>
<p>PC parallel port is 25-pin D-shaped female connector in the back of the computer. It is normally used for connecting computer to printer, but many other types of hardware for that port is available today. Not all 25 are needed always. Usually you can easily do with only 8 output pins (data lines) and signal ground. I have presented those pins in the table below. Those output pins are adequate for many purposes.</p>
<p>pin           :    2       3        4         5        6        7        8          9<br />
function   :   D0    D1      D2      D3      D4      D5      D6        D7</p>
<p>Pins 18, 19, 20, 21, 22, 23, 24 and 25 are all ground pins.</p>
<p>Those data pins are TTL level output pins. This means that they put out ideally 0V when they are in low logic level (0) and +5V when they are in high logic level (1). In real world the voltages can be something different from ideal when the circuit is loaded. The output current capacity of the parallel port is limited to only few mill amperes.</p>
<p><strong>Reading the input pins in parallel port :</strong></p>
<p>PC parallel port has 5 input pins. The input pins can be read from the I/O address LPT port base address + 1.<br />
The meaning of the buts in byte you read from that I/O port:</p>
<p>D0: state not specified<br />
D1: state not specified<br />
D2: state not specified<br />
D3: state of pin 15 (ERROR) inverted<br />
D4: state of pin 13 (SELECTED)<br />
D5: state of pin 12 (PAPER OUT)<br />
D6: state of pin 10 (ACK)<br />
D7: state of pin 11 (BUSY) inverted</p>
<p>in = inportb(0&#215;379);  or in = inp(0&#215;379);</p>
<p>Where N is the data you want to output. The actual I/O port controlling command varies from compiler to compiler because it is not part of standardized C libraries.</p>
<p><strong>Interrupts :</strong></p>
<p>Most parallel ports are capable of detecting interrupt signals from a peripheral. The peripheral may use an interrupt to announce that it’s ready to receive a byte, or that it has a byte to send. To use interrupts, a parallel port must have an assigned interrupt-request level (IRQ). Conventionally, LPT1 uses IRQ7 and LPT2 uses IRQ5. But many sound cards use IRQ5, and because free IRQ levels can be scarce on a system, even IRQ7 may be reserved by another device. Some ports allow choosing other IRQ levels besides these two.</p>
<p>Many printer drivers and many other applications and drivers that access the parallel port don’t require parallel-port interrupts. If you select no IRQ level for a port, the port will still work in most cases, though sometimes not as efficiently, and you can use the IRQ level for something else.</p>
<p style="text-align: right;">By<br />
Prabhat kumar thakur, Ramayan patel, Tarun kumar das, Vijay dashore, Shikha khare<br />
Chhattrapati Shivaji Institute of Technology, Shivaji nagar,  Durg, (C.G.)</p>
<p style="text-align: left;">Circuit diagrams and source codes are given in the next page.</p>
]]></content:encoded>
			<wfw:commentRss>http://electrofriends.com/projects/computer-programming/induction-furnace-control-system/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

