5.5.25 · D3 · HinglishEmbedded Systems & Real-Time Software

Worked examplesRedundancy — TMR (triple modular redundancy), voting logic

4,169 words19 min read↑ Read in English

5.5.25 · D3 · Coding › Embedded Systems & Real-Time Software › Redundancy — TMR (triple modular redundancy), voting logic

Yeh page TMR parent topic ke under rehti hai. Yahan hum voting ke baare mein baat karna band karke actually karte hain — ek triple-modular-redundant system ke saath aane wale har tarah ke input ke liye. Agar module, voter ya majority jaise words naye hain toh pehle parent padho; baaki sab yahan se zero se rebuild karte hain.


Scenario matrix

Neeche har cell teen inputs ki ek alag shape hai. Har worked example un cells ke saath tagged hai jo woh cover karta hai.

Cell Input pattern Kya test karta hai Example
A Teeno exactly equal Fault-free "happy path" Ex 1
B Exactly do equal, ek alag Single masked fault Ex 1, Ex 2
C Teeno alag (koi consensus nahi) Voter decide karne mein fail hota hai Ex 3
D Close-but-not-equal (analog noise) Tolerance clustering vs. median Ex 4
E Ek module silent (koi output nahi) Degenerate input, fail-silent Ex 5
F Binary inputs Digital majority gate, saare 8 rows Ex 6
G Ek wild outlier Median beats average Ex 7
H Limiting reliability Boundary of TMR kab help karta hai Ex 8
I Real-world word problem Furnace safety cutoff Ex 9
J Exam twist: do modules identically fail Common-cause defeats voting Ex 10
K Tolerance ke andar plausible liar Byzantine/adversarial module Ex 11

Example 1 — Cells A & B: happy path aur ek masked fault

Forecast: padhne se pehle dono answers guess karo — kya run β ka koi defined output bhi hai?

  1. Run α — agreements count karo. Teeno bit patterns ke equal hain, toh . Yeh step kyun? Rule sirf do bit-identical chahta hai; teen aur bhi safe hai. Output .
  2. Run β — pairwise compare karo. par . Pair bit-identical hai, toh majority . Yeh step kyun? "At least two bit-equal" se satisfy ho jaata hai; ki zaroorat nahi. reading masked ho jaati hai.
  3. Fault ko naam do. Akela ek fail-incorrect bias hai (calibration drift), phir bhi TMR cope kar gaya kyunki baaki do healthy the. Yeh step kyun? Cell B dikhata hai: ek single wrong-but-plausible value survivable hai.

Verify: α mein, sab equal ⇒ output kisi bhi input ke equal hona chahiye, . ✅ β mein, teen mein se do ke equal hain ⇒ output , aur outlier ka distance kabhi result mein nahi aata. ✅


Example 2 — Cell B: flight control mein sign-flip fault

Forecast: galat value sahi value ki negative hai — kya woh voter ko fool kar sakta hai?

  1. Pairs ko bit-compare karo. Voter magnitudes nahi, raw bit patterns ki equality check karta hai. aur ke identical bits hain; exactly sign bit mein differ karta hai. Yeh step kyun? Bit comparison ek single-cycle XOR-and-NOR hai — floating-point compare se kaafi faster, jo kilohertz control loops par matter karta hai. Yeh rule 1 mein "byte-for-byte equal" ka concrete matlab hai.
  2. Majority mili. Pair match karta hai, nahi ⇒ output . Yeh step kyun? Bhale hi ek violent opposite roll command karta, woh minority of one hai aur discard ho jaata hai.
  3. Aftermath. Aircraft deflection rakhta hai; ground logs module 3 ko flag karte hain (dekho Watchdog Timers — disagreement maintenance ke liye kaise record hota hai).

Verify: set karo with : . Do modules dete hain, output ; flipped mask ho jaata hai. ✅


Example 3 — Cell C: no consensus (voter ko refuse karna padega)

Forecast: temptation hai ki kahein "beech wala pick karo." Kya yahi exact voting karta hai?

  1. Har value ke liye exact matches count karo. ke liye: ek module. ke liye: ek. ke liye: ek. Koi value count tak nahi pahunchti. Yeh step kyun? Exact voting unforgiving hai — "close" matlab "bit-equal" nahi hota.
  2. No-consensus return karo. Voter guess karne ki jagah error signal karta hai. Yeh step kyun? Yahan guess karna aisa trust fabricate karna hoga jo earn nahi hua. Ek safety-critical system ek jaani-hui failure prefer karta hai na ki ek silent galat answer (dekho Safety-Critical Systems Standards).
  3. Escalate karo. Teen-way disagreement ke saath, TMR exhaust ho gaya; aapko higher redundancy (5-modular) ya fallback mode chahiye.

Verify: matches ⇒ koi majority nahi ⇒ output error sentinel hai (None), nahi. ✅


Example 4 — Cell D: tolerance clustering (aur kyun hum cluster median return karte hain)

Forecast: window ke saath, kitne teeno cluster karte hain — aur hum wapas kaunsa ek number dete hain?

Is vote ki geometry ek number line hai jisme ek sliding tolerance window hai. Figure dekho: amber bars pairwise distances hain; cluster tab banta hai jab readings width ki ek window ke andar baithe hon.

Figure — Redundancy — TMR (triple modular redundancy), voting logic

Figure s01 — teen readings 100/105/110 ek number line par (cyan dots). Upar: ke saath poora trio ek window mein fit hota hai (cyan band), toh teeno cluster karte hain; amber tick returned value = cluster ka median = 105 mark karta hai. Neeche: ke saath koi bhi do readings 3 ke andar nahi hain, toh windows kabhi overlap nahi karti aur size ≥ 2 ka koi cluster nahi banta → no-consensus.

  1. Agreement test banao. Do readings agree karti hain iff . Pairwise distances: , , . Yeh step kyun? Rule 2 noise ke andar closeness se cluster karta hai, exact equality se nahi.
  2. Sabse bada cluster dhundo (). Teeno distances hain, toh size ka ek mutually-agreeing cluster hai. Yeh step kyun? ka cluster matlab TMR ka consensus hai.
  3. Cluster ka median return karo — yeh order-dependence ka fix hai. Cluster hai ; uska median hai. Yeh step kyun? Reviewer ka trap: purane "pehli value jo threshold reach kare" rule se, aur dono ke ke andar teen neighbours hain, toh answer iteration order par depend karta tha. Cluster median return karna ek single, order-independent, symmetric choice hai — koi farak nahi padta ki list forward scan karo ya backward.
  4. Ab window shrink karo (). Distances sab hain, toh koi pair agree nahi karta; size ka koi cluster nahi ⇒ no-consensus. Yeh step kyun? Trade-off dikhata hai: bahut-tight genuine agreement ko falsely reject karta hai; bahut-loose ek real fault ko cluster mein merge kar deta.

Verify: ke saath, cluster , uska median (order-independent). ke saath, koi pair ke andar nahi ⇒ output None. ✅


Example 5 — Cell E: ek silent module (degenerate input)

Forecast: sirf do live inputs ke saath, kya "majority of three" phir bhi possible hai?

  1. Missing ko "match nahi ho sakta" treat karo. Ek silent module kabhi kisi ke bit-equal nahi ho sakta, toh woh har match count mein contribute karta hai. Yeh step kyun? Isliye hum fail-silent ko fail-incorrect se prefer karte hain: ek missing value vote jeet nahi sakti.
  2. Survivors mein matches count karo. ⇒ value ka count hai. Yeh step kyun? TMR exactly ek lost module survive karne ke liye design kiya gaya tha; do agreeing survivors phir bhi majority banate hain.
  3. Output ; degraded mode flag karo. System ab zero remaining tolerance ke saath hai — doosra fault fatal hoga. Ek watchdog yeh alarm raise karna chahiye.

Verify: live agreeing modules , threshold output ; ek loss ke baad remaining redundancy . ✅


Example 6 — Cell F: digital majority gate, saare 8 rows

Forecast: aath rows mein se kitne dene chahiye? (Do-ya-teen ones wale rows count karo.)

  1. Saare rows aur true majority list karo. Inputs ke saath:

    ones majority formula
    0 0 0 0 0 0
    0 0 1 1 0 0
    0 1 0 1 0 0
    0 1 1 2 1 1
    1 0 0 1 0 0
    1 0 1 2 1 1
    1 1 0 2 1 1
    1 1 1 3 1 1

    Yeh step kyun? Har row enumerate karna hi ek Boolean identity prove karne ka ek maatra tarika hai — koi case chhup nahi sakta.

  2. Formula ko ek tricky row par check karo. Row : . Majority se match. Yeh step kyun? Do zeros do product terms ko vanish karwa dete hain; surviving pair-term fire karta hai. Isliye hum teen pair-products OR karte hain.

  3. Count confirm karo. Exactly rows mein majority hai, aur formula exactly unhi par deta hai.

Verify: formula column saare 8 rows mein majority column ke equal hai; s ki sankhya . ✅


Example 7 — Cell G: outlier par median beats average

Forecast: outlier baaki dono ka hai — kaunsa method use ignore karta hai?

Figure dikhata hai kyun: ek number line par, average ek balance point hai jise door-right wala outlier tip kar deta hai; median ek rank position hai jise outlier hila nahi sakta.

Figure — Redundancy — TMR (triple modular redundancy), voting logic

Figure s02 — teen readings number line par. Do cyan dots 100 par hain, ek amber outlier 1000 par. White triangle average (400) mark karta hai, outlier ki taraf rightward khicha hua; cyan arrow median (100) mark karta hai, sorting ke baad beech wala element, outlier ki magnitude se unhila hua.

  1. Average. . Yeh step kyun? Averaging ek single huge outlier ko answer drag karne deta hai — galat hai us value ke liye jo honi chahiye thi.
  2. Median-of-three. Sort karo: ; beech wala element hai. Yeh step kyun? Median sirf rank care karta hai, magnitude nahi, toh ek extreme value use kabhi true cluster se aage move nahi kar sakti.
  3. General guarantee. Teen inputs ke saath jahan do healthy hain aur ek arbitrarily bad, do healthy values wo ranks occupy karti hain jo middle ko surround karti hain, toh median hamesha healthy values mein se ek hota hai. Yeh step kyun? Yahi mathematical reason hai ki analog TMR voters median (rule 3) use karte hain, mean nahi.

Verify: average , median ; sirf median two-of-three cluster se match karta hai. ✅


Example 8 — Cell H: reliability boundary

Forecast: kaunse par TMR curve aur line cross karte hain?

Figure dono plot karta hai: (single module, dashed white) aur (TMR, cyan). Left se right padho: crossover se neeche cyan curve white line ke neeche dip karta hai (TMR hurts); uske upar cyan curve upar bulge karta hai (TMR helps). Amber dots un teen crossings ko mark karte hain jo hum derive karne wale hain.

Figure — Redundancy — TMR (triple modular redundancy), voting logic

Figure s03 — horizontal axis module reliability hai 0 se 1 tak; vertical axis system reliability hai. White dashed line = single module. Cyan curve = TMR. Amber dots par crossings hain. Cyan shading mark karta hai jahan TMR line se upar hai (helps); label "TMR hurts" us region mein hai jahan mein cyan curve white line ke neeche hai.

  1. Corners evaluate karo.
    • : — TMR worse.
    • : — TMR ties.
    • : — TMR helps.
    • : — perfect perfect rahta hai. Yeh step kyun? Pehle numbers, taaki neeche ka algebra kuch concrete explain kare.
  2. Crossover equation explicitly solve karo. Dono curves equal set karo aur sab ek side move karo: factor out karo: Quadratic factor karo, toh Har factor se ek root milta hai: Yeh step kyun? Ek strict derivation prove karti hai ki crossover set exactly hai — graph se guess nahi. Ek maatra interior crossing hai, jo practical threshold hai.
  3. Limits padho. par curve par pin ho jaata hai (sab dead); par par pin hota hai (sab perfect). Roots aur ke beech cyan curve line ke neeche hai; ke upar woh upar hai. Yeh step kyun? Confirm karta hai ki figure ki shading exactly algebra hai: TMR helps iff .

Verify: , , , ; ke factored roots hain . ✅


Example 9 — Cell I: real-world furnace safety cutoff

Forecast: do sensors se upar hain, ek neeche — beech wali value kya hai, aur kya woh limit exceed karta hai?

  1. Median-of-three. Sort karo ; middle . Yeh step kyun? Rule 3 hamesha ek number return karta hai (ek safety limit-check ko kabhi "no-consensus" receive karke stall nahi hona chahiye); yeh single low reading () ke against robust hai, jo likely drifting sensor hai.
  2. Threshold se compare karo. trip. Yeh step kyun? Trusted value, koi bhi single sensor nahi, safety action drive karta hai — voter ka poora point yahi hai.
  3. Discarded low reading par sanity check. Agar hum (galat tarike se) minimum use karte, toh ek genuine over-temperature miss ho jaata — ek dangerous silent failure. Yeh step kyun? Confirm karta hai ki limit check ke liye median (na min, na average) safe choice hai.

Verify: median; trip True. ✅ (Units: sab °C, consistent.)


Example 10 — Cell J: exam twist, identical common-cause fault

Forecast: kaunsi value ke do votes hain — aur kya woh sahi hai?

  1. Matches count karo. Value do baar appear hoti hai (bit-identical), ek baar. Majority . Yeh step kyun? Voter correctness ke liye blind hai; woh sirf agreement count karta hai. Do wrong-but-identical outputs jeet jaate hain.
  2. Independence assumption ki failure diagnose karo. TMR ki reliability math assume karti thi ki modules independently fail karte hain. Ek shared bug ek common-cause failure hai — yeh do modules ko same tarike se corrupt karta hai, toh vote confidently garbage return karta hai. Yeh step kyun? Yahi exam trap hai: TMR multiple channels par common faults ke against protect nahi karta. Dekho Common-Cause Failures aur Byzantine Fault Tolerance.
  3. Fix redundancy nahi, diversity hai. Design diversity use karo — har channel ke liye alag algorithms ya teams — taaki ek single bug do modules ko identically infect na kar sake. Yeh step kyun? Redundancy hardware multiply karta hai; diversity shared failure modes remove karta hai.

Verify: ke liye matches hain ⇒ voter output karta hai (galat), jabki truth hai; independence assumption violated. ✅


Example 11 — Cell K: tolerance window ke andar ek plausible liar

Forecast: liar sirf door hai truth se. Ek generous window ke saath woh honest pair mein "join" ho jaata hai — kya woh returned value corrupt kar deta hai?

  1. Tolerance . Distances: , , — sab , toh teeno ek cluster banate hain. Yeh step kyun? Liar itna close hai ki cluster mein admit ho jaata hai; yahi ek smart adversary aim karta hai.
  2. Cluster median return karo — honest majority phir bhi dominate karta hai. Sort karo ; median . Yeh step kyun? Yahan cluster ka median vote karne ka payoff hai (rule 2, definition box se): bhale hi liar cluster mein ghus gaya, do honest s lower aur middle ranks occupy karte hain, toh median hai. Tolerance ke andar ek single liar median ko honest pair se aage move nahi kar sakta. Compare karo cluster ko average karne se, jo deta — jhooth se corrupted.
  3. Tolerance . Ab , toh liar exclude ho jaata hai; honest pair phir bhi cluster karta hai (distance ), median . Yeh step kyun? Ek tighter window liar ko outright reject karta hai — same correct answer, aur ab disagreement diagnostics ko visible hai.
  4. Liar kab jeet sakta hai. Ek single within-tolerance liar median-based vote flip nahi kar sakta jab tak do honest modules agree karte hain. TMR ki guarantee us waqt khatam hoti hai jab do channels same tarike se jhooth bolte hain (woh Ex 10 ka common-cause case hai, ya ek coordinated Byzantine attack) — aur isliye Byzantine Fault Tolerance ko teen se zyada replicas chahiye. Yeh step kyun? Ek adversary kya kar sakta hai aur kya nahi, uski precise boundary draw karta hai.

Verify: ke saath, cluster median (lie masked); cluster average hota (corrupted). ke saath, liar excluded, honest median . ✅


Recall Self-test

Exact-bit majority (rule 1) mein "equality" ka kya matlab hai? ::: Raw bit patterns identical hote hain (bit-for-bit XOR saare zeros deta hai); numerically-close-but-not-identical count nahi hota. Tolerance-cluster voting (rule 2) error kab return karta hai? ::: Jab kam se kam do readings ka koi group ke andar na ho, jaise with . Cluster median kyun return karte hain na ki "pehli mili value"? ::: Cluster ka median order-independent aur symmetric hota hai; "pehla mila" arbitrarily scan direction par depend karta hai jab kai values qualify karti hain. Kaunsa voter bina kisi error branch ke hamesha ek number output karta hai? ::: Median-of-three (rule 3) — jab downstream controller "no-consensus" par stall nahi kar sakta (jaise furnace limit check). Kya ek within-tolerance Byzantine liar cluster-median vote corrupt kar sakta hai? ::: Nahi — jab tak do honest modules agree karte hain, median honest value par rehta hai; cluster ko average karna corrupted ho jaata. Kaunse module reliability par TMR help karna band kar deta hai, aur hum ise kaise prove karte hain? ::: par; ko mein factor karo, roots milte hain . Kaunsa fault majority voter ko completely defeat karta hai? ::: Ek common-cause failure jo do modules ko identically corrupt karta hai, jaise galat return karta hai.