"performance of a switch-case compared to an IF statement?" You have to see how the compiler built the switch statement, it could be a sorted table, it could be sequectials, it could be just a bunch of ifs. if you have a few or alot of things, "if" can be prioritized how you want them. the switch case will be redone by the compiler and put into different orders than you have in the switch statement.
FSMs and Petri-Nets are great abstractions for logic/sequential machinery, which most control/reactive systems are. There are some automatic code generation tools out there. IAR Visual State does a pretty good job.
Hi all -Audio is live! If you don't see the audio bar at the top of the screen, please refresh your browser. It may take a couple tries. When you see the audio bar, hit the play button. If you experience audio interruptions and are using IE, try using FF or Chrome as your browser. Many people experience issues with IE. Also, make sure your flash player is updated with the current version. Some companies block live audio streams, so if that is the case for your company, the class will be archived on this page immediately following the class and you can listen then. People don't experience any issues with the audio for the archived version.
When cases for a switch statement are contiguous (like the state machine IDs # define, or I like to use enums) many C compilers convert it to a quick vectored lookup table branch, like pointers usage and therefore same time regardless of state. This keeps the debuggable/readable single-steppable switch/case form and yet runs efficiently. Only a crude C compiler would implement it as series of chained if/then/elseif/else decision forks. That's why I usually use an enumeration for state ID codes so they are sequentially assigned.
-The streaming audio player will appear on this web page when the show starts at 2 PM Eastern time today. Note however that some companies block live audio streams. If when the show starts you don't hear any audio, try refreshing your browser. If that doesn't work, try using Firefox or Google Chrome as your browser. Some users experience audio interruptions with IE. If that doesn't work, the class will be archived immediately following our live taping.
I'm doing a similar project at the moment but slightly more complicated.
It has 16x2 HD44780 LCD, 16 key matrix keypad, RTC chip DS1307 to display time and date, a solenoid valve to turn water on or off and a flow meter to measure quantity of water flow and a serial printer to print report.
Need to be able to adjust time and enter qty of water to pass, display both final and instantaneous water flow on LCD as well as date and time. I have finished the hardware using PIC16F876A and in the middle of software. I'm doing it using state machines while counting flow meter pulses through 16 bit timer1 as a counter with external clock.
In many engineering workplaces, there’s a generational conflict between recent engineering graduates and older, more experienced engineers. However, a recent study published in the psychology journal Cognition suggests that both may have something to learn from another group: 4 year olds.
Conventional wisdom holds that MIT, Cal Tech, and Stanford are three of the country’s best undergraduate engineering schools. Unfortunately, when conventional wisdom visits the topic of best engineering schools, it too often leaves out some of the most distinguished programs that don’t happen to offer PhD-level degrees.
Focus on Fundamentals consists of 45-minute on-line classes that cover a host of technologies. You learn without leaving the comfort of your desk. All classes are taught by subject-matter experts and all are archived. So if you can't attend live, attend at your convenience.