How does binary trigger current in hardware?

793 views

I’m not very technical so apologies if I use terms interchangeably that don’t make sense but I will try to explain. What I understand and put very basic is: we write code, it then gets “converted” so that the computer understands it. This is represented by 1’s and 0’s that trigger current in the hardware that gets stored in memory, lights a LED, etc. through (I think it’s called) logic gates.

That’s my way of understanding it. What I don’t understand is how the current is triggered? What causes that interaction?

For example, when I click save in a document. How does that trigger it to be saved in the hardware. Is it that, when I physically click on my mouse. That physical interaction of clicking sends a current and the computer recognises that the proportion of the pixels on the screen represents saving the document, which then triggers it to send that current to the logic gates?

Edit: Thank you for all your answers.

In: Technology

7 Answers

Anonymous 0 Comments

You ever see one of those rube-goldberg machines? This hits that, which hits that, which hits that… on and on?

Computers are like that.

When you switch the computer on, a supremely complex process occurs–but it’s all down to electricity in wires. The electricity is always flowing from the start, and the programs are ultimately just ways of supplying inputs to complex electrical circuits.

One of the first thing a computer does when you start it is try to look for the boot device. It does this because there is a specific chip on the computer’s hardware that does exactly one thing: when electricity is poured into its input side, it outputs the address of the first instruction in the boot sequence. From there, the cascade begins; the electricity flows to the next part of the sequence, which copies the data in that location to a specific register in the CPU. This is all implemented via hardware circuits: it’s very like a rube-goldberg machine; electricity in this side causes this effect on the other side through a series of pre-designed circuits.

From there, the first instruction has been loaded. Other hardware takes over, and the complex process of computation begins. Each instruction in the CPU’s instruction set is ultimately implemented in the hardware as either a series of circuits or a series of other instructions which themselves are implemented as circuits. The CPU constantly reads the instruction register (this action itself is hardware-based) and copies whatever value happens to be in there as inputs to another circuit; this circuit’s designed to kick off the chain reaction of whichever specific instruction is coded for, because it has a specific circuit pathway associated with each potential input value.

That’s computation in an nutshell. Somewhere, there’s a circuit that takes as input a series of electrical signals on a series of wires; by its very nature it does nothing except pass those or other signals on to whichever circuit pathway is specified by the original input. Over and over and over and over again this happens, as long as there’s electricity supplied to the CPU at all from the power supply. Everything else a computer can do is just a series of hardware circuits that correspond to logical instructions.

Anonymous 0 Comments

Is it your hand which grasps, or is it your fingers doing all the work? Is is software which puts those icons on your screen, or is it currents?

The thing to understand about the computer is that it’s *all* just electrical currents. All the logical, visual stuff you see represented on the screen and in the computer’s abstractions ilke “icon” and “desktop”, all of those things are just different arrangements of currents flowing through that big array of logic gates. So to ask how clicking the icon ‘triggers’ a current, well, it’s just currents triggering other currents.

That’s really what a logic gate is, is a voltage trigger. There are various logic gates such as “and” gates and “or” gates, and their job is to trigger in a certain if-then scenario. It performs a rule like “If input voltage A is high *or* input voltage B is high, *then* set output voltage C to high.” The job of a CPU maker, is to wire these gates up to each other in ways so that physical if-then scenarios concerning the voltages on the wires between them, will map cleanly onto *logical* if-then scenarios that are useful for computation, such as the ‘carry rule’ for binary addition: “if both addends have a 1, then carry a 1 over to the next digit.”

The software in the computer can be looked at in two different ways. Looked at in one way, the meaning of a particular software instruction could be: Store the value “hello” in a string starting at memory location 15.

But looked at in another way, the meaning of that instruction is: “Set the following voltages on the RAM data bus: high low low high high […] high high”.

It’s kind of like the difference between saying “write ‘hello’ on this piece of paper” and “deposit ink on the paper in the following shapes.” The same physical thing is going on, but you’re describing it at a different level of meaning. That’s the difference between “saving a file” and “triggering currents.”

Anonymous 0 Comments

Ones and zeros in binary correspond to voltages. Zeros are no voltage. Ones are some voltage in a certain range.

Anonymous 0 Comments

You click a mouse button, and the mouse will send an electronic signal down the wire (or an infrared or bluetooth signal across the area to a receive). The specific nature of the electric signal differs depending on what you’re doing: the left mouse button being pressed, the left mouse button being released, the right mouse button being pressed or released, the mouse moving etc.

The electrical signal is sent to a specific device controller that will convert that signal and store it into registers. Registers are collections of transistors that can store and hold and electrical pulse so long as they are being provided power.

The device controller will send a signal to the CPU that basically means, “Hey, I got some new information about the mouse, come read all about it.” The CPU then reads the information in the registers.

At this point the operating system (and any open applications) are already running and their specific instructions are already in memory being carried out. Part of these instructions involve waiting until something happens with the mouse then doing something about it.

In this particular case, the operating system knows where the mouse curser was when the PC first started and has been tracking its motion every time you moved it, so it knows where the mouse cursor is when you left clicked. It also knows every application is running, what windows they’re running in, and the size and position of those windows. It sees that the position of the mouse cursor is over one of those windows, so passes that information to the running application.

The application takes that info and recognizes that the cursor is over the save button icon and has special instructions for a left-click when the mouse cursor is over the save button icon. It then sends instructions to the operating system to save the current file in memory to disk.

Anonymous 0 Comments

Computer’s are mostly made of transistors. A transistor is an electronic switch. With a low voltage input, it prevents current from flowing from the input to the output. With a high voltage input, it allows current to flow with low resistance from the input to the output.

Clicking your mouse it not hardware, it’s an operating system program. As you move the mouse (the actual gizmo) from side to side, OS software moves a pointer on the screen. When you click the mouse, the OS software looks at where the mouse is located, and finds a “mousable region” under that point. If then calls the program attached to that mousable region.

Anonymous 0 Comments

There’s actually a lot that goes on when you click your mouse. But at its simplest, you’ve closed a switch that tells a transistor to turn on (or off). That sends signals to other transistors that do other things, and they send signals to other transistors, etc. etc.

Eventually that causes a change in a memory location. That can be transistor-based memory (SSD, USB thumb drive, DRAM, SRAM) or it can be a change in magnetism on the surface of an HDD.

That memory location can encode a 0 or a 1, but it can “mean” a whole bunch of different things depending on the context in which it is later used (read out). You might have changed a letter in a Word document. You might have changed an instruction in a program you are writing that will later be used to tell the computer what to do (after being read by a transistor and sent on to other transistors etc. etc.). You might have changed a color in an image. Depends on the context.

Anonymous 0 Comments

When you physically click your mouse, that closes a switch pulling an input of the microcontroller in your mouse down to (usually)ground. This input is one bit of a register that the microcontroller can read.

You can look up how to make a nand gate out of transistors, and then you can play this game to build up to a basic computer: http://nandgame.com

Basically, the computer doesn’t send something to logic gates, the computer is made out of logic gates.