News for hackers. Stuff that matters.
Re:What if you knew how computers work? (2015) by dboreham on Saturday October 10, 2020 @12:47AM (#24736754)
Amusingly, in high school my physics teacher told the class a story about how things had become so complex that no single person could understand everything about the classroom computer.

That was in 1978 and the computer was an Apple II.

Re:What if you knew how computers work? (2015) by WalterBright on Saturday October 10, 2020 @02:54AM (#24737120)
It was entirely possible in those days to understand everything from transistors, to digital logic gates, to flip-flops, to clocks, to adders, to registers, to 8 bit computer chips, to assembler, to the primitive BASIC on an Apple II.
Re:What if you knew how computers work? (2015) by mcguire on Saturday October 10, 2020 @12:02PM (#24739825)
Sure. It's just quantum mechanics, classical physics, electrical engineering, and computer science.
Re:What if you knew how computers work? (2015) by WalterBright on Saturday October 10, 2020 @02:48PM (#24740973)
QM and classical physics courses (2 years worth) are required of every Caltech student, as they are considered foundational. EE and CS are optional, of course, but not a problem to take.

I admit I struggled with QM.

Re:What if you knew how computers work? (2015) by jacobush on Saturday October 10, 2020 @03:06AM (#24737146)
But how transistors work is very sketchy to me
Re:What if you knew how computers work? (2015) by TheOtherHobbes on Saturday October 10, 2020 @04:49AM (#24737568)
You can get a hand-wavey understanding quite easily.

Digital circuits use a fairly simple model, and that's not difficult to pick up.

Analog circuits can use a number of more complex models, and they're more of a challenge, depending on what you're trying to do.

Actually designing transistors - defining dopant levels, topology, and process steps - is a very specialised skill that very few people have.

And modern PC motherboards are marvels of electromagnetic engineering as well as electronic engineering. You have GHz signals running reliably on circuit boards with multiple layers. Getting those to work is another very specialised skill.

So it would quite something to find someone who had a professional-level understanding of all the levels: from silicon chemistry and quantum physics at one extreme, to electromagnetic design, to all the different levels of electronic design, to binary machine language and processor architectures, to OS design and application software, to all the various data structures and encodings that make all of the above useful.

Re:What if you knew how computers work? (2015) by WalterBright on Saturday October 10, 2020 @03:11AM (#24737156)
You really need a course in Quantum Mechanics to understand it. But a workable description is a couple pages in most electronic textbooks. MIT covers it in their first course in electronics on Youtube.
Re:What if you knew how computers work? (2015) by amelius on Saturday October 10, 2020 @01:07PM (#24740304)
You need QM to even explain why electrons don't fall into the nucleus. So I'd say if you want to understand anything then you need QM.

There's this quote which I think applies here: if you want to bake an apple pie from scratch, you first need to invent the universe.

Re:What if you knew how computers work? (2015) by WalterBright on Saturday October 10, 2020 @02:36PM (#24740891)
True, but transistors do not behave in a newtonian physics manner, whereas we do just fine understanding most physics using conventional newtonian mechanics.
Re:What if you knew how computers work? (2015) by amelius on Saturday October 10, 2020 @03:06PM (#24741092)
This makes me wonder what Newtonian physics we actually use in computing?
Re:What if you knew how computers work? (2015) by WalterBright on Saturday October 10, 2020 @06:15PM (#24742264)
Non-transistor electronics relies on Maxwell's Equations. While not Newtonian mechanics, it is part of classical (pre-Einstein) physics.
Re:What if you knew how computers work? (2015) by agumonkey on Saturday October 10, 2020 @06:50AM (#24738053)
QM would be ultimate foundational understanding. A transistor is a valve. Here, problem solved :D
Re:What if you knew how computers work? (2015) by cinntaile on Saturday October 10, 2020 @08:16AM (#24738424)
A generic course in QM won't really help you understand electronics any better. Perhaps if you have a background in electronics or if the course makes attempts to link QM with electronics but otherwise it's just relatively abstract physics.
Re:What if you knew how computers work? (2015) by selecsosi on Saturday October 10, 2020 @12:00PM (#24739807)
I don't know any program of study that would get sufficiently deep enough to get to semi-conductor quantum tunneling (year 2/3 class) without having some foundational E&M to motivate the QM to begin with (pure math here being a more exceptional but rare case). I think the beauty of QM at that point is that it looks and feels a lot like differential field work of EM and Lagrangian mechanics but maps to quantized numerical spaces, where jumps and little shoots like that happen all the time (spontaneous crystal domain alignment in magnets for example). If you were able to get sufficiently skilled in intro QM, it would absolutely help study in E&M.

If you E&M questions are just node solving, linear algebra and difeq is all you need for E&M to solve "most" work. You do a lot of specialized versions of that in QM and as mentioned above the people doing the actual semiconductor design are so highly specialized that they are often not transferable to other problem domains and require fundamentally different approaches. Not sure any non-PHD study will really help one advance the field in a meaningful way. Study of QM i would say sufficiently enriches all physics verticals that if you are capable, it's worthy of individual pursuit, but also makes total sense to study as part of a curriculum taking place after intro E&M.

Quantum Tunneling in everyday life: https://www.discovermagazine.com/the-sciences/how-quantum-me...

Re:What if you knew how computers work? (2015) by cinntaile on Saturday October 10, 2020 @08:23PM (#24742929)
Now that you mention it. After the QM course there was a solid state physics course where quantum effects show up and where it's applied to electronics/semiconductors.
Re:What if you knew how computers work? (2015) by WalterBright on Saturday October 10, 2020 @02:39PM (#24740913)
> A generic course in QM won't really help you understand electronics any better.

Caltech had an elective course for freshman about how semiconductors worked up through flip-flops and registers. I took it. It involved QM and yes, tunnelling. So it's doable for mortals.

Re:What if you knew how computers work? (2015) by wuschel on Sunday October 11, 2020 @05:48AM (#24744723)
Very interesting discussion thread re how much knowledge you need or can aquire on complex technology platforms. The goal is key here, I presume.

I read Charles Perzhold's Code, worked through parts of SICP, developed a bit of high level code software, have a very good knowledge of chemistry, lithographic processes (and QM, half forgotten by now). And yet it is not enough to get a good understanding of the modern computer - EE, compilers, OS de, networks, ... wiring the while thing together, et cetera.

I see the point in historical approaches, but it is quite time consuming. At the end, you will most likely attack problems at one to three levels in the "stack".

What would you consider to be an above average conceptual tool and skill set for the modern hacker?

Re:What if you knew how computers work? (2015) by cinntaile on Saturday October 10, 2020 @08:24PM (#24742936)
Yes, I can see how it would help there. I was more thinking of the situation where you take a QM course and don't apply it to an electronics problem. I agree that it's doable for mere mortals, but it might take a fair bit of time!
Re:What if you knew how computers work? (2015) by SomeoneFromCA on Saturday October 10, 2020 @12:11PM (#24739891)
Do FETs really require QM to understand them?
Re:What if you knew how computers work? (2015) by WalterBright on Saturday October 10, 2020 @02:42PM (#24740934)
The handwavy explanations you'll find in electronics textbooks are sufficient to enable you to effectively design electronic circuits around them. But personally, I found those explanations inadequate.
Re:What if you knew how computers work? (2015) by bserge on Saturday October 10, 2020 @10:12AM (#24739123)
Kind of blew my mind when I learned they are analog... I previously thought of them as one of the most basic digital components, because they're used in every digital circuit.
Re:What if you knew how computers work? (2015) by tasty_freeze on Saturday October 10, 2020 @11:25AM (#24739573)
My job for the past 30 years has been designing ASICs, so all the analog stuff is not my concern. Prior to that I designed at the TTL level. I'd spend months working on some project, thinking in terms of logic an timing, and eventually we'd have boards made. We'd stuff a few prototypes and set them up on the lab bench to commence debugging.

Every time at this phase I'd suffer the existential horror the first time put an oscilloscope to the circuit -- the clock wasn't square! Signals would ring, and other signals which hadn't transitioned would sometimes bounce a bit. Setup and hold times could be pretty well estimated, but it was still an estimate. Then there were phantoms that might appear on the scope or real issues that would not show up on the scope because the probe lead was enough to make what was measured not the same as what was actually going on.

Re:What if you knew how computers work? (2015) by WalterBright on Saturday October 10, 2020 @02:45PM (#24740954)
That reminds me of working on the stabilizer trim system on the 757. I got used to thinking of the parts as rubber, bending and twisting on the high loads an airplane has in flight. So much so that when the hardware was finally available, I was surprised at how rigid and immovable it felt under my hands with my puny human strength.
Re:What if you knew how computers work? (2015) by pretty_dumm_guy on Saturday October 10, 2020 @03:53PM (#24741406)
Hi,

Your work sounds really interesing to me.

I am wondering about the reasons for these issues that you mentioned. Could you please mention them here ? It might serve as a nice pointer to do better hardware design debugging I believe(I have close to zero experience in this. Hence the interest).

Also, are there any formal systems that verify your TTL-level designs ?

Thank you.

Re:What if you knew how computers work? (2015) by tasty_freeze on Saturday October 10, 2020 @04:53PM (#24741824)
Sure. There are many reasons why a real circuit falls short of the idealized abstraction.

A truly squarewave clock, or any rising/falling edge that happens in zero time would have infinite bandwidth, and no real circuit can have infinite bandwidth because of capacitance, inductance, and resistance. Even though the power rails of a TTL chip are 0V and 5V, when a fast transition happens, the signal can experience reflections because the impedance of the driver and the copper trace are different, and because the end of the copper trace isn't terminated with impedance which matches the trace. As a result, the edge takes finite time to transition from 0V to 5V, but the signal can actually exceed 5V because of a reflection. Likewise, falling signals can go below 0V.

Also, the signal at one end of a wire will not be the same as the signal at the other end of the wire. It isn't even just a simple time delayed version. Eventually they'll come to equilibrium if the signal is stable long enough.

You can read about transmission lines here: https://en.wikipedia.org/wiki/Transmission_line

OK, another defect. Imagine a TTL part with 8 buffers in it, say a 74ACT244. Say all the outputs are low, and at some moment seven of those inputs switch from low to high. The corresponding outputs must drive enough current to switch their loads from low to high as well. Each of those outputs draw current to charge their load from 0V to 5V, and all of the current flows through a single power pin and a single ground pin. Because of of non-zero resistance and inductance, the voltage seen by the transistors on the chip is shifted slightly from the voltage seen on the PCB. That can cause the output which isn't changing to sink/source current (depending on the direction of the change) causing its output to bounce a bit. Imagine having four people on a trampoline, with one standing still and three jumping at the same time. That "standing still" person will still bounce up and down because of the others causing their common ground reference to shift.

Another defect. A chip's spec sheet lists a bunch of requirements for proper operation and guarantees of the chip's behavior if the requirements are met. Say a flip flip says it has a 5ns setup time, that is, the data in to the flop must be held stable for 5ns before the rising edge of the clock arrives. If this requirement isn't met, the chip's behavior is unspecified (it might capture it, it might not, it might capture it but it might take an arbitrarily long time to appear on the output, or the output could even oscillate). During the design phase one adds up the worst case propagation times for all paths from point A to point B and makes sure there is at least 5ns to spare to guarantee the requirements. But in real life, a clock trace runs all over the board and has many loads, each presenting some amount of capacitance. Kind of like relativity, different chips will see the rising edge at different times. Looking at a given chip, the clock edge and data inputs are each transitioning from high to low or low to high over the course of a nanosecond (and often more). At what point on that slope is the signal really a "0" or a "1"? Sometimes those signals are clean transitions because of reflections, it might go from 0.7V before the clock edge, to -0.5V after the clock edge, to 2.2V (neither logical 0 nor 1), stay like that for a few ns, then move to 4.2V for a few ns, then 4.0V for a few ns, then 4.6V.

The most maddening is the fact you can't always trust what the oscilloscope tells you. The oscilloscope has finite bandwidth; 100MHz scopes were common in the 80s and early 90s when I was using them. The 200MHz scopes were a lot more expensive. You might think, hey my clock is only 25 MHz, 100 MHz is plenty ... but a fast signal edge contains harmonics that are a multiple of that 25 MHz base frequency, so the scope tends to act as a lowpass filter. The scope probe is typically more than a meter long, and there is a clip on the probe that must be attached to your circuit ground. That is a 2m loop of wire, and in the best case it would take a signal a few ns to travel the length of that wire, and any stray EM fields can induce signals on that probe that aren't in the circuit (though obviously the probe designers take pains to minimize such effects). When debugging and a signal looked unexpectedly weird, a common tactic to avoid sinking too much time chasing phantoms was to change the probe, change the channel, or simply waggle the lead wire around to test the sensitivity of the displayed waveform on stray capacitance and such.

Testbenches always had a few cans of refrigerant on hand. If you suspected a chip might be flaky, probe its output then spray it and see if the output is affected by the chip temperature.

The list goes on...

Re:What if you knew how computers work? (2015) by pretty_dumm_guy on Sunday October 11, 2020 @05:24AM (#24744643)
Your explanation is quite amazing. In my undergrad, we had learned about Transistors, TTL, flip-flops etc., but as individual building blocks. Your reply paints a very good picture about what can go wrong they play together. Is there a book that you would recommend to learn more about this ?

Also, Honestly, I thought reflections would be negligible when we are dealing with mA and 0-5V ranges. But your reply makes me think that there is more to it

Finally, thank you for your reply. I gonna come back to this answer in the future when I have a lab setup that is more than a solder and some screwdrivers :)

Re:What if you knew how computers work? (2015) by tasty_freeze on Saturday October 10, 2020 @04:58PM (#24741848)
Oh, I forgot to mention that when you probe a circuit, the presence of the probe can affect the operation of the circuit.

On RF designs it was not uncommon to find seemingly needless small valued components at certain probe points. The idea was these modeled the reactive load of a probe. When you needed to probe it you'd remove the components and attach your probe and the circuit see approximately the same load so you could have more faith that what you were seeing more closely matched what was happening when you weren't looking.

Re:What if you knew how computers work? (2015) by jacobush on Monday October 12, 2020 @09:49AM (#24754307)
Oh gosh thanks!

I have seen such small valued components, looked their values up and thought, "this is insane".

(I wish I could say I thought, "I must be dumb, someone must be much smarter than I am", but if I hadn't embodied a certain kind of hubris I would not work in software.)

Re:What if you knew how computers work? (2015) by tasty_freeze on Saturday October 10, 2020 @05:09PM (#24741911)
A nice video showing some real world effects of non-ideal probes:

https://www.youtube.com/watch?v=zodpCuxwn_o

Re:What if you knew how computers work? (2015) by bserge on Saturday October 10, 2020 @02:55PM (#24741022)
Way over my head, but damn it sounds interesting :D
Re:What if you knew how computers work? (2015) by dekhn on Saturday October 10, 2020 @11:13AM (#24739497)
I don't know that there is anything truly digital in the universe, except perhaps quantized components like spin. Digital computers are an abstraction implemented using error control and a number of other things, but they ultimately fail like analog objects.
Re:What if you knew how computers work? (2015) by dboreham on Saturday October 10, 2020 @10:16AM (#24739141)
Well yes, as a kid at the time I remember thinking I understood pretty much all of it except the switched mode PSU and Woz's wacky floppy controller.
Re:What if you knew how computers work? (2015) by dekhn on Saturday October 10, 2020 @11:11AM (#24739492)
What about hi-res graphics? Apple II hi-res graphics were especially wacky.
Re:What if you knew how computers work? (2015) by WalterBright on Saturday October 10, 2020 @02:34PM (#24740884)
Woz could understand it. After all, he invented it. He wrote the code for the Apple II. I bet he understood every aspect of it.
Re:What if you knew how computers work? (2015) by amelius on Saturday October 10, 2020 @07:34AM (#24738225)
Nowadays you'd have to know how a modern lithography machine works. There's a reason why ASML is a highly valuable company. You can perhaps understand the basic ideas, but to implement them is another matter entirely.
Re:What if you knew how computers work? (2015) by falcor84 on Saturday October 10, 2020 @02:57AM (#24737131)
That's a surprising example. From reading his autobiography and other sources, it's my impression that by virtue of having designed it from the transistors to the software, Steve Wozniak did in fact grok it fully.
Re:What if you knew how computers work? (2015) by p1esk on Saturday October 10, 2020 @03:33AM (#24737232)
Wozniak has not designed it on the transistors level, he used MOS Technology 6502 microprocessor. Though I agree he could probably understand it on the transistor level if he wanted/needed to.
Re:What if you knew how computers work? (2015) by taneq on Saturday October 10, 2020 @03:31AM (#24737220)
Ok, so maybe one single person...
Re:What if you knew how computers work? (2015) by dboreham on Saturday October 10, 2020 @10:17AM (#24739154)
You misunderstood my post. The point was my teacher was wrong then and possibly similar assertions now could be wrong too.
Re:What if you knew how computers work? (2015) by falcor84 on Saturday October 10, 2020 @02:29PM (#24740851)
Ah, that went entirely over my head then.
Re:What if you knew how computers work? (2015) by nullc on Saturday October 10, 2020 @04:10AM (#24737377)
What we can understand is partially a product of how good we've become at teaching it.
Re:What if you knew how computers work? (2015) by jdmoreira on Saturday October 10, 2020 @12:03PM (#24739830)
Except multiple people understand everything about the Apple II :)