<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>ParityCheck</title>
	<atom:link href="http://paritycheck.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://paritycheck.wordpress.com</link>
	<description>My online repository of chip development how-tos, info, and other goings on...</description>
	<lastBuildDate>Sat, 14 Nov 2009 18:46:10 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='paritycheck.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/ca4110df33f6ff42d0f33c6c01386c98?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>ParityCheck</title>
		<link>http://paritycheck.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://paritycheck.wordpress.com/osd.xml" title="ParityCheck" />
		<item>
		<title>Firmware architecture in five easy steps By Michael Barr</title>
		<link>http://paritycheck.wordpress.com/2009/11/13/firmware-architecture-in-five-easy-steps-by-michael-barr/</link>
		<comments>http://paritycheck.wordpress.com/2009/11/13/firmware-architecture-in-five-easy-steps-by-michael-barr/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 07:28:33 +0000</pubDate>
		<dc:creator>paritycheck</dc:creator>
				<category><![CDATA[ASIC Design]]></category>
		<category><![CDATA[Embedded Design]]></category>

		<guid isPermaLink="false">http://paritycheck.wordpress.com/?p=155</guid>
		<description><![CDATA[Firmware architecture in five easy steps

By Michael Barr

Embedded.com 

(09/21/09, 04:03:00 PM EDT)
Over the past few years, I&#8217;ve spent a large amount of my time consulting with and training software development teams that were in the midst of rearchitecture. These teams had already developed the firmware inside successful long-lived products or product families. But to keep [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=155&subd=paritycheck&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div>Firmware architecture in five easy steps</div>
<p><!-- sub head --><!-- /sub head --><!-- icons --><!-- author/byline --></p>
<div>By Michael Barr</div>
<p><!-- site --></p>
<div><!-- remove http:// substring (if present) from the url --><a href="http://www.embedded.com/" target="_blank">Embedded.com </a></div>
<p><!-- date --></p>
<div>(09/21/09, 04:03:00 PM EDT)</div>
<p>Over the past few years, I&#8217;ve spent a large amount of my time consulting with and training software development teams that were in the midst of rearchitecture. These teams had already developed the firmware inside successful long-lived products or product families. But to keep moving forward, reduce bugs, and speed new feature development, they needed to take the best of their old code and plug it into a better firmware architecture.</p>
<div>
<p>In the process, I&#8217;ve collected substantial anecdotal evidence that leads me to conclude that few programmers, technical managers, or teams truly understand what good firmware architecture is, how to achieve it, or even how to recognize it when they see it. That includes the most experienced individual developers on a team. Yet, despite the fact that these teams work in a range of very different industries (including safety-critical medical devices), the rearchitecture process is remarkably similar from my point of view. And there are numerous ways that our clients&#8217; products and engineering teams would have benefited from getting their firmware architecture right from the beginning.</p>
<p>Although learning to create solid firmware architecture and simultaneously rearchitecting legacy software may take a team months of hard work, five key steps are easily identified. So whether you are designing firmware architecture from scratch for a new product or launching a rearchitecture effort of your own, you can use this step-by-step process to help your team get started on the right foot.</p>
<p><strong>Step 1: Identify the requirements</strong><br />
Before we can begin to (re)architect an embedded system or its firmware, we must have clear requirements. Properly written requirements define the WHAT of a product. WHAT does the product do for the user, specifically? For example, if the product is a ventilator, the list of WHAT it does may include a statement such as:</p>
<p>&#8220;If power is lost during operation, the ventilator shall resume operation according to its last programmed settings within 250 ms of power up.&#8221;</p>
<p>Note that a properly written requirement is silent about HOW this particular part of the overall WHAT is to be achieved. The implementation could be purely electronics or a combination of electronics and firmware; the firmware, if present, might contain an RTOS or it might not. From the point of view of the requirement writer, then, there may as well be a gnome living inside the product that fulfills the requirement.<sup>1</sup> (So long as the gnome is trustworthy and immortal, of course!)</p>
<p>Each requirement statement must also be two other things: unambiguous and testable. An unambiguous statement requires no further explanation. It is as clear and as concise as possible. If the requirement includes a mathematical model of expected system behavior, it is helpful to include the equations.<sup>2</sup></p>
<p>Testability is key. If a requirement is written properly, a set of tests can be easily constructed to verify that requirement is met. Decoupling the tests from the particulars of the implementation, in this manner, is of critical importance. Many organizations perform extensive testing of the wrong stuff. Any coupling between the test and the implementation is problematic.</p>
<p>A proper set of requirements is a written list of statements each of which contains the key phrase &#8221; the [product] shall &#8230;&#8221; and is silent about how it is implemented, unambiguous, and testable. This may seem like a subject unrelated to architecture, but too often it is poor requirements that constrain architecture. Thus good architecture depends in part on good requirements.<sup>3</sup></p>
<p><strong>Step 2: Distinguish architecture from design</strong><br />
Over the years, I have found that many engineers (as well as their managers) struggle to separate the various elements or layers of firmware engineering. For example, Netrino is barraged with requests for &#8220;design reviews&#8221; that turn out to be &#8220;code reviews&#8221; because the customer is confused about the meaning of &#8220;design.&#8221; This even happens in organizations that follow a defined software development lifecycle. We need to clear this up.</p>
<div>
<p>The architecture of a system is the outermost layer of HOW. Architecture describes persistent features; the architecture is hard to change and must be got right through careful thinking about intended and permissible uses of the product. By analogy, an architect describes a new office building only very broadly. A scale model and drawings show the outer dimensions, foundation, and number of floors. The number of rooms on each floor and their specific uses are not part of the architecture.<sup>4</sup></p>
<p>Architecture is best documented via a collection of block diagrams, with directional arrows connecting subsystems. The system architecture diagram identifies data flows and shows partitioning at the hardware vs. firmware level. Drilling down, the firmware architecture diagram identifies subsystem-level blocks such as device drivers, RTOS, middleware, and major application components. These architectural diagrams should not have to change even as roadmap features are added to the product—at least for the next few years. Architectural diagrams should also pass the &#8220;six-pack test,&#8221; which says that even after drinking a six pack of beer, every member of the team should still be able to understand the architecture; it is devoid of confusing details and has as few named components as possible.<sup>5</sup></p>
<p>The design of a system is the middle layer of HOW. The architecture does not include function or variable names. A firmware design document identifies these fine-grained details, such as the names and responsibilities of tasks within the specific subsystems or device drivers, the brand of RTOS (if one is used), and the details of the interfaces between subsystems. The design documents class, task, function/method, parameter, and variable names that must be agreed upon by all implementers. This is similar to how a design firm hired by the renter of a floor on the office building describes the interior and exterior of the new building in finer detail than the architect. Designers locate and name rooms and give them specific purposes (e.g., cube farm, corner office, or conference room).</p>
<p>An implementation is the lowest layer of HOW. There need be no document, other than the source code or schematics, to describe the implementation details. If the interfaces are defined sufficiently at the design level above, individual engineers are able to begin implementation of the various component parts in parallel. This is similar to the way that a carpenter, plumber, and electrician work in parallel in nearby space, applying their own judgment about the finer details of component placement, after the design has been approved by the lessee.</p>
<p>Of course, there is architecture and there is good architecture. Good architecture makes the most difficult parts of the project easy. These difficult parts vary in importance somewhat from industry to industry, but always center on three big challenges that must be traded off against each other: meeting real-time deadlines, testing, and diversity management. Addressing those issues comprise the final three steps.</p>
<p><strong>Step 3: Manage time</strong><br />
Some of your product&#8217;s requirements will mention explicit amounts of time. For example, consider the earlier ventilator requirement about doing something &#8220;within 250 ms of power up.&#8221; That is a timeliness requirement. &#8220;Within 250 ms of power up&#8221; is just one deadline for the ventilator implementation team to meet. (And something to be tested under a variety of scenarios.) The architecture should make it easy to meet this deadline, as well as to be certain it will always be met.</p>
<p>Most products feature a mix of non-real-time, soft-real-time, and hard-real-time requirements. Soft deadlines are usually the most challenging to define in an unambiguous manner, test, and implement. For example, in set-top box design it may be acceptable to drop a frame of video once in a while, but never more than two in a row, and never any audio, which arrives in the same digital input stream. The simplest way to handle soft deadlines is to treat them as hard deadlines that must always be met.</p>
<p>With deadlines identified, the first step in architecture is to push as many of the timeliness requirements as possible out of the software and onto the hardware. <strong>Figure 1</strong> shows the preferred placement of real-time functionality. As indicated, an FPGA or a dedicated CPU is the ideal place to put real-time functionality (irrespective of the length of the deadline). Only when that is not possible, should an interrupt service routine (ISR) be used instead. And only when an ISR won&#8217;t work should a high-priority task be used.</p>
<p><img src="http://i.cmpnet.com/embedded/2009/0909_Sept2009/0909embBarr01sm.gif" alt="" /></p>
<p><a href="http://i.cmpnet.com/embedded/2009/0909_Sept2009/0909embBarr01.gif">View the full-size image</a></p>
<p>Keeping the real-time functionality separate from the bulk of the software is valuable for two important reasons. First, because it simplifies the design and implementation of the non-real-time software. With timeliness requirements architected out of the bulk of the software, code written by novice implementers can be used without affecting user safety.<sup>6</sup></p>
<p>The second advantage of keeping the real-time functionality together is it simplifies the analysis involved in proving all deadlines are always met. If all of the real-time software is segregated into ISRs and high-priority tasks, the amount of work required to perform rate monotonic analysis (RMA) is significantly reduced. Additionally, once the RMA analysis is completed, it need not be revised every time the non-real-time code is tweaked or added to.</p>
<p><strong>Step 4: Design for test</strong><br />
Every embedded system needs to be tested. Generally, it is also valuable or mandatory that testing be performed at several levels. The most common levels of testing are:</p>
<div>
<ul type="DISC">
<li><strong><em>System tests</em></strong> verify that the product as a whole meets or exceeds the stated requirements. System tests are generally best developed outside of the engineering department, though they may fit into a test harness developed by engineers.<sup>7</sup></li>
<li><strong><em>Integration tests</em></strong> verify that a subset of the subsystems identified in the architecture diagrams interact as expected and produce reasonable outcomes. Integration tests are generally best developed by a testing group or person within software engineering.</li>
<li><strong><em>Unit tests</em></strong> verify that individual software components identified at the intermediate design level perform as their implementers expect. That is, they test at the level of the public API the component presents to other components. Unit tests are generally best developed by the same people that write the code under test.<sup>8</sup></li>
</ul>
<p>Of the three, system tests are most easily developed, as those test the product at its exposed hardware interfaces to the world (e.g., does the dialysis machine perform as required). Of course, a test harness may need to be developed for engineering and/or factory acceptance tests. But this is generally still easier than integration and unit tests, which demand additional visibility inside the device as it operates.</p>
<p>To make the development, use, and maintenance of integration and unit tests easy, it is valuable to architect the firmware in a manner compatible with a software test framework. The single best way to do this is to architect the interactions between all software components at the levels you want to test so they are based on publish-subscribe event passing (a.k.a., message passing).</p>
<p>Interaction based on a publish-subscribe model allows a lightweight test framework like the one shown in <strong>Figure 2</strong> to be inserted alongside the software component(s) under test. Any interface between the test framework and the outside world, such as a serial port, provides an easy way to inject or log events. A test engine on the other side of that communications interface can then be designed to accept test &#8220;scripts&#8221; as input, log subscribed event occurrences, and off-line check logged events against valid result sequences. Adding timestamps to the event logger and scripting language features like delay(time) and waitfor(event) significantly increases testing capability.</p>
<p><img src="http://i.cmpnet.com/embedded/2009/0909_Sept2009/0909embBarr02sm.gif" alt="" /></p>
<p><a href="http://i.cmpnet.com/embedded/2009/0909_Sept2009/0909embBarr02.gif">View the full-size image</a></p>
<p>It is unfortunate that the publish-subscribe component interaction model is at odds with proven methods of analyzing software schedulability (e.g., RMA). The sheer number of possible message arrival orders, queue depths, and other details make the analysis portion of guaranteeing timeliness difficult and fragile against minor implementation changes. This is, in fact, why it is important to separate the code that must meet deadlines from the rest of the software. In this architecture, though, the real-time functionality remains difficult to test other than at the system level.<sup>9</sup></p>
<p><strong>Step 5: Plan for change</strong><br />
The third key consideration during the firmware architecture phase of the project is the management of feature diversity and product customizations. Many companies use a single source code base to build firmware for a family of related products. For example, consider microwave ovens; though one high-end model may feature a dedicated &#8220;popcorn&#8221; button, another may lack this. The architecture of any new product&#8217;s firmware will also soon be tested and stretched in the direction of foreseeable planned feature additions along the product road map.</p>
<div>
<p>To plan for change, you must first understand the types of changes that occur in your specific product. Then architect the firmware so that those sorts of changes are the easiest to make. If the software is architected well, feature diversity can be managed through a single software build with compile-time and/or run-time behavioral switches in the firmware. Similarly, new features can be added easily to a good architecture without breaking the existing product&#8217;s functionality.</p>
<p>An architectural approach that handles product family diversity particularly well is one in which groups of related software components are collected into &#8220;packages&#8221;. Each such package is effectively an internal widget from which larger products can be built. The source code and unit tests for each particular package should be maintained by a team of &#8220;package developers&#8221; focused primarily on their stability and ease of use.</p>
<p>Teams of &#8220;product developers&#8221; combine stable releases of packages that contain the features they need, customize each as appropriate (e.g., via compile- or run-time mechanisms, or both) to their particular product, and add product-specific &#8220;glue.&#8221; Typically, all of the products in a related product family are built upon a common &#8220;Foundation&#8221; package (think API). For example a Model X microwave might be built from Foundation + Package A + Package B; whereas Model Y might consist of Foundation + A&#8217; + B + C, where package A&#8217; is a compile-time variant of package A and package C contains optional high-level cooking features, such as &#8220;Popcorn.&#8221;</p>
<p>Using this approach in a large organization, a new product built from a selection of stable bug-free packages can be brought to market quickly&#8211;and all products share an easy upgrade path as their core packages are improved. The main challenge in planning for change of this sort is in striking the right balance between packages that are too small and packages that are too large. Like many of the details of firmware architecture, achieving that balance for a number of years is more of an art than a science.</p>
<p><strong>Next steps</strong><br />
I hope the five-step &#8220;architecture road map&#8221; presented here is useful to you. I plan to drill down into more of the details in articles and columns over the coming months. Meanwhile your constructive feedback is welcome via the discussion forum or e-mail.</p>
<div>
<p><em><strong>Michael Barr</strong> is the author of three books and over fifty articles about embedded systems design, as well as a former editor-in-chief of this magazine. Michael is also a popular speaker at the Embedded Systems Conference, a former adjunct professor at the University of Maryland, and the president of Netrino. He has assisted in the design and implementation of products ranging from safety-critical medical devices to satellite TV receivers. You can reach him via e-mail at <a href="mailto:mbarr@netrino.com">mbarr@netrino.com</a> or read more of what he has to say at his blog (<a href="http://www.embeddedgurus.net/barr-code" target="new">www.embeddedgurus.net/barr-code</a>). </em></p>
<p><strong>Endnotes:</strong><br />
1. This sounds silly, but it&#8217;s true. If an individual requirement doesn&#8217;t pass the &#8220;gnome test&#8221; then it merits further rewriting.</p>
<p>2. However, we must remember that this is only a WHAT requirement. The HOW implementer may not choose to include that equation in the code and still meet the requirement. For example, a mathematical equation may be converted into a look-up table plus interpolations, which may be executed by either hardware or software (or by a gnome).</p>
<p>3. If you can&#8217;t get proper requirements from outside engineering, you may have to expend effort inside engineering translating the customer or marketing requirements you do have into a proper set of requirements for internal use.</p>
<p>4. With the exception of anything involving plumbing, which is almost as hard to change as the supporting columns.</p>
<p>5. Non-drinkers may prefer the phrase &#8220;30,000 foot view&#8221; which is the same standard.</p>
<p>6. To give an extreme example, marketing can have engineering add the game &#8220;Pong&#8221; in a low-priority task running on the ventilator without affecting patient safety.</p>
<p>7. The system tests should treat the firmware as a black box. In fact, they would ideally be structured at the &#8220;gnome level.&#8221;</p>
<p>8. Proponents of test-driven development advocate that tests at this level be written in advance of the functions or classes that they are intended to verify.</p>
<p>9. But isn&#8217;t it always true that testing real-time behaviors intrusively is an oxymoron?</p>
</div>
</div>
</div>
</div>
</div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/paritycheck.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/paritycheck.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/paritycheck.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/paritycheck.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/paritycheck.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/paritycheck.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/paritycheck.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/paritycheck.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/paritycheck.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/paritycheck.wordpress.com/155/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=155&subd=paritycheck&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://paritycheck.wordpress.com/2009/11/13/firmware-architecture-in-five-easy-steps-by-michael-barr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f5edc904502b22659fc5a7c579175cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">paritycheck</media:title>
		</media:content>

		<media:content url="http://i.cmpnet.com/embedded/2009/0909_Sept2009/0909embBarr01sm.gif" medium="image" />

		<media:content url="http://i.cmpnet.com/embedded/2009/0909_Sept2009/0909embBarr02sm.gif" medium="image" />
	</item>
		<item>
		<title>Windows XP &#8211; Tracking System Performance, Useful log counters</title>
		<link>http://paritycheck.wordpress.com/2009/11/04/windows-xp-tracking-system-performance-useful-log-counters/</link>
		<comments>http://paritycheck.wordpress.com/2009/11/04/windows-xp-tracking-system-performance-useful-log-counters/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 19:41:48 +0000</pubDate>
		<dc:creator>paritycheck</dc:creator>
				<category><![CDATA[Windows XP]]></category>

		<guid isPermaLink="false">http://paritycheck.wordpress.com/?p=142</guid>
		<description><![CDATA[After running perfmon from Start-&#62;Run
Memory:Pages/sec
Number of pages read from disk or written to disk when Windows runs out of memory.  Swapping information to and from the disk can slow down your system a lot.  Consider adding more memory if you see frequency swapping.
PhysicalDisk:Avg. Disk Queue Length
How many read and write requests are waiting for the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=142&subd=paritycheck&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>After running <em>perfmon </em>from Start-&gt;Run</p>
<p><strong>Memory:Pages/sec</strong></p>
<p>Number of pages read from disk or written to disk when Windows runs out of memory.  Swapping information to and from the disk can slow down your system a lot.  Consider adding more memory if you see frequency swapping.</p>
<p><strong>PhysicalDisk:Avg. Disk Queue Length</strong></p>
<p>How many read and write requests are waiting for the disk to respond.  High numbers indicate that a faster disk drive would speed up performance.</p>
<p><strong>PhysicalDisk:% Disk Time</strong></p>
<p>What percentage of the time the disk was busy.  This is another indicator of a slow or overloaded disk.</p>
<p><strong>Processor:% Processor Time</strong></p>
<p>What percentage of the time the processor was busy with all types of processes.  This counter can tell you whether delays are caused by an overloaded CPU.</p>
<p><em>Originally sourced from <strong>Windows XP Cookbook, Robbie Allen &amp; Preston Gralla</strong></em></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/paritycheck.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/paritycheck.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/paritycheck.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/paritycheck.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/paritycheck.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/paritycheck.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/paritycheck.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/paritycheck.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/paritycheck.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/paritycheck.wordpress.com/142/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=142&subd=paritycheck&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://paritycheck.wordpress.com/2009/11/04/windows-xp-tracking-system-performance-useful-log-counters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f5edc904502b22659fc5a7c579175cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">paritycheck</media:title>
		</media:content>
	</item>
		<item>
		<title>What is an Open-Collector/Open-Drain Circuit?</title>
		<link>http://paritycheck.wordpress.com/2009/11/03/what-is-an-open-collectoropen-drain-circuit/</link>
		<comments>http://paritycheck.wordpress.com/2009/11/03/what-is-an-open-collectoropen-drain-circuit/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 16:15:48 +0000</pubDate>
		<dc:creator>paritycheck</dc:creator>
				<category><![CDATA[ASIC Design]]></category>
		<category><![CDATA[Embedded Design]]></category>

		<guid isPermaLink="false">http://paritycheck.wordpress.com/?p=140</guid>
		<description><![CDATA[ Open-collector/open-drain is a circuit technique which allows multiple devices to communicate bi-directionally on a single wire.
Open-collector/open-drain devices sink (flow) current in their low voltage active (logic 0) state, or are high impedance (no current flows) in their high voltage non-active (logic 1) state. These devices usually operate with an external pull-up resistor that holds the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=140&subd=paritycheck&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p> Open-collector/open-drain is a circuit technique which allows multiple devices to communicate bi-directionally on a single wire.</p>
<p>Open-collector/open-drain devices sink (flow) current in their low voltage active (logic 0) state, or are high impedance (no current flows) in their high voltage non-active (logic 1) state. These devices usually operate with an external pull-up resistor that holds the signal line high until a device on the wire sinks enough current to pull the line low. Many devices can be attached to the signal wire. If all devices attached to the wire are in their non-active state, the pull-up will hold the wire at a high voltage. If one or more devices are in the active state, the signal wire voltage will be low.</p>
<p>An open-collector/open-drain signal wire can also be bi-directional. Bi-directional means that a device can both output and input a signal on the wire at the same time. In addition to controlling the state of its pin that is connected to the signal wire (active, or non-active), a device can also sense the voltage level of the signal wire. Although the output of a open-collecter/open-drain device may be in the non-active (high) state, the wire attached to the device may be in the active (low) state, due to activity of another device attached to the wire.</p>
<p>The bi-directional nature of an open-collector/open-drain device is what makes this circuit so important in interconnecting many devices on a common line. The I2C Bus and SMBus uses this technique for connecting up to 127 devices.</p>
<p>Open-drain refers to the drain terminal of a MOS FET transistor. Open-collector is the same concept on a bipolar device.</p>
<p>sourced from <a href="http://www.mcc-us.com/Open-collectorFAQ.htm">http://www.mcc-us.com/Open-collectorFAQ.htm</a></p>
<p>&nbsp;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/paritycheck.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/paritycheck.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/paritycheck.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/paritycheck.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/paritycheck.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/paritycheck.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/paritycheck.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/paritycheck.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/paritycheck.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/paritycheck.wordpress.com/140/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=140&subd=paritycheck&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://paritycheck.wordpress.com/2009/11/03/what-is-an-open-collectoropen-drain-circuit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f5edc904502b22659fc5a7c579175cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">paritycheck</media:title>
		</media:content>
	</item>
		<item>
		<title>converting ppm to frequency</title>
		<link>http://paritycheck.wordpress.com/2009/10/03/converting-ppm-to-frequency/</link>
		<comments>http://paritycheck.wordpress.com/2009/10/03/converting-ppm-to-frequency/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 13:42:24 +0000</pubDate>
		<dc:creator>paritycheck</dc:creator>
				<category><![CDATA[ASIC Design]]></category>
		<category><![CDATA[Embedded Design]]></category>

		<guid isPermaLink="false">http://paritycheck.wordpress.com/?p=138</guid>
		<description><![CDATA[Oscillators and other frequency control devices specify their frequency variation in units of parts per million (ppm).  The equation for this relationship is,
delta_frequency = (f x ppm)/ 10^6
where ppm is the peak variation (expressed as +/-),f is the center frequency (in Hz), and delta_frequency is the peak frequency variation (in Hz).
For example, 100 ppm of 100 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=138&subd=paritycheck&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Oscillators and other frequency control devices specify their frequency variation in units of parts per million (ppm).  The equation for this relationship is,</p>
<p>delta_frequency = (f x ppm)/ 10^6</p>
<p>where ppm is the peak variation (expressed as +/-),f is the center frequency (in Hz), and delta_frequency is the peak frequency variation (in Hz).</p>
<p>For example, 100 ppm of 100 MHz represents a variation in frequency(delta_frequency) of 10 kHz.  The maximum and minimum frequencies are therefore 100.01 and 99.99 MHz, respectively.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/paritycheck.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/paritycheck.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/paritycheck.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/paritycheck.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/paritycheck.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/paritycheck.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/paritycheck.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/paritycheck.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/paritycheck.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/paritycheck.wordpress.com/138/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=138&subd=paritycheck&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://paritycheck.wordpress.com/2009/10/03/converting-ppm-to-frequency/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f5edc904502b22659fc5a7c579175cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">paritycheck</media:title>
		</media:content>
	</item>
		<item>
		<title>Storage rules for C variables</title>
		<link>http://paritycheck.wordpress.com/2009/04/01/storage-rules-for-c-variables/</link>
		<comments>http://paritycheck.wordpress.com/2009/04/01/storage-rules-for-c-variables/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 13:59:00 +0000</pubDate>
		<dc:creator>paritycheck</dc:creator>
				<category><![CDATA[Embedded Design]]></category>

		<guid isPermaLink="false">http://paritycheck.wordpress.com/?p=134</guid>
		<description><![CDATA[
Local variables (declared within a function) are stored on the stack, provided they have not been declared with the static attribute.  
Local, non-static variables are sometimes called “automatic” variables.  (There is even a C keyword, auto, but it is almost never used in practice.)
Local variables (declared within a function) that have the static attribute are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=134&subd=paritycheck&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><ul>
<li><span style="font-family:Times New Roman;font-size:small;">Local variables (declared within a function) are stored on the stack, provided they have not been declared with the <em>static</em> attribute.<span>  </span></span></li>
<li><span style="font-family:Times New Roman;font-size:small;">Local, non-static variables are sometimes called “automatic” variables.<span>  </span>(There is even a C keyword, <em>auto</em>, but it is almost never used in practice.)</span></li>
<li><span style="font-family:Times New Roman;font-size:small;">Local variables (declared within a function) that have the <em>static</em> attribute are not stored on the stack; they have fixed addresses in memory.</span></li>
<li><span style="font-family:Times New Roman;font-size:small;">Variables with file scope (declared outside of any function) are not stored on the stack; they also have fixed addresses in memory.<span>  </span>The <em>static</em> attribute is irrelevant here (it merely affects the visibility (scope) of the variable).</span></li>
<li><span style="font-family:Times New Roman;font-size:small;">Arguments passed to a function by value are stored on the stack.<span>  </span>The calling function makes a copy of the data and makes that copy available to the called function.</span></li>
<li><span style="font-family:Times New Roman;font-size:small;">Arguments passed to a function by reference require special consideration.<span>  </span>The data pointed to by the reference has whatever storage the variable in the calling program segment has.<span>  </span>The pointer itself (being passed to the function) is on the stack.</span></li>
</ul>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/paritycheck.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/paritycheck.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/paritycheck.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/paritycheck.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/paritycheck.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/paritycheck.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/paritycheck.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/paritycheck.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/paritycheck.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/paritycheck.wordpress.com/134/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=134&subd=paritycheck&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://paritycheck.wordpress.com/2009/04/01/storage-rules-for-c-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f5edc904502b22659fc5a7c579175cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">paritycheck</media:title>
		</media:content>
	</item>
		<item>
		<title>What does this mean? (*(volatile unsigned char *)(0&#215;22))</title>
		<link>http://paritycheck.wordpress.com/2009/03/27/what-does-this-mean-volatile-unsigned-char-0x22/</link>
		<comments>http://paritycheck.wordpress.com/2009/03/27/what-does-this-mean-volatile-unsigned-char-0x22/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 06:08:26 +0000</pubDate>
		<dc:creator>paritycheck</dc:creator>
				<category><![CDATA[Embedded Design]]></category>

		<guid isPermaLink="false">http://paritycheck.wordpress.com/?p=122</guid>
		<description><![CDATA[Using C, I was trying to assign a variable name to a register address so that my code would be readable.  An example of how to do this is as follows:
#define DDRA (*(volatile unsigned char *)(0x22))
This means that if a register or memory location exists at address 0&#215;22, I can use DDRA to read [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=122&subd=paritycheck&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Using C, I was trying to assign a variable name to a register address so that my code would be readable.  An example of how to do this is as follows:</p>
<p><code>#define DDRA (*(volatile unsigned char *)(0x22))</code></p>
<p>This means that if a register or memory location exists at address 0&#215;22, I can use <em>DDRA</em> to read or write to it like so..</p>
<p><code>DDRA = 0x05</code></p>
<p>in my C code.</p>
<p>The <em>#define</em> looks really cryptic at first.  The way to understand this is by breaking it down into pieces.</p>
<p>First of all,</p>
<p><code>unsigned char</code></p>
<p>means we are using a byte-sized memory location.  Byte being 8-bits wide.</p>
<p><code>unsigned char *</code></p>
<p>means we are declaring a pointer that points to a byte-sized location.</p>
<p><code>(unsigned char *) (0x22)</code></p>
<p>means the byte-sized pointer points to address 0&#215;22.  The C compiler will refer to address 0&#215;22 when the variable DDRA is used.  The assembly code will end up using 0&#215;22 in Load(LD) and Store (STR) insturctions.</p>
<p><code>(*(unsigned char *)(0x22))</code></p>
<p>The first asterisk from the left signifies that we want to manipulate the value in address 0&#215;22.  * means &#8220;the value pointed to by the pointer&#8221;.</p>
<p><code>volatile</code></p>
<p>volatile forces the compiler to issue a Load or Store anytime DDRA is accessed as the value may change without the compiler knowing it.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/paritycheck.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/paritycheck.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/paritycheck.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/paritycheck.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/paritycheck.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/paritycheck.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/paritycheck.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/paritycheck.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/paritycheck.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/paritycheck.wordpress.com/122/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=122&subd=paritycheck&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://paritycheck.wordpress.com/2009/03/27/what-does-this-mean-volatile-unsigned-char-0x22/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f5edc904502b22659fc5a7c579175cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">paritycheck</media:title>
		</media:content>
	</item>
		<item>
		<title>Keeping Your Job Onshore by Dan Saks</title>
		<link>http://paritycheck.wordpress.com/2009/03/25/keeping-your-job-onshore-by-dan-saks/</link>
		<comments>http://paritycheck.wordpress.com/2009/03/25/keeping-your-job-onshore-by-dan-saks/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 13:59:42 +0000</pubDate>
		<dc:creator>paritycheck</dc:creator>
				<category><![CDATA[ASIC Design]]></category>
		<category><![CDATA[Embedded Design]]></category>

		<guid isPermaLink="false">http://paritycheck.wordpress.com/?p=115</guid>
		<description><![CDATA[keeping-your-job-onshore
For ASIC designers whose jobs are being outsourced, 3 steps to Professional Success

Choose to do what you love
Sharpen your communication skills
Expand your professional tool set, and master the tools most crucial to your work

       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=115&subd=paritycheck&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://paritycheck.files.wordpress.com/2009/03/keeping-your-job-onshore.pdf">keeping-your-job-onshore</a></p>
<p>For ASIC designers whose jobs are being outsourced, 3 steps to Professional Success</p>
<ol>
<li>Choose to do what you love</li>
<li>Sharpen your communication skills</li>
<li>Expand your professional tool set, and master the tools most crucial to your work</li>
</ol>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/paritycheck.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/paritycheck.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/paritycheck.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/paritycheck.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/paritycheck.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/paritycheck.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/paritycheck.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/paritycheck.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/paritycheck.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/paritycheck.wordpress.com/115/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=115&subd=paritycheck&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://paritycheck.wordpress.com/2009/03/25/keeping-your-job-onshore-by-dan-saks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f5edc904502b22659fc5a7c579175cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">paritycheck</media:title>
		</media:content>
	</item>
		<item>
		<title>Decoding Ethernet Operational modes</title>
		<link>http://paritycheck.wordpress.com/2009/03/23/decoding-ethernet-variants/</link>
		<comments>http://paritycheck.wordpress.com/2009/03/23/decoding-ethernet-variants/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 05:25:18 +0000</pubDate>
		<dc:creator>paritycheck</dc:creator>
				<category><![CDATA[ASIC Design]]></category>

		<guid isPermaLink="false">http://paritycheck.wordpress.com/?p=111</guid>
		<description><![CDATA[Being new to Ethernet, I easily get confused when it comes to all the different link modes.  Here is my cheatsheet:

40 GE KR4 = 1 port composed of 4 lanes, each running at 10 G.
10 GE KR = 1 port composed of 1 lane running at 10 G
10 GE KX4 = 1 port composed of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=111&subd=paritycheck&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Being new to Ethernet, I easily get confused when it comes to all the different link modes.  Here is my cheatsheet:</p>
<ul>
<li>40 GE KR4 = 1 port composed of 4 lanes, each running at 10 G.</li>
<li>10 GE KR = 1 port composed of 1 lane running at 10 G</li>
<li>10 GE KX4 = 1 port composed of 4 lanes, each running at 3.125 G.  Also known as running 4 XAUI lanes)</li>
<li>1 GE KX = 1 port composed of 1 lane running at 1 G.</li>
</ul>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/paritycheck.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/paritycheck.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/paritycheck.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/paritycheck.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/paritycheck.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/paritycheck.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/paritycheck.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/paritycheck.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/paritycheck.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/paritycheck.wordpress.com/111/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=111&subd=paritycheck&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://paritycheck.wordpress.com/2009/03/23/decoding-ethernet-variants/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f5edc904502b22659fc5a7c579175cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">paritycheck</media:title>
		</media:content>
	</item>
		<item>
		<title>for(;;) vs while(1) loop</title>
		<link>http://paritycheck.wordpress.com/2009/03/21/for-vs-while1-loop/</link>
		<comments>http://paritycheck.wordpress.com/2009/03/21/for-vs-while1-loop/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 11:51:30 +0000</pubDate>
		<dc:creator>paritycheck</dc:creator>
				<category><![CDATA[Embedded Design]]></category>

		<guid isPermaLink="false">http://paritycheck.wordpress.com/?p=88</guid>
		<description><![CDATA[I was taking an extension class and the instructor briefly mentioned that in the main  C loop, a for(;;) loop was much more efficient than a while(1) loop.  I didn&#8217;t pay too much attention to the statement at the time but it was always in the back of my mind.  Now, I&#8217;ve tried a simple experiment to see [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=88&subd=paritycheck&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I was taking an extension class and the instructor briefly mentioned that in the <em>main  </em>C<em> </em>loop, a <em>for(;;)</em> loop was much more efficient than a <em>while(1)</em> loop.  I didn&#8217;t pay too much attention to the statement at the time but it was always in the back of my mind.  Now, I&#8217;ve tried a simple experiment to see if there is a difference.  I created two small programs that simply increments one of the Atmel AVR&#8217;s internal registers.  One version uses the <em>for(;;)</em> construct, the other uses the <em>while(1) </em>construct.</p>
<p>Here is the C code using a while loop</p>
<pre class="brush: cpp;">
#define DDRA (*(volatile unsigned char *)(0x22))

int main()
{

 DDRA = 0xff;
 
 while(1)
 {
  DDRA = DDRA + 1;
 }

}
</pre>
<p>Here is the C code using a for loop</p>
<pre class="brush: cpp;">
#define DDRA (*(volatile unsigned char *)(0x22))

int main()
{

 DDRA = 0xff;
 
 //while(1)
 for(;;)
 {
  DDRA = DDRA + 1;
 }

}
</pre>
<p>Using AVR Studio, the GCC compiler generates the following assembly code when while(1) is used.</p>
<pre class="brush: cpp;">

learningC.elf:     file format elf32-avr
Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00000082  00000000  00000000  00000054  2**1
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .debug_aranges 00000020  00000000  00000000  000000d6  2**0
                  CONTENTS, READONLY, DEBUGGING
  2 .debug_pubnames 0000001b  00000000  00000000  000000f6  2**0
                  CONTENTS, READONLY, DEBUGGING
  3 .debug_info   00000044  00000000  00000000  00000111  2**0
                  CONTENTS, READONLY, DEBUGGING
  4 .debug_abbrev 00000034  00000000  00000000  00000155  2**0
                  CONTENTS, READONLY, DEBUGGING
  5 .debug_line   0000006b  00000000  00000000  00000189  2**0
                  CONTENTS, READONLY, DEBUGGING
  6 .debug_frame  00000020  00000000  00000000  000001f4  2**2
                  CONTENTS, READONLY, DEBUGGING
  7 .debug_str    0000006e  00000000  00000000  00000214  2**0
                  CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:
00000000 &lt;__vectors&gt;:
   0: 0c 94 2e 00  jmp 0x5c ; 0x5c &lt;__ctors_end&gt;
   4: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
   8: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
   c: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  10: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  14: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  18: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  1c: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  20: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  24: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  28: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  2c: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  30: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  34: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  38: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  3c: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  40: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  44: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  48: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  4c: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  50: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  54: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  58: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
0000005c &lt;__ctors_end&gt;:
  5c: 11 24        eor r1, r1
  5e: 1f be        out 0x3f, r1 ; 63
  60: cf ef        ldi r28, 0xFF ; 255
  62: d4 e0        ldi r29, 0x04 ; 4
  64: de bf        out 0x3e, r29 ; 62
  66: cd bf        out 0x3d, r28 ; 61
  68: 0e 94 3a 00  call 0x74 ; 0x74 &lt;main&gt;
  6c: 0c 94 3f 00  jmp 0x7e ; 0x7e &lt;_exit&gt;
00000070 &lt;__bad_interrupt&gt;:
  70: 0c 94 00 00  jmp 0 ; 0x0 &lt;__vectors&gt;
00000074 &lt;main&gt;:
#define DDRA (*(volatile unsigned char *)(0x22))
int main()
{
 DDRA = 0xff;
  74: 8f ef        ldi r24, 0xFF ; 255
  76: 82 b9        out 0x02, r24 ; 2
 
 while(1)
 {
  DDRA = DDRA + 1;
  78: 82 b1        in r24, 0x02 ; 2
  7a: 8f 5f        subi r24, 0xFF ; 255
  7c: fc cf        rjmp .-8       ; 0x76 &lt;main+0x2&gt;
0000007e &lt;_exit&gt;:
  7e: f8 94        cli
00000080 &lt;__stop_program&gt;:
  80: ff cf        rjmp .-2       ; 0x80 &lt;__stop_program&gt;
</pre>
<p>Using the same tools (AVR Studio and GCC), the compiler generates the following assembly code when for(;;) is used.</p>
<pre class="brush: cpp;">

learningC.elf:     file format elf32-avr
Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00000082  00000000  00000000  00000054  2**1
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .debug_aranges 00000020  00000000  00000000  000000d6  2**0
                  CONTENTS, READONLY, DEBUGGING
  2 .debug_pubnames 0000001b  00000000  00000000  000000f6  2**0
                  CONTENTS, READONLY, DEBUGGING
  3 .debug_info   00000044  00000000  00000000  00000111  2**0
                  CONTENTS, READONLY, DEBUGGING
  4 .debug_abbrev 00000034  00000000  00000000  00000155  2**0
                  CONTENTS, READONLY, DEBUGGING
  5 .debug_line   0000006b  00000000  00000000  00000189  2**0
                  CONTENTS, READONLY, DEBUGGING
  6 .debug_frame  00000020  00000000  00000000  000001f4  2**2
                  CONTENTS, READONLY, DEBUGGING
  7 .debug_str    0000006e  00000000  00000000  00000214  2**0
                  CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:
00000000 &lt;__vectors&gt;:
   0: 0c 94 2e 00  jmp 0x5c ; 0x5c &lt;__ctors_end&gt;
   4: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
   8: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
   c: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  10: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  14: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  18: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  1c: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  20: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  24: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  28: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  2c: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  30: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  34: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  38: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  3c: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  40: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  44: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  48: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  4c: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  50: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  54: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
  58: 0c 94 38 00  jmp 0x70 ; 0x70 &lt;__bad_interrupt&gt;
0000005c &lt;__ctors_end&gt;:
  5c: 11 24        eor r1, r1
  5e: 1f be        out 0x3f, r1 ; 63
  60: cf ef        ldi r28, 0xFF ; 255
  62: d4 e0        ldi r29, 0x04 ; 4
  64: de bf        out 0x3e, r29 ; 62
  66: cd bf        out 0x3d, r28 ; 61
  68: 0e 94 3a 00  call 0x74 ; 0x74 &lt;main&gt;
  6c: 0c 94 3f 00  jmp 0x7e ; 0x7e &lt;_exit&gt;
00000070 &lt;__bad_interrupt&gt;:
  70: 0c 94 00 00  jmp 0 ; 0x0 &lt;__vectors&gt;
00000074 &lt;main&gt;:
#define DDRA (*(volatile unsigned char *)(0x22))
int main()
{
 DDRA = 0xff;
  74: 8f ef        ldi r24, 0xFF ; 255
  76: 82 b9        out 0x02, r24 ; 2
 
 //while(1)
 for(;;)
 {
  DDRA = DDRA + 1;
  78: 82 b1        in r24, 0x02 ; 2
  7a: 8f 5f        subi r24, 0xFF ; 255
  7c: fc cf        rjmp .-8       ; 0x76 &lt;main+0x2&gt;
0000007e &lt;_exit&gt;:
  7e: f8 94        cli
00000080 &lt;__stop_program&gt;:
  80: ff cf        rjmp .-2       ; 0x80 &lt;__stop_program&gt;
</pre>
<p>If you look carefully, the only difference in the .lss files are lines 65 and 66.  These lines simply show whether a <em>for</em> or <em>while</em> was used for the loop.   To summarize, there is no difference. Ofcourse, C compilers may vary.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/paritycheck.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/paritycheck.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/paritycheck.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/paritycheck.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/paritycheck.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/paritycheck.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/paritycheck.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/paritycheck.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/paritycheck.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/paritycheck.wordpress.com/88/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=88&subd=paritycheck&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://paritycheck.wordpress.com/2009/03/21/for-vs-while1-loop/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f5edc904502b22659fc5a7c579175cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">paritycheck</media:title>
		</media:content>
	</item>
		<item>
		<title>Alan Wong&#8217;s Restaurant, Oahu, Hawaii</title>
		<link>http://paritycheck.wordpress.com/2009/02/24/alan-wongs-restaurant-oahu-hawaii/</link>
		<comments>http://paritycheck.wordpress.com/2009/02/24/alan-wongs-restaurant-oahu-hawaii/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 06:08:23 +0000</pubDate>
		<dc:creator>paritycheck</dc:creator>
				<category><![CDATA[Travel Reviews]]></category>

		<guid isPermaLink="false">http://paritycheck.wordpress.com/?p=80</guid>
		<description><![CDATA[Blogs are interesting.  When I first decided to create a blog, I decided that my focus would be strictly on all things related to chip design.  That is, anything that I found useful throughout my career that I felt compelled to share with other ASIC designers.  I&#8217;m realizing that, at times, I want to share more than that.  I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=80&subd=paritycheck&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Blogs are interesting.  When I first decided to create a blog, I decided that my focus would be strictly on all things related to chip design.  That is, anything that I found useful throughout my career that I felt compelled to share with other ASIC designers.  I&#8217;m realizing that, at times, I want to share more than that.  I find blogging a great medium for relaying any useful tidbits that I&#8217;ve learned in my life that would help my fellow human being &#8211; ranging from the chip designer, the CVS user, or even the casual restaurant diner.</p>
<p>However, it just doesn&#8217;t seem right to veer from the original intent of the blog which was to provide useful tips to chip designers.  So, to stay somewhat on course, I use the NAND gate rating scheme.</p>
<p>2 NAND gates out of 5 (5 NAND gates being best).</p>
<p> <img class="alignnone size-full wp-image-19" src="http://paritycheck.files.wordpress.com/2007/07/nandstar.png?w=37&#038;h=70" alt="" width="37" height="70" /><img class="alignnone size-full wp-image-19" title="nandstar" src="http://paritycheck.files.wordpress.com/2007/07/nandstar.png?w=37&#038;h=70" alt="nandstar" width="37" height="70" /><img class="alignnone size-full wp-image-21" title="nandstarinv" src="http://paritycheck.files.wordpress.com/2007/07/nandstarinv.png?w=37&#038;h=70" alt="nandstarinv" width="37" height="70" /><img class="alignnone size-full wp-image-21" title="nandstarinv" src="http://paritycheck.files.wordpress.com/2007/07/nandstarinv.png?w=37&#038;h=70" alt="nandstarinv" width="37" height="70" /><img class="alignnone size-full wp-image-21" title="nandstarinv" src="http://paritycheck.files.wordpress.com/2007/07/nandstarinv.png?w=37&#038;h=70" alt="nandstarinv" width="37" height="70" /></p>
<p>Subject: Alan Wong&#8217;s Restaurant</p>
<p>Location: Honolulu, Oahu, Hawaii, United States, North America</p>
<p>Title: dessert was very good, overall mediocre</p>
<p>My wife and I ate at Alan Wong&#8217;s on Jan 19, 2009. Here is our experience&#8230;</p>
<p>We are Southern California locals that had a tough time finding the place even when using a Garmin Nuvi 265W GPS. We were sort of surprised since we had read reviews that this was a highly rated restaurant that won so many awards located at such a mediocre neighborhood. It turns out the restaurant is on the 3rd floor of a business building. Odd considering that Oahu has so many great views of the ocean and mountains,..why would a restaurant owner locate a supposedly highly rated restaurant in a decrepid neighborhood?</p>
<p>Okay, so we finally find the place and valet parking is required ($3.00) in a teeny tiny parking garage.</p>
<p>We made our reservation two nights ago and we arrived on the dot. The hostess was unkempt,.. her shoe heel straps weren&#8217;t even on, hair stringy and messy. (Gee guys, keep your eye on the details).</p>
<p>We were finally seated. I do have to say that once inside, the restaurant looks great. Lighting, seating arrangement,.. the whole look of the room design is superb.</p>
<p>My first complaint is this,&#8230; it just seemed like the waiters were not professional at all. Our main waiter was so.. robotic. No smile, no &#8220;how are you doing?&#8221;, No explanation of the dishes, how they are prepared, what makes them taste so good, etc. The menu itself doesn&#8217;t describe the dishes well enough. But, then I realized, it is because the food is so mediocre (more on that later).</p>
<p>I ordered the Ginger Crusted Onaga for $35.00. It comes with Hamakua mushrooms, sesame vinagrette, and (of all things) corn.</p>
<p>I thought to myself. &#8220;Gee, corn is so common, why am I going to pay $35.00 for some corn with my seafood. Hmm, unless they found a fancy way to prepare it. Okay, I&#8217;ll try it&#8221;.</p>
<p>If this chef won awards on corn+seafood, he must be really creative. Finally we placed our order with our robot waiter. Wouldn&#8217;t you know it, the menu doesn&#8217;t even tell you that you have a choice of mashed potatoes, white rice, or brown rice.</p>
<p>I thought again,..&#8221;Mashed potatoes?.. nothing fancy about that, right? Unless, the chef is really creative,.. then maybe&#8230;.Okay, I&#8217;ll try it&#8221;</p>
<p>We also ordered the Asparagus appetizer. And waited for the food to come&#8230; We were served the Asparagus appetizer,&#8230; it came with 5-6 asparagus stems + tops,.. with a sauce that was laid on the center of all of them. It was served by another waiter..not the robot one. She seemed like she knew the info for the dish but was really ditzy.</p>
<p>So ditzy that when she asked whether we wanted pepper on our appetizer and we said &#8220;No thanks&#8221;.. she still put pepper on our dish.. and a lot of it over 5-6 Asparagus. We just let it go,&#8230; didn&#8217;t want her to screw something up again,.. and besides we were hungry.</p>
<p>Then, the main dish arrives. Basically, a fish on top of mushrooms and corn. Guess what? Nothing really creative about the corn. It was simply corn. The fish was topped with a ginger and spicing &#8211; that was tasty. The mushrooms tasted good, too. But, I just couldn&#8217;t understand why mix the Haukama mushrooms, the ginger, the fish,.. (all exotic).. with corn.</p>
<p>Then, the next thing that irks me is that, they served the mashed potatoes, slightly later than the main dish, and it was really hot. It was so hot that I nearly burned my tongue. I had to eat the fish first,in its entirety, so that the potatoes could cool down.</p>
<p>Message to the restaurant,.. &#8220;Why don&#8217;t you time the delivery of the dishes so they come out together at the right temperature?&#8221;.</p>
<p>And, finally, we had dessert. This is the one main thing I really liked about Alan Wong&#8217;s. I don&#8217;t remember the exact name of the dessert but it was a goat cheese sorbet with a strawberry and hibiscus sauce. This tasted very good.</p>
<p>I think I&#8217;ve wrote enough and I hope you find this helpful. To summarize, the dessert was great, the interior design of the restaurant looked top notch. The downsides were the waiters, the main dish, and finding the place. This is why I gave it two gates.</p>
<p>This was originally posted at <a href="http://www.tripadvisor.com/">www.tripadvisor.com</a>.  But, they decided not to post it.  They filter their reviews and are biased to positive reviews.</p>
<p>Good luck!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/paritycheck.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/paritycheck.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/paritycheck.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/paritycheck.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/paritycheck.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/paritycheck.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/paritycheck.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/paritycheck.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/paritycheck.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/paritycheck.wordpress.com/80/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=paritycheck.wordpress.com&blog=1233064&post=80&subd=paritycheck&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://paritycheck.wordpress.com/2009/02/24/alan-wongs-restaurant-oahu-hawaii/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f5edc904502b22659fc5a7c579175cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">paritycheck</media:title>
		</media:content>

		<media:content url="http://paritycheck.files.wordpress.com/2007/07/nandstar.png" medium="image" />

		<media:content url="http://paritycheck.files.wordpress.com/2007/07/nandstar.png" medium="image">
			<media:title type="html">nandstar</media:title>
		</media:content>

		<media:content url="http://paritycheck.files.wordpress.com/2007/07/nandstarinv.png" medium="image">
			<media:title type="html">nandstarinv</media:title>
		</media:content>

		<media:content url="http://paritycheck.files.wordpress.com/2007/07/nandstarinv.png" medium="image">
			<media:title type="html">nandstarinv</media:title>
		</media:content>

		<media:content url="http://paritycheck.files.wordpress.com/2007/07/nandstarinv.png" medium="image">
			<media:title type="html">nandstarinv</media:title>
		</media:content>
	</item>
	</channel>
</rss>