Independent student project · not affiliated with or endorsed by the Technical University of Munich (TUM)

Exam-style practice · Real-Time Sys. · München / Garching

⏱️ Real-Time Systems

Known on the timetable as "Echtzeitsysteme". Real-Time Systems (Echtzeitsysteme / IN2060 / IN8014) covers dependable and time-critical embedded computing: hard versus soft real-time constraints, clock synchronization with PTP and NTP, internal clock reasonableness and rate versus state correction, memory hierarchies and direct-mapped cache calculations, scheduling algorithms including Jackson's rule (EDD), Horn's rule (EDF), and Rate Monotonic scheduling with Liu-Layland utilization bounds, concurrency and resource protocols (PIP, HLP, PCP) to solve priority inversion, physical layer encoding, channel bit length and propagation delay, the Controller Area Network (CAN) arbitration and bit stuffing, and robust embedded C implementation.

Auf Deutsch Echtzeitsysteme Klausurtrainer · Echtzeitsysteme Klausur, Prüfung und Examen üben · BWL Klausurtrainer München

Start a run →

What the exam asks

100 questions across 7 topics: 28 calculations with freshly drawn numbers, graded within a small tolerance, and 72 concept checks - each with the worked path after you settle it.

  • Real-Time Basics & Dependability
  • Clocks & Time Synchronization (PTP)
  • Concurrency & Resource Protocols (PIP / HLP / PCP)
  • Memory Architecture & Cache Math
  • Real-Time Scheduling (Jackson / RM / EDF)
  • Real-Time Communication & CAN Bus
  • Embedded C & System Implementation

Worked examples

One solved posting per topic, with the full calculation. In the trainer the same postings come back with fresh numbers every run, so memorising these answers buys you nothing - the method is the point.

  1. Example 1 · Real-Time Basics & Dependability

    A redundant real-time communication controller exhibits a Mean Time To Failure of MTTF=1035 hours\text{MTTF} = 1035\text{ hours} and a Mean Time To Repair of MTTR=10 hours\text{MTTR} = 10\text{ hours}. Calculate the steady-state system availability AA expressed as a percentage rounded to two decimal places.

    Mean Time To Failure (MTTF)
    1035 hours
    Mean Time To Repair (MTTR)
    10 hours

    Answer: 99.04 %

    Solution: System availability AA is the ratio of operational uptime to total time: A=MTTFMTTF+MTTR=10351035+10=10351045≈0.9904=99.04%A = \frac{\text{MTTF}}{\text{MTTF} + \text{MTTR}} = \frac{1035}{1035 + 10} = \frac{1035}{1045} \approx 0.9904 = 99.04\%.

  2. Example 2 · Clocks & Time Synchronization (PTP)

    In a distributed real-time network, two nodes have internally synchronized clocks adhering to Kopetz's reasonableness condition with a macrotick granularity g=3 msg = 3\text{ ms}. If both clocks report the exact same timestamp for two separate physical events (Δt=0 macroticks\Delta t = 0\text{ macroticks}), what is the upper bound on the physical time difference (in ms\text{ms}) that could separate these two events? Give your answer as the strict supremum value.

    Macrotick granularity g
    3 ms
    Reported time difference Δt
    0 macroticks

    Answer: 6.00 ms

    Solution: Under the reasonableness condition g>Πg > \Pi, two events reporting the same macrotick timestamp Δt=0\Delta t = 0 can occur at the very beginning of clock kk's macrotick and just before the end of clock ll's succeeding tick. The maximum possible physical duration separating them is strictly less than 2g2g: with g=3 msg = 3\text{ ms}, the supremum duration is 2⋅3=6 ms2 \cdot 3 = 6\text{ ms}.

  3. Example 3 · Concurrency & Resource Protocols (PIP / HLP / PCP)

    Four tasks T1>T2>T3>T4T_1 > T_2 > T_3 > T_4 (with T1T_1 having the highest priority) execute on a single core under the Non-Preemptive Protocol (NPP). Task T3T_3 runs a critical section of duration 4\text{ ms},andtask, and task T_4runsacriticalsectionofduration7 ms runs a critical section of duration 7\text{ ms}. Task T2T_2 does not use any shared resource. What is the worst-case blocking time B2B_2 (in ms\text{ms}) that task T2T_2 can experience upon arrival?

    T3 critical section
    4 ms
    T4 critical section
    7 ms
    Protocol
    Non-Preemptive Protocol (NPP)

    Answer: 7.00 ms

    Solution: Under the Non-Preemptive Protocol (NPP), whenever any lower-priority task enters a critical section, it cannot be preempted by any arriving task. The maximum blocking time BiB_i that task TiT_i can suffer is the duration of the longest critical section among all lower-priority tasks: B2=max⁡(d3,d4)=max⁡(4,7)=7 msB_2 = \max(d_3, d_4) = \max(4, 7) = 7\text{ ms}.

  4. Example 4 · Memory Architecture & Cache Math

    A byte-addressable computing system has a direct-mapped cache of size 16\text{ KB}andablocksizeof128 bytes and a block size of 128\text{ bytes}. How many index bits are used to select the cache line?

    Cache size
    16 KB
    Block size
    128 bytes
    Policy
    Direct-mapped

    Answer: 7.00 bits

    Solution: The number of cache lines is Cache SizeBlock Size=21427=27\frac{\text{Cache Size}}{\text{Block Size}} = \frac{2^{14}}{2^{7}} = 2^{7}. The number of index bits required to address these lines is log⁡2(27)=7 bits\log_2(2^{7}) = 7\text{ bits}.

  5. Example 5 · Real-Time Scheduling (Jackson / RM / EDF)

    A set of three periodic real-time tasks has periods p1=20 msp_1 = 20\text{ ms}, p2=30 msp_2 = 30\text{ ms}, and p3=40 msp_3 = 40\text{ ms}. What is the duration of one hyperperiod (the least common multiple of all task periods) in ms\text{ms}?

    Period p1
    20 ms
    Period p2
    30 ms
    Period p3
    40 ms

    Answer: 120.00 ms

    Solution: The hyperperiod HH is the length of time after which the periodic task release pattern repeats, defined as the least common multiple of all task periods: H=lcm(p1,p2,p3)=lcm(20,30,40)=120 msH = \text{lcm}(p_1, p_2, p_3) = \text{lcm}(20, 30, 40) = 120\text{ ms}.

  6. Example 6 · Real-Time Communication & CAN Bus

    A CAN bus controller transmits an NRZ data stream that begins with a sequence of 5 consecutive zero (dominant) bits followed immediately by 5 consecutive one (recessive) bits. How many stuff bits are inserted by the transmitter across this combined sequence according to the CAN bit-stuffing rule (width = 5 consecutive identical bits)?

    Zero bits
    5
    One bits
    5
    Rule
    Insert complement bit after 5 consecutive identical bits

    Answer: 2.00 bits

    Solution: Under the CAN bit-stuffing rule, whenever 5 consecutive bits of identical polarity occur, a complementary stuff bit is inserted immediately following the fifth bit. For 5 zeros, ⌊5/5⌋=1\lfloor 5 / 5 \rfloor = 1 stuff bit(s) are inserted. The inserted bit is a one, which breaks the zero run. Then for the 5 ones, ⌊5/5⌋=1\lfloor 5 / 5 \rfloor = 1 stuff bit(s) are inserted. The total inserted stuff bits across the sequence is 2.

  7. Example 7 · Embedded C & System Implementation

    On a 32-bit ARM Cortex-M microcontroller architecture requiring 4-byte natural alignment, a C struct has the following declaration: ```c struct SensorData { uint8_t status; uint32_t timestamp; uint16_t sample; }; ``` What is the total value of `sizeof(struct SensorData)` in bytes, taking compiler structure padding and alignment into account?

    Architecture
    32-bit (4-byte alignment)
    Member 1
    uint8_t status (1 byte)
    Member 2
    uint32_t timestamp (4 bytes)
    Member 3
    uint16_t sample (2 bytes)

    Answer: 12.00 B

    Solution: Each field must align to an address matching its natural alignment: - \`status\` occupies offset 0 (1 byte). - \`timestamp\` requires 4-byte alignment, inserting 3 padding bytes at offsets 1..3. - \`timestamp\` occupies offsets 4..7 (4 bytes). - \`sample\` occupies offsets 8..9 (2 bytes). - The total struct size must be a multiple of the largest member alignment (4 bytes), inserting 2 padding bytes at offsets 10..11. Total size = 1+3+4+2+2=12 bytes1 + 3 + 4 + 2 + 2 = 12\text{ bytes}.

Survival notes

  • A system is only correct if it produces the right output at the right time. A mathematically flawless answer delivered five milliseconds past the deadline scores zero BroDollars.
  • Jackson's algorithm sorts by deadline; Horn's handles preemption; Priority Inheritance fixes inversion until someone introduces nested critical sections and discovers deadlocks.
  • Direct-mapped caches save transistor count but pay for it in conflict misses. If your inner loop thrashes the same line, your worst-case execution time will remind you.

Where it is studied

Taught at the Chair of Robotics, Artificial Intelligence and Real-time Systems in Garching, revised through sleepless debugging sessions in the Magistrale, and examined under strict timing constraints.

Garching: End of the U6, start of the exam. The library opens early, the wind never closes, and the Mensa queue is the only equilibrium anyone reaches before noon.

The whole BWL München map →

How the trainer works

Free, no account. Pick the topics on the Career page, answer postings, earn BroDollars, climb the ladder. The same questions run in multiplayer duels and count for the semester leaderboard. Other courses: Finance, Econ 1, Econ 2, Cost Acc., Intl. Experience, Analog El., Math 1.