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
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.
Example 1 · Real-Time Basics & Dependability
A redundant real-time communication controller exhibits a Mean Time To Failure of and a Mean Time To Repair of . Calculate the steady-state system availability 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 is the ratio of operational uptime to total time: .
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 . If both clocks report the exact same timestamp for two separate physical events (), what is the upper bound on the physical time difference (in ) 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 , two events reporting the same macrotick timestamp can occur at the very beginning of clock 's macrotick and just before the end of clock 's succeeding tick. The maximum possible physical duration separating them is strictly less than : with , the supremum duration is .
Example 3 · Concurrency & Resource Protocols (PIP / HLP / PCP)
Four tasks (with having the highest priority) execute on a single core under the Non-Preemptive Protocol (NPP). Task runs a critical section of duration 4\text{ ms}T_4. Task does not use any shared resource. What is the worst-case blocking time (in ) that task 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 that task can suffer is the duration of the longest critical section among all lower-priority tasks: .
Example 4 · Memory Architecture & Cache Math
A byte-addressable computing system has a direct-mapped cache of size 16\text{ KB}. 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 . The number of index bits required to address these lines is .
Example 5 · Real-Time Scheduling (Jackson / RM / EDF)
A set of three periodic real-time tasks has periods , , and . What is the duration of one hyperperiod (the least common multiple of all task periods) in ?
- Period p1
- 20 ms
- Period p2
- 30 ms
- Period p3
- 40 ms
Answer: 120.00 ms
Solution: The hyperperiod is the length of time after which the periodic task release pattern repeats, defined as the least common multiple of all task periods: .
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, stuff bit(s) are inserted. The inserted bit is a one, which breaks the zero run. Then for the 5 ones, stuff bit(s) are inserted. The total inserted stuff bits across the sequence is 2.
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 = .
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.
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.