r/AskComputerScience • • Jul 04 '21

How does a computer's software interact with transistors to use them as switches?

If I type an A on my computer screen, there's a row of transistors somewhere in my computer's system that represents the binary 01000001. What exactly is switching the state on these transistors?

Every time I Google about this, only explanations on how a transistor works come up.

33 Upvotes

12 comments sorted by

View all comments

5

u/diogenes08 Jul 04 '21

ASCII and logic gates are what you are looking for.

On a hardware level, the input, say from a mouse, keyboard, network stream, etc, the bit you put in goes into a logic gate(containing a transistor,) and either sends or doesn't, send another bit depending on what the logic says.

On a software level, series of these bits, usually 8, are put into a byte, making 256 possible combinations. ASCII originally, though most current character encoders are still based on it, is a list of characters matched to these bytes.

Everything on the computer is just more and more complex layerings of these.

0

u/Heavy-Suggestion3464 Jul 04 '21

Yes, the hardware level part is what I'm looking for, but still quite don't understand how the transistors are flipped by the software. Can you elaborate on that process a bit?

6

u/ggchappell Jul 05 '21 edited Jul 05 '21

still quite don't understand how the transistors are flipped by the software. Can you elaborate on that process a bit?

Software doesn't actually do anything on its own. The hardware does everything. What is software? It's a collection of instructions that the hardware can follow ("execute"). The hardware executes the software by looking at memory (where the software is stored), deciding what the value in some particular location means, and then performing the indicated action.

The hardware that does all this is made of transistors. Really, transistors functioning as switches, which flip or do not flip, is the only thing that ever actually happens in a computer. Why does a transistor flip? Answer: because the voltage on one of its inputs changes. Where does that voltage come from? Answer: other transistors, as /u/khedoros indicated.

Now, how the hardware executes the software is a complicated story in which ever fancier structures are built up out of simpler components. As /u/diogenes08 indicated, using transistors, we can construct logic gates. Using those we can construct things like a flip-flop (simple memory), an adder (which adds two numbers), etc. Continuing like this, we can eventually construct large memories and processors.

/u/sequinors wrote:

This question can’t be answered in a single Reddit comment

And that is quite correct. If you really want the complete answer, then you'll need to do some reading on your own and/or take a class.

3

u/Heavy-Suggestion3464 Jul 05 '21

That made sense. Thanks for the answer!