EMBEDDED SYSTEMS 6

441 views
376 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
441
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

EMBEDDED SYSTEMS 6

  1. 1. LOGICAL PROGRAMMING
  2. 2. Logic Gates <ul><li>AND </li></ul><ul><li>OR </li></ul><ul><li>INVERTER </li></ul><ul><li>EX-OR </li></ul>
  3. 3. Bit wise logic <ul><li>Bit wise operator is commonly in software engineering for embedded system and control. </li></ul><ul><li>But it is very important in doing logical operations in microcontrollers. </li></ul><ul><li>And(&), Or(|), Ex-Or(^), Inverter(~), Shift Right(>>),Shift Left,(<<). These are the bitwise operator which we are going to study </li></ul>
  4. 4. AND <ul><li>AND logic is used in programming when the happening of two events should initiate an action and stop when anyone of the events fails to happen </li></ul>1 1 1 0 0 1 0 1 0 0 0 0 Output Input 2 Input
  5. 5. OR <ul><li>OR logic is used only when the non-happening of two events should stop an action and initiate it when anyone of the events happens </li></ul>1 1 1 1 0 1 1 1 0 0 0 0 Output Input 2 Input
  6. 6. INVERTER <ul><li>Inverting logic is used when the happening of an event should stop another event and vice versa. </li></ul>0 1 1 0 Output Input
  7. 7. Ex-OR <ul><li>Ex-OR logic is used when the difference in the state of two events are used to initiate an action and vice versa. </li></ul>0 1 1 1 0 1 1 1 0 0 0 0 Output Input 2 Input 1
  8. 8. Shift Right <ul><li>Shift right operator is used when we want to divide the port value by 2 . The number of times the value gets shifted is the number of times the value get divided by 2. </li></ul>
  9. 9. Shift Left <ul><li>Shift left operator is used when we want to multiply the port value by 2 . The number of times the value gets shifted is the number of times the value get multiplied by 2. </li></ul>
  10. 10. Conclusion <ul><li>Thus many of the arithmetic operations are performed logically by programming the microcontroller accordingly. </li></ul>

×