4 ms·
You can, and you should. Learn how an ALU works and how an instruction runs on bare silicon. Learn what silicon doping is and how transistors work to actually c
by calinet6 14y ago
You can, and you should. Learn how an ALU works and how an instruction runs on bare silicon. Learn what silicon doping is and how transistors work to actually create a digital logic gate out of analog concepts. Learn how to design your own processor in a simulator, and how the clock frequency affects your whole chip.
First and foremost, it's fun for anyone interested in engineering to begin with. Second, for programmers, it gives you a tactile experience of programming, and a real respect for what Assembly language really is and what it does, why a compiler is important, how interpreted languages are run differently, and why optimizing your code is important.
You will never know the direct effect that this secondary understanding will have, but the unknowable effects here will be wholly positive, I guarantee it.
I remember one semester in college where it clicked for me... I was taking CS61C, machine structures (basically learning C and how it translates to Assembly) and EE40 (basically learning electronics and how silicon works, and how processors work at an electronic level) and suddenly I understood at least on a basic level how everything worked. The code you type in gets compiled to ASM which gets loaded into memory which the processor loads instruction-by-instruction into registers which are represented by the states of transistors which are loaded each clock cycle by the switching of voltages on a germanium-doped silicon plate which causes the voltage to swing at a certain predictable speed at a given frequency which is controllable and engineered to tolerances which put the whole thing in sync. Holy shit. And each part can be understood in isolation, combined, and it makes sense. It's engineering at its best—break down the problem, understand the tolerances, rinse (with a HF acid wash) and repeat. No single part of it is beyond the realm of understanding, but together they build a system of such complexity, and it's amazing and beautiful that it all works as well as it does.
Knowing this—yes, it makes me think about programming differently.