"karthikbalaguru" <karthikbalaguru79@gmail.com> wrote in message news:1192956657.375752.263790@t8g2000prg.googlegroups.com...> Hi, > > How is a processor able to differentiate the numbers as either data or > instructions ?For the most popular computers today... it doesn't. Computers store numbers in addressed locations in memory. When the "program counter" is set to an address and the processor executes the number at the address, it is an instruction. When a program loads a value from the same address into a processor register, it is data. But generally speaking if you look at a number somewhere in memory you can't tell whether it is data or an instruction. It is how the number is used that defines it as data or instruction. Regards, Steve> > Thx in advans, > Karthik Balaguru >
Online · Live + on demand
February 9-11, 2027
Price goes up Nov 1: register now to lock in today's rate
Register Now →
Differentiate the numbers as either data or instructions
Started by ●October 21, 2007
Reply by ●October 21, 20072007-10-21
Reply by ●October 22, 20072007-10-22
"karthikbalaguru" <karthikbalaguru79@gmail.com> wrote in message news:1192956657.375752.263790@t8g2000prg.googlegroups.com...> Hi, > > How is a processor able to differentiate the numbers as either data or > instructions ? > > Thx in advans, > Karthik Balaguru >That is why von neuman is famous and you aren't. Don't feel bad, I'm not either.
Reply by ●October 22, 20072007-10-22
Andrew Smallshaw wrote:> On 2007-10-21, karthikbalaguru <karthikbalaguru79@gmail.com> wrote: >> How is a processor able to differentiate the numbers as either data or >> instructions ? > > In a word, context. In a Von Neumann architechure, there is no > fundamental difference between the two.-- snip snip The irony here is delicious. The original VN architecture had no address calculation capability - in particular no index registers. Treating an instruction as data - adding or subtracting a value to from its address field was the only way - other than having a distinct instruction with the appropriate address in it - to access multiple elements of an array or other data structure. As soon as our cousins across the sea invented address modification registers - b lines - that was no longer necessary. To be an effective computer the original VN arch had to interpret the contents of (some) memory locations as both instructions and data. JKA -- How do you tighten a screw? Turn it until the thread strips and then back it off a quarter of a turn?
Reply by ●November 2, 20072007-11-02
In article <L8FSi.34498$c_1.3296@text.news.blueyonder.co.uk>, noemail@address.com says...> >"karthikbalaguru" <karthikbalaguru79@gmail.com> wrote in message >news:1192956657.375752.263790@t8g2000prg.googlegroups.com... >> Hi, >> >> How is a processor able to differentiate the numbers as either data or >> instructions ? >> >> Thx in advans, >> Karthik Balaguru > > >Some processors have separate data and instruction buses, and some >protection mechanisms to generate exceptions, but other than that, it cant >differentiate between the two. It just does with the 'numbers' what your >software tells it to do. If you set the program counter to an address that >was within data it would attempt to execute the data. >-- >Regards, >Richard.Y'all are forgetting about tagged architectures, which check the tag of the memory word before using what was read, or writing to it. e.g. Unisys Libra series. - Tim







