Table
SW1 |
SW2 |
SW3 |
SW4 |
Operation |
Result stored on location |
OFF |
OFF |
OFF |
OFF |
No operation |
- |
ON |
OFF |
OFF |
OFF |
Addition |
0x1FFFF100 – 0x1FFFF103 |
OFF |
ON |
OFF |
OFF |
Subtraction |
0x1FFFF104 – 0x1FFFF107 |
OFF |
OFF |
ON |
OFF |
Multiplication |
0x1FFFF108 – 0x1FFFF10F |
OFF |
OFF |
OFF |
ON |
Division |
0x1FFFF110 – 0x1FFFF113 |
Steps to implement the experiment:
1) Configure the SW1, SW2, SW3 and SW4 as an input.
2) Take the two numbers i.e. unsigned int X= 0x32, Y= 0x04.
3) Implement the switch pressed detected inclined to the operations.
4) Implement the above mentioned table and store the results to the mentioned locations.
5) Continuously check for the switch pressed. Repeat the steps 3 and 4.
No comments:
Post a Comment