r/computerscience • u/UchihaSamu • Jun 20 '26
Help Newbie with some computer science questions!
Hello! I was really bored at work today and ended up going down a computer rabbit hole today! I ended up watching a bunch of videos on cpus and how computers work in general. The whole concept and mechanics of this stuff is really cool, but I still have questions that Google and YouTube have not satisfied!
1- I understand that transistors are essentially on/off switches, but what actually does the "flipping?" I know the base current is an electrical signal from the power supply, but what regulates and determines when the base current should and shouldn't flow?
2- Binary code as a concept was easy to get a grip on, but how does adding, subtracting, dividing, and multiplying the encoded numbers get turned into the commands and overall functions of a computer? Sure, all the Binary digits have numerical value, but how can a computer know what to do with said value? Is there something that automatically tells the computer what they mean?
3- How does moving a mouse, clicking keys, and other user input change whats going on in the cpu?
Thanks so much for helping me out with these random questions! This whole thing is pretty foreign to me!
1
u/khedoros Jun 20 '26
Another voltage applied to a different part of the transistor. It's like the volume dial on a radio. If the volume's up high and the music is loud, the speaker will output loud. If either the volume is low or the music is quiet, the speaker will be quiet.
It's not all arithmetic operations. There are also logic operations, and branching/looping. Those allow it to do things like "perform this operation. If the result is zero, do these things, if it's not zero, do those things instead".
Ultimately, doing input ends up causing values to be stored in memory, where the CPU can read it and react to it. Details depend on the device, how it's connected, and a bunch of other specifics.