9 ms·
That's a very unusual way to phrase the question, there are many steps between code and voltage in a CPU. In brief, Code is stored in memory as a series of 1's
by daven14 13y ago
That's a very unusual way to phrase the question, there are many steps between code and voltage in a CPU.
In brief, Code is stored in memory as a series of 1's and 0's.
Now the memory is stored as different voltage levels in transistors - 5 volts for a 1 and 0 Volts for a 0 for argument sake (but the voltage to logic value is arbitary).
Now the CPU executes the code by walking along different pieces of memory and executing different instructions depending on the value of those pieces of memory.
There's a lot more. For a start Google 'Introductory Digital Electronics' or 'Introductory Computer Architecture' and this might get you started.
- hackaflocka 13y agoOK... how do the 1's and 0's in code become different voltage levels? That's all I'm interested in. That's the software|hardware boundary I'm referring to (and artificial one perhaps, but the boundary of interest to me).
- PeterisP 13y agoWell, where does the code reside? If it is in RAM, then those 0's and 1's are different voltage levels; if it's coming in through a cable (ethernet or USB or keyboard), then 0's and 1's are already different voltage levels; if they're on a hard drive, then they're becoming different voltage levels as soon as the head reads them from the magnetic platter. I'd draw the boundary this way - hardware talks about how physical components will affect behavior of voltage levels, software talks about how one voltage levels will affect behavior of other voltage levels.
- daven14 13y agoThey don't become voltage levels, they are represented by voltage levels. There's nothing that converts a 1 to a particular voltage level. In TTL logic for example (an old type of transistor based logic circuits) it has a voltage swing of 0 to 5 Volts and a 1 is usually defined as 5 volts. There's a think called a J-K flip flop that is worth having a look at - it's the simplest memory element conceptually and it takes a number of transistors to actually implement (6 I think from memory in TTL - I may be wrong - it was a long time ago). In a real cpu D-Ram stores the bits (1's and 0's) and it works by storing a charge http://en.wikipedia.org/wiki/Dynamic_random-access_memory http://en.wikipedia.org/wiki/Dynamic_random-access_memory The software / hardware boundary you speak of is a matter of definition and different people would define it differently. For a hardware developer, they would probably regard microcode as software, but an application developer would regard it as part of the hardware. hth