[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Hey /g/ this is a question i've never been able to get a

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 16
Thread images: 4

File: pic.jpg (305KB, 1140x550px) Image search: [Google]
pic.jpg
305KB, 1140x550px
Hey /g/ this is a question i've never been able to get a straight answer about.

We all know that programs are compiled down to machine code and the kernel communicates with our hardware to make our processes run. And that machine code is essentially zeros and ones that correspond to low and high powers in transistors, which is how memory is stored (correct me if im wrong).

My question is how is the gap between software and hardware actually breached? how do these virtual zeros and ones get converted to physical power levels? How does the lowest level piece of software interact with the hardware?
>>
>>59121977
To build a computer first comes the RAM. The CPU comes second and its job is to manipulate the RAM. Software is what memory you feed the CPU to manipulate said RAM.
>>
File: 1475580940102.png (20KB, 506x606px) Image search: [Google]
1475580940102.png
20KB, 506x606px
>>59121977
It's too hard to give a simple answer to this kind of thing

I've been looking for it for a while now
>>
>>59122004
>>>/v/
>>
>>59122004
there is no first nor seconds. Boths are require to compute. Just see how a turing machine works. A computer is that with more predifined functions so "complex" operations are done in 1 clock's tick.
>>
>>59121977
The hardware implements the operations it can do (and a short abstraction on top of that is assembly). Any compiled program that you write has to conform to the interface that the hardware gives you through its opcodes and the kernel would have to conform to any conventions of the hardware gives it (memory protection, addressing, bootstrapping into long mode, flash program memory location in the case of MCUs etc.). Look into verilog/vhdl and computer architecture if you want to know more.
>>
File: _original[1].gif (117KB, 650x270px) Image search: [Google]
_original[1].gif
117KB, 650x270px
>>59121977
Do you see how physical power levels can influence other physical power levels, resulting in computation?

Like how if you provide physical power levels in this 1bit half-adder, you get the sum out?

Do you see how a sufficiently complex system can run software if provided with the initial power levels?

Humans can induce power levels by flipping switches, pushing keys, toggling light with punch cards and other things to get that process going.
>>
>>59121977
>how do these virtual zeros and ones get converted to physical power levels?

Those ones and zeros are the power levels

there's no '''conversion'''
>>
File: file.png (503KB, 800x569px) Image search: [Google]
file.png
503KB, 800x569px
>>59122083
You are stupid. We know what came first. Pic related.
>>
>>59122069
>I'm an illiterate bastard, I'll proceed posting >>>/v/ as I always do.
>>
>>59122083
yes i understand how the turing machine works to translate instructions to produce output but im more concerned with how this is output/result is then applied to hardware to change the physical state of memory. I guess you could say i want to know how the turing box scans the tape.

>>59122119
i will check it out. thanks

>>59122211
yes this is where i've arrived at so far.
And all automated processes are achieved with a clock?
But i still dont fully understand. Say, for simplicity, i click a button that runs a process. The click triggers the power change and the cpu is loaded with that process code. How does this virtual code influence how power changes within the hardware if it only exists so far as software.
>>
>>59121977

> physical power levels

do you mean as in "watts"? transistors have resistance which dissipates power.

> the kernel communicates with the hardware

Not in the way you are thinking:

A CPU runs based on instructions. These instructions come in a stream, meaning after each one is executed it moves on to the next, or it jumps to another place. The "place" is stored as a number. This number represents the memory address of the current instruction.

No matter what, your computer is reading a stream of instructions that come in one by one. The OS and every program your computer execute are all merged into a line that is executed. It might not feel that way because sometimes it actually can do 2 things at once and CPUs are designed to make it better at multitasking, but it's true
>>
there is no conversion between SW and HW every step is electrical.

google "pipeline"
>>
There never was a gap. It's always been on hardware. "Software" only exists as an abstraction. It is converted into electricity the moment your finger hits the keyboard.
>>
>>59122600
Pretty much this.

If you're genuinely interested OP, I suggest you take a look at Computer Systems by Bryant & OHallaron. Dense but effective.

https://doc.lagout.org/programmation/Computer%20Systems%20-%20A%20Programmers%20Perspective.pdf
>>
OP,

As soon as the CPU powers on, it is designed to request instructions (opcodes/machine code/binary) from a memory address. This is typically mapped to a chip (bios) and it jumps around again to load OS and other things. You are asking how this instruction/data becomes electricty.

When the motherboard is powered on, it gets electricity from your outlet which is flowing... because its plugged in. The computer components can now control that electricity using logic gates made from transistors.

There is a current from the wall to the power supply to the motherboard and its busses, and to the cpu. From the cpu the current flows through to the RAM and the storage etc...

When the CPU requests instructions at an address of RAM, it does so by opening up a series of logic gates to a specific combination of inputs at the RAM controller. These inputs corrospond to a specific address in RAM. Depending on how the digital circuit is activated it will either read or write that address.

If it reads the address, those values (which are charged by the same electricity from the wall hence RAM is volatile) will cause high or low (1 or 0) to flow down the IC pathways and the CPU pins which were requesting the data will receive it where it will be sent down more logic gates to do whatever is decided by the next instruction fetch cycle.

The logic gate groups are called instruction set architectures.

T. CompSci B.S
Thread posts: 16
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.