639
Clever guy (lemmy.world)
submitted 1 day ago by [email protected] to c/[email protected]
top 50 comments
sorted by: hot top controversial new old
[-] [email protected] 4 points 3 hours ago

He probably wanted to prevent significant arcing by using a higher impedance test apparatus due to the high voltage.

[-] [email protected] 6 points 13 hours ago

not a phd in physics huh

[-] [email protected] 29 points 20 hours ago

Is his PhD in Electrical Engineering?

[-] [email protected] 30 points 21 hours ago* (last edited 21 hours ago)

Well, I have an EE Degree specialized in Digital Systems - pretty much the opposite side of Electronic Engineering from the High Power side - and I would be almost as clueless as that guy when it comes to testing a 10,000V fence for power.

On the other hand I do know a lot of interesting things about CPU design ;)

[-] [email protected] 3 points 8 hours ago
[-] [email protected] 2 points 2 hours ago

You didn't say the magic word

[-] [email protected] 9 points 18 hours ago

What’s the most interesting thing you could tell us about CPU design, something that a layman could appreciate.

You should know as a software developer I write inefficient code and appreciate all the extra clock cycles we get these days haha.

[-] [email protected] 27 points 17 hours ago* (last edited 13 hours ago)

First a fair warning: I learned this stuff 3 decades ago and I've actually been working as a programmer since then. I do believe the example I'll provide still applies up to a point, though CPUs often implement strategies to make this less of a problem.

=====

CPU's are internally like an assembly line or a processing pipeline, were the processing of an assembly instruction is broken down into a number of steps. A rough example (representative but not exactly for any specific CPU architecture) would be:

  • Step 1: fetch assembly instruction from memory
  • Step 2: fetch into the CPU data in memory that the instruction requires (if applicable).
  • Step 3: execute arithmetic or binary operation (if applicable).
  • Step 4: evaluate conditions (if applicable)
  • Step 5: write results to memory (if applicable)

Now, if the CPU was waiting for all the steps to be over for the processing of an assembly opcode before starting processing of the next, that would be quite a waste since for most of the time the functionality in there would be available for use but not being used (in my example, the Arithmetic Processing Unit, which is what's used in step #3, would not be used during the time when the other steps were being done).

So what they did was get CPUs to process multiple opcodes in parallel, so in my example pipeline you would have on opcode on stage #1, another that already did stage #1 and is on stage #2 and so on, hence why I also called it an assembly line: at each step a "worker" is doing some work on the "product" and then passing it to the next "worker" which does something else on it and they're all working at the same time doing their thing, only each doing their bit for a different assembly instruction.

The problem with that technique is: what happens if you have an opcode which is a conditional jump (i.e. start processing from another point in memory if a condition is valid: which is necessary to have to implement things like a "for" or "while" loop or jumping over of a block of code in an "if" condition fails)?

Remember, in the my example pipeline the point at which the CPU finally figures out if it should jump or not is almost at the end of the pipeline (step #4), so everything before that in the pipeline might be wrong assembly instructions being processed because, say, the CPU assumed "no-jump" and kept picking up assembly instructions from the memory positions after that conditional-jump instruction but it turns out it does have to jump so it was supposed to be processing instructions from somewhere else in memory.

The original naive way to handle this problem was to not process any assembly instructions after a conditional jump opcode had been loaded in step #1 and take the processing of the conditional jump through each step of the pipeline until the CPU figured out if the jump should occur or not, by which point the CPU would then start loading opcodes from the correct memory position. This of course meant every time a conditional jump appeared the CPU would get a lot slower whilst processing it.

Later, the solution was to do speculative processing: the CPU tried to guess if it would the condition would be true (i.e. jump) or false (not jump) and load and start processing the instructions from the memory position matching that assumption. If it turned out the guess was wrong, all the contents of the pipeline behind that conditional jump instruction would be thrown out. This is part of the reason why the pipeline is organised in such a way that the result of the work only ever gets written to memory at the last step - if it turns out it was working in the wrong instructions, it just doesn't do the last step for those wrong instructions. This is in average twice as fast as the naive solution (and better guessing makes it faster still) but it still slowed down the CPU every time a conditional jump appeared.

Even later the solution was to do the processing of both branches (i.e. "jump" and "no-jump") in parallel and then once the condition had been evaluated throw out the processing for the wrong branch and keep doing the other one. This solved the speed problem but at the cost of having double of everything, plus had some other implications on things such as memory caching (which I'm not going to go into here as that's a whole other Rabbit Hole)

Whilst I believe modern CPUs of the kind used in PCs don't have this problem (and probably also at least ARM7 and above), I've actually been doing some Shader programming of late (both Computing and Graphics Shaders) and if I interpreted what I read correctly a version of this kind of problem still affected GPUs not that long ago (probably because GPUs work by having massive numbers of processing units which work in parallel, so by necessity they are simple) though I believe nowadays it's not as inadvisable to use "if" when programming shaders as it used to be a few years ago.

Anyways, from a programming point of view, this is the reason why C compilers have an optimization option of doing something called "loop unrolling" - if you have a "for" loop with a fixed number of iterations known at compile time - for example for(int i = 0; i < 5; i++){ /* do stuff */ } - the compiler instead of generating in assembly a single block of code with the contents of the "for" loop and a conditional jump at the end, will instead "unroll the loop" by generating the assembly for the body of the loop as many times as the loop would loop - so in my example the contents of that "for" loop would end up as 5 blocks in assembly each containing the assembly for the contents, one after the other, the first for i=0, the next for i=1 and so on.

As I said, it's been a long time since I've learned this and I believe nowadays general CPUs implement strategies to make this a non-problem, but if you're programming microcontrollers or doing stuff like Compute Shaders to run on GPUs, I believe it's actually the kind of thing you still have to take in account if you want max performance.

Edit: Just remembered that even the solution of doing the parallel execution of both branches doesn't solve everything. For example, what if you have TWO conditional jump instructions one after the other? Theoretically would need almost 4 or everything to handle parallel execution for it. How about 3 conditional jumps? "Is you nested for-loop screwing your performance? More news at 11!". As I said, this kind of stuff is a bit of a Rabbit Hole.

[-] [email protected] 43 points 1 day ago

He must have skipped all of the Electrical Engineering classes in his Paleontology program.

[-] [email protected] 13 points 21 hours ago

Hey it's a "It's a UNIX system" movie, isn't it?

[-] [email protected] 16 points 20 hours ago

Did you know the weird 3d file system navigation thingy was a real program (just not widely used)?

But I can't get over the way she held the mouse lol

[-] [email protected] 11 points 20 hours ago

The funny thing about that quote is that it really was a Unix system that was shown on screen.

[-] [email protected] 4 points 19 hours ago

What was the name of the 3D file manager again?

[-] [email protected] 3 points 14 hours ago

It had a wonderfully bizarre name: fsn

[-] [email protected] 1 points 19 hours ago

I know that!

[-] [email protected] 53 points 1 day ago

As someone who has worked with academics, the more specialised the person, the less common sense they seem to hold onto.

As such, if this was outside their PhD specialisation, then it'd absolutely make sense that this wouldn't occur to them.

[-] [email protected] 7 points 21 hours ago

My professor (computer science - NP complete problems specific) had a theory.

Higher up your education, more and more you learn about less and less.

I am convinced he accidentally stumbled across Buddhism all on his own (he was a religious Christian, the generous, do not judge others kind). Because Buddha seems to have done his PhD in nothing. Even "wrote" the whole dissertation on nothingness.

[-] [email protected] 5 points 23 hours ago

I'd like to report that the more specialized a medical doctor is, the less common sense they have.

Had a doctor chew me out because he couldn't be bothered to simply turn the computer on.

That was the issue. Pushing a button was beneath him. Cool man, I'm the only one here at this hour and the phones have to be manned constantly. That ticket can go to another department and wait until they come in morning.

Also, low priority and I noted that the doctor refused to simply turn it on.

I think that ticket sat there for over a month.

[-] [email protected] 4 points 21 hours ago

My university basically gave up with a couple of professors. They hired a personal assistant, full time, just to try and keep them organised. They apparently settled on 3 phone calls, to make sure they made lectures on time. It even extended to things like reminding them to actually get their wives birthday presents, and personal book keeping.

It seems the human brain has a capacity limit. The more specialist knowledge shoved in, the less room for more normal knowledge. Eventually it displaces even the most basic common sense.

[-] [email protected] 3 points 18 hours ago* (last edited 18 hours ago)

Meet the German word Fachidiot: (derogatory) A person who is only interested in their own trade or research area and has few or no other interests or skills.

[-] [email protected] 10 points 21 hours ago

Why people gotta hate on a movie three decades old that remains perfect?

[-] [email protected] 13 points 20 hours ago

Gotta meme to keep it alive

[-] [email protected] 16 points 1 day ago

He is already standing too close and that stick would arc with that many volts flowing through it. The most likely outcome in reality if it had been energized. The arc would have jumped from the stick to him and no more New Zealand guy.

[-] [email protected] 6 points 19 hours ago

With only 10'000 V? That's a common Livestock Guardian*. Reaches at most 1 cm.

* though it probably has enough ampere to kill a cow

[-] [email protected] 2 points 13 hours ago

You ever saw a electric fence at a high security installation? I just texted a guard at nearby prison and he said theirs are 5000 volts. He said when its humid they tingle when you get a few feet away. He also says they will kill you dead. He goes on to say its why they have another fence as a barrier to prevent people who don't respect them from killing themselves. I know the ones at a nuke were marked lethal and would kill birds from time to time. They were just marked high voltage but the plant guys told us they were very high voltage at a higher frequency.

[-] [email protected] 1 points 4 hours ago* (last edited 4 hours ago)

Yep, Volt makes sparks, Ampere makes hurt.

Tesla coils usuallly have around 100k Volt and don't kill you. Tasers 20k to 40k i think? The high voltage in guardians is mostly so that it connects.

[-] [email protected] 2 points 14 hours ago

Now if he'd just tossed the stick at it longwise so that it touched several wires at the same time, it might get a result. I'm personally not sure how much a reaction you'd get out of dry wood with 10,000 volts. Stripping the bark off of green stick with definitely be better, or a wet stick. Although if electricity arced through the stick at least it probably wouldn't kill him because of the amount of resistance that stick has.

[-] [email protected] 98 points 1 day ago* (last edited 1 day ago)

At 10kV, a random stick would be all it takes to start an arc. He knows what he's doing.

[-] [email protected] 44 points 1 day ago* (last edited 1 day ago)

True, True… Hay who thought it was safe to run 10,000V Wire through a flammable overgrown jungle?

[-] [email protected] 6 points 1 day ago

The people who wouldn't cry about a dino BBQ scenario.

[-] [email protected] 4 points 21 hours ago* (last edited 21 hours ago)

I'm genuinelly curious were you got that from.

I actually went and checked the minimum air gap to avoid arcing at 10,000V at standard sea level air pressure and it's actually measured in millimeters.

Further, is the voltage differential there between parallel conducting lines or is it between the lines and the ground?

I'm really having trouble seing how a dry stick would cause arcing between two of those lines short of bringing them nearer than 4 mm in the first case, much less between one of the lines and the ground in the second case if its being held at chest level.

PS: Mind you, it does make sense with a stick which is not dry - since the water in it makes it conductive - but then the guy himself would be part of the conductive circuit, which kinda defeats the point of using a stick.

[-] [email protected] 4 points 17 hours ago

What you want to do is create an arc between the stick and the line, and not have it transfer to you. A dry stick would do this quite well, since it would be at ground voltage and as such would provoke a short arc without electrocuting yourself. The fence also probably doesn't have all that much power, likely can't deliver more than a few amps, so it would be quite safe even.

[-] [email protected] 7 points 1 day ago
[-] [email protected] 2 points 14 hours ago

Mythbusters did it.

[-] [email protected] 206 points 1 day ago

As a PhD who has tried doing home improvement projects, it’s the most believable thing in the film.

load more comments (11 replies)
[-] [email protected] 42 points 1 day ago

I invite you to touch an electric fence with a stick then.

[-] [email protected] 5 points 23 hours ago

i'm not touching your stick man, gross!

load more comments (3 replies)
[-] [email protected] 159 points 1 day ago

A high voltage electric fence. At some point even standing in front of the thing is enough.

[-] [email protected] 1 points 12 hours ago

about 10kV per cm i believe. you're only at risk of it arcing to your body if you're within a centimeter of the wire. and that assumes your body to ground is a good conductor (it's not)

[-] [email protected] 7 points 21 hours ago

At 10,000V and at sea level, you need to be at about 4mm from that fence for the air to arce.

A few posts above I was curious and actually went and checked it.

load more comments (28 replies)
[-] [email protected] 45 points 1 day ago

Yeah that’s people with PhDs in my experience

load more comments (1 replies)
[-] [email protected] 35 points 1 day ago

I don't remember the scene, but personally I'd test an electric fence with a nonconductor. You'll probably get some sparks but won't die. You do you, ppl in this thread.

[-] [email protected] 42 points 1 day ago

Wet wood from the ground is probably a better conductor than dinosaur scales

load more comments (9 replies)
load more comments
view more: next ›
this post was submitted on 26 Sep 2024
639 points (95.8% liked)

Funny

6598 readers
411 users here now

General rules:

Exceptions may be made at the discretion of the mods.

founded 1 year ago
MODERATORS