````

Difference between Analog and Digital circuit


Analog Circuits

  1. These circuits operate on continuous-valued signals(commonly referred to as analog signals).                    
  2. Analog circuits are difficult to design since each component has to be placed by hand as automation techniques for designing these circuits fail to do the job efficiently.
  3. No conversion of input signals are required before processing i.e. input signal is analog, the circuit directly performs various logical operations and produces an analog output.
  4. The man power available to design analog circuits is very low, this results in long time to market the finished products.
  5. Analog circuits are mostly custom made and lack flexibility. 

Digital Circuits

  1. These circuits operate on signals that exist only at two levels i.e. 0's and 1's (binary number system).
  2. On the other hand digital circuits are easy to design since automation technique can be applied at various levels of circuit design. This involves minimum human interaction.
  3. In digital circuits, the input signals are converted from analog to digital form before it is processed, i.e. the digital circuit is capable of processing digital signals only, and produces output which is again converted back from digital to analog signals so that the output gives meaning full results that can be understood by humans.
  4. The available manpower to design digital circuits is significantly large compared to that of analog circuit designers.
  5. Digital circuits have a high degree of flexibility.

Arduino - Conditional Operator ? :

The conditional operator ? : is the only ternary operator in C.

? : conditional operator Syntax

expression1 ? expression2 : expression3
Expression1 is evaluated first. If its value is true, then expression2 is evaluated and expression3 is ignored. If expression1 is evaluated as false, then expression3 evaluates and expression2 is ignored. The result will be a value of either expression2 or expression3 depending upon which of them evaluates as True.
Conditional operator associates from right to left.
Example
/* Find max(a, b): */
max = ( a > b ) ? a : b;
/* Convert small letter to capital: */
/* (no parentheses are actually necessary) */
c = ( c >= 'a' && c <= 'z' ) ? ( c - 32 ) : c;

Arduino - switch case statement

Similar to the if statements, switch...case controls the flow of programs by allowing the programmers to specify different codes that should be executed in various conditions. In particular, a switch statement compares the value of a variable to the values specified in the case statements. When a case statement is found whose value matches that of the variable, the code in that case statement is run.
The break keyword makes the switch statement exit, and is typically used at the end of each case. Without a break statement, the switch statement will continue executing the following expressions ("falling-through") until a break, or the end of the switch statement is reached.

 
Powered by Blogger