# Assignment 4
## Task 1: Arbitration of CAN frames
The CAN bus is a fairly widespread protocol used for communication between embedded systems, used in the automotive and the avionics domain. CAN uses a scheme called arbitration to implement [CSMA/CR](https://en.wikipedia.org/wiki/Carrier-sense_multiple_access).
Two devices on the same CAN bus try to each send a base frame at the same time. Their respective frame IDs are `1111110100` and `1111001011` (both numbers are MSB left). Create a Timing Diagram which shows how CSMA/CR resolves this situation. Your Diagram should contain distinct timelines both for the level on the bus and the level emitted by each device. Annotate when and why the arbitration process prioritizes one frame over the other.
## Task 2: Temporal Arrangement of Partitions
Familiarize yourself with the concept of a [Separation Kernel](https://en.wikipedia.org/wiki/Separation_kernel), then consider the following repository [aeronautical-informatics/ske-bdd-taws-demonstrator](https://github.com/aeronautical-informatics/ske-bdd-taws-demonstrator). It contains a configuration for the XNG separation kernel. Somewhere in it you will find a file which specifies which partition is ran when. Create a Timing Diagram which documents acurately at least one major cycle. Assume the time of a context switch to be 1 ms.
Make your resulting diagram concise and clean. Also consider how you can communicate the duration of a major timeframe in a non obstructive yet clear way.
__Hint:__ Don't ask us where you can find the file.
## Task 3: State Diagram
Install the flightgear simulator. Run the simulator with the default plane, a Cessna 172P Skyhawk. Describe the sequence starting the engine unsing a state diagram. Use the cross product out of Magnetos (Both on/Both off), Alternator (on/off), Battery (on/off), Primer (not primed/primed 3 times) and Engine Starter (on/off). Assume throttle and mixture to be correctly set during the whol process. The deliverable here is your state diagram.