Ontopic Random Computer-Electronics Thread

I asked about this recently.

Apparently you’re a rich bourgeoisie if you have one.
Ugh... This shit here on UF is getting stupid. i.e. Want better sound? Spending a bazillion dallors on this receiver system. What a better TV? If you spend more than 5 dollars you're an idiot.
 
OK, fine. Let's assume an integer byte, a 6 drive array, and 2 way parity (P and Q). So, we're going to store 4 bytes and the two parity bytes:
D0 = 8, D1 = 12, D2 = 3, and D3 = 7 .

P = 8 + 12 + 3 + 7 = 30
Q = 1*8 + 2*12 + 3*3 + 4*7 = 69

If we lose D0, we can always recalculate:
30 = D0 + 22
8 = D0

If we lose D0 and D1, we have a slightly harder problem, but let's simplify using the knowns and collecting like terms:
D0 + D1 + 3 + 7 = 30
D0 + D1 = 20

69 = D0 + 2*D1 + 9 + 28
69 = D0 + 2*D1 + 37
D0 + 2*D1 = 32

From there, it's just a system of equations. Let's try substitution after solving for D0 in the first equation (D0 = 20 - D1) :
(20 - D1) + 2*D1 = 32
20 + D1 = 32
D1 = 12

Then we'll back substitute:
D0 = 20 - 12
D0 = 8

See? Easy peasy. The actual math uses XOR and bitshifts, but this should be easier for your apparently tiny brain to understand.
yeah, my brain is still too tiny. No idea how that works. I'll just call it magic.
 
Nikola-Tesla-Quotes-with-Photos.jpg
 
It seriously might as well be in Aramaic. That's okay though, I can't be smart at *everything*. Thank you for trying tho.
Hmm.

Maybe I didn't explain the equations well enough?

let P = the first parity value
let Q = the second parity value

P = D0 + D1 + D2 + D3
Q = 1*D0 + 2*D1 + 3*D2 + 4*D3

So, if we lose any one value, you can solve using the first equation to get that value back.

If we lose any two values, you can solve the first equation to isolate one of the unknown values, then solve the second, back-substitute from the first you solved to get the value for the second lost value, and you'll be back to the first scenario (one lost value).
 
  • Gravy
Reactions: fly
Hmm.

Maybe I didn't explain the equations well enough?

let P = the first parity value
let Q = the second parity value

P = D0 + D1 + D2 + D3
Q = 1*D0 + 2*D1 + 3*D2 + 4*D3

So, if we lose any one value, you can solve using the first equation to get that value back.

If we lose any two values, you can solve the first equation to isolate one of the unknown values, then solve the second, back-substitute from the first you solved to get the value for the second lost value, and you'll be back to the first scenario (one lost value).
AHHHHHHHHH now I get it!

Thanks!
 
  • Gravy
Reactions: Jehannum
Cool. Sometimes I suck at teaching, but I honestly thought the first one was a fairly clear explanation. I can see now that someone without my background wouldn't necessarily connect the multiplication with the bit shifting.
Yep, I have no doubt that your first description was spot on. :heart: