OpenStudy (kikuo):

A program is a set of instructions that tells a computer what to do while CPU reads the program, right? If so, does that mean that if a program--Google Chrome--isn't working than it's the CPU's fault in all cases? Or, do the instructions that a program have also need to be correct for the CPU to execute it?

2 years ago
OpenStudy (kikuo):

Also, I always see questions saying "My computer won't turn on is my CPU broken". If CPU runs programs and programs are just a set of instructions in a file, why would it be responsible for a computer not staying on?

2 years ago
OpenStudy (rsmith6559):

Here is a Wikipedia link that has three other links that should give you a pretty fair detailed idea of how programs execute: https://en.wikipedia.org/wiki/Execution_%28computing%29

2 years ago
OpenStudy (x__hazel__x):

$\Huge{\color{red}{\bigstar}\color{blue}{\bigstar}\color{green}{\bigstar}\color{yellow}{\bigstar}\color{orange}{\bigstar}\color{red}{\bigstar}\color{blue}{\bigstar}\color{green}{\bigstar}\color{yellow}{\bigstar}\color{orange}{\bigstar}\color{red}{\bigstar}\color{blue}{\bigstar}\color{green}{\bigstar}\color{yellow}{\bigstar}}\\\color{white}{.}\\\Huge\color{blue}{\mathfrak{~~~~Welcome~\to~OpenStudy!~\ddot\smile}}\\\color{white}{.}\\\\\Huge{\color{red}{\bigstar}\color{blue}{\bigstar}\color{green}{\bigstar}\color{yellow}{\bigstar}\color{orange}{\bigstar}\color{red}{\bigstar}\color{blue}{\bigstar}\color{green}{\bigstar}\color{yellow}{\bigstar}\color{orange}{\bigstar}\color{red}{\bigstar}\color{blue}{\bigstar}\color{green}{\bigstar}\color{yellow}{\bigstar}}$

2 years ago
OpenStudy (theeric):

Hi! Good article, @rsmith6559 ! So your computer's always running programs. There is actually a program that manages the memory and other resources (operating system). Usually the CPU is fine. The instructions for Chrome might try to do something that the operating system won't allow. So, the CPUs doing its job, and the programs interact. In case you ever code in C++, you can try to access memory locations specifically. Like you can try to overwrite memory vital to your computer's operations. So, this bad program has its instructions that tell the operating system to write to memory that the operating system says is off-limits. Then the operating system can say no, and the bad program is told so. I don't know the details, for sure. But there's a more abstract version of what I think goes on.

2 years ago
OpenStudy (kikuo):

@rsmith6559 Great article! Thanks for it! However, would you mind answering my questions directly. That didn't quite answer them. x)

2 years ago
OpenStudy (kikuo):

You are here thank u based God

2 years ago
OpenStudy (rsmith6559):

The execution environment is so much different than what we're used to, we have to have an idea of it to answer your question, or else the answer is a book. The CPU is a machine with no inherent intelligence beyond executing very simple instructions. The instructions, and the data that they're operating on need to be correct for a program to execute properly. Some errors are fatal at the CPU level, some at the OS level, some at the Application level and worse, the errors that aren't fatal and just give bad results. Data validation and error handling can comprise a good portion of a program.

2 years ago
OpenStudy (kikuo):

Ah, so if there are errors in the instructions it can be fatal? If there are errors with the CPU the errors can be fatal? Also, what is the OS level? @rsmith6559

2 years ago
OpenStudy (rsmith6559):

An OS is Unix, Apple OSX or Microsoft Windows. It's the Operating System. It allows interaction with the kernel (which interfaces with the hardware), handles the house keeping and provides services to applications. Instruction errors, like an opcode (operation code) that doesn't exist, division by zero would both be a CPU level error. If the error is handled, things will keep running. If the error isn't handled, the machine crashes.

2 years ago