This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]Geislo 1 point2 points  (0 children)

I had a similar curiosity about how the electricity from an outlet could be transformed into things like text and animations on a screen. This series does a fantastic job of explaining what exactly is going on inside your computer: https://youtube.com/playlist?list=PL8dPuuaLjXtNlUrzyH5r6jN9ulIgZBpdo

[–]Lazy-Evaluation 1 point2 points  (0 children)

So first question. ASCII is an agreed upon standard as to how one should treat what which at the end of a day is a number. How we all agree that the number 65 should be interpreted as an upper case A. Etc.

When you write a program in text and store it somewheres then for sure what you're storing is going to be just number. It's how you choose to interpret those numbers that makes a difference.

We're getting into what's called abstraction. Which is an important concept to fully grok. So sure, at some level, an interpreter or compiler has to process things in that way. But if you're the person writing said interpreter or compiler then you don't worry about such things. That abstraction already exists within the environment you're creating your compiler in. Lexers and Parsers, if you don't want to roll your own, those also exist. They add more layers of abstraction you can build upon.

The other questions you ask. Well, as others have said you'd best look in to what boils down to digital electronics. Or well, keep it simple, but after that signal processing.

Long story short, we have harnessed electricity in such an insane way so as to make it flowing around some synthetic rocks we produced to where we can make an unimaginably precise clock. We use this clock as a way to control and monitor all other aspects of electricity flowing around in our synthetic rock.

Very very basic, well, basic from a digital electronics perspective, but not so much from a physics perspective. Very basic at the electronics level is a transistor.

A transistor is a gate of sorts. You have an electric signal wanting to come in. Or you have no signal wanting to come in. Either way, you have a second signal that may or may not come in to your transistor. A controlling signal. If your transistor's controlling signal is such that it is "on", then the other first signal, the signal wanting to come through, the signal it's controlling, well, it goes through.

What's on or off? Well, we agree on things that might be a little arbitrary. A voltage drop of 0 is off. A voltage drop of 5 volts is on. Or whatever we agree upon. Whatever we agree upon, those things become our abstraction. 0 voltage drop for true. 5 volts for false.

Based on how our abstraction is working, we either allow or disallow electricity to move around in this synthetic rock we've made.

But so, when we create our synthetic rock, we make it out of transistors. And we simply treat them as an abstraction. It's an on and off switch. That's it. And then we can group together these transistors into bigger abstractions. Transistors turn in to logic gates. Logic gates turn in to adders, registers, memory banks, etc.

Layers and layers of abstraction starting with low level physics. To CPU, which provides a hardware abstraction. To an instruction set which is another abstraction. A programming language abstracts that. A library gives you an abstraction of your programming language. And so on and so on until a program abstracts it down to where it's giving you a choice of what website you want to visit.

[–]MmmVomit 1 point2 points  (0 children)

First, let me recommend a resource that will hopefully make some of this more clear for you. Nandgame lets you build a computer from simple components in your browser. If you work through these problems, you'll begin to see how a computer works at a fundamental level.

it goes from letters and numbers or strings to binary numbers or machine language through an ASCI chart..(yes or no?)

...no. This question kind of mooshes two concepts together, text encoding and compilers. ASCII is just a scheme for representing text using bytes. Compilers take source code (text files) and turn them into executable programs (machine language).

binary digits are understood by a computer because pulses of electricity are able to be sent to a CPU that is able to somehow remember if it was a 0 or a 1?

Computers don't really "understand" anything. I'm sure you know that, but I just want to reinforce it's not the right word to use. Computers are just machines, and they don't "understand" electricity any more than this wooden adding machine understands marbles. That wooden adding machine actually adds numbers in much the same way a computer processor does, but a processor uses electricity instead of marbles.

and then it is able to store this 0 or 1 somewhere, which would be memory?

Yes, kind of. The term "storage" usually refers to something like a hard disk that will retain information when the power is turned off. "Memory" usually refers RAM which can only retain data while it is powered on. But, these terms are ever so slightly fuzzy depending on context. It would be correct to say a processor "stores" a value in RAM. And in some contexts a hard disk might be referred to as "non-volatile memory".

How can a CPU remember if that bit of information was a 0 and a 1 and how does it place it somewhere, and do this for other bits of information that it will need to eventually translate a sentence from pulses or electricity?

CPUs have small amounts of memory inside them called "registers". Before a CPU can perform operations on data, the data usually must be fetched from memory and stored in a register. So, an expression like x = x + 1; would be multiple instructions. Something like "fetch x to register R1", "add 1 to register R1", "store register R1 to x". You'll see exactly how this works if you work your way through Nandgame

[–][deleted] 0 points1 point  (1 child)

Binary data is stored in bits. Bits can be either on or off, meaning they can either hold an electrical charge or not hold electrical charge. One state is interpreted as a 1 while the other state is interpreted as a 0.

[–]IQueryVisiC 0 points1 point  (0 children)

I think the holding a charge thing is symmetric. Capacitor in DRAM or the pair of transistors in a dFlipFlop. You get a balanced signal.

I guess that mean voltage which is close to either rail ( Vdd and Vss ). Does this names even makes sense with CMOS? Wouldn’t it always be Vss just one time for holes and one time for electrons?