ALL > Computer and Education > courses > university courses > undergraduate courses > An Overview of Computer Science > zstu-(2020-2021-2) > online classroom exercise >
online classroom exercise 2 Version 0
šŸ‘¤ Author: by writer 2021-03-15 23:50:45
describe program execution in detail

Please login to reply. Login

3108655967qqcom • 2021-03-16 10:11:02
We see that the execution of a program stored in memory involves the same process you and I might use if we needed to follow a detailed list of instructions. Whereas we might keep our place by marking the instructions as we perform them,the CPU keeps its place by using the program counter. After determining which instruction to execute next,we would read the instruction and extract its meaning. Then,we would perform the task requested and return to the list for the next instruction in the same manner that CPU executes the instruction in its instruction register and then continues with another fetch. PostVer 0

Please login to reply. Login

1634605411qqcom • 2021-03-16 17:10:13
The CPU performs its job by continually repeating an algorithm that guides it through a three-step process known as the machine cycle. The steps in the machine cycle are fetch, decode, and execute. During the fetch step, the CPU requests that main memory provide it with the instruction that is stored at the address indicated by the program counter. Since each instruction in our machine is two bytes long, this fetch process involves retrieving the contents of two memory cells from main memory. The CPU places the instruction received from memory in its instruction register and then increments the program counter by two so that the counter contains the address of the next instruction. stored in memory. Thus the program counter will be ready for the next fetch. PostVer 0

Please login to reply. Login

1281489327qqcom • 2021-03-16 20:34:34
PostVer 0

Please login to reply. Login

zboa6023gmailcom • 2021-03-16 21:10:49
<p class="q-text qu-display--block"><em>By using any software,A computer can execute a word processing software program, by doing tasks such as:</em></p>

<ul class="q-box">
<li class="q-relative"><em>wait for you to type something, and when you do…</em></li>
<li class="q-relative"><em>display the character pressed on your keyboard on the screen (over and over)</em></li>
<li class="q-relative"><em>save what you have typed</em>
<p class="q-text qu-display--block"><em>When you run program, it is loaded into the main/primary memory of the computer called RAM (the entire program is transferred to the RAM, by a small program called the loader (which often comes with the compiler i.e. is a part of the compiler).</em></p>
<p class="q-text qu-display--block"><em>The program instructions are executed in the ALU (Arithmetic-Logic Unit) of the CPU (in its registers like the Accumulator). In order to execute the instructions , the CPU fetches the values of the variables (say, int a =10; int b =20;) in the program from the RAM, and stores the results also in the RAM (int sum =30;), which is then sent to the output buffer stream (stdout) , which prints the results (30) on the computer console/terminal.</em></p>
</li>
</ul> PostVer 0

Please login to reply. Login

2394773179qqcom • 2021-03-19 13:04:05
make an example of c program.
<p class="_tgt transPara grammarSection"><span class="transSent" data-group="0-0">After the process is created, the operating system gives control to the entry point of the program, which is usually an entry function in the runtime</span></p>
<p class="_tgt transPara grammarSection"><span class="transSent" data-group="1-0">The entry function initializes the runtime and the program runtime environment, including heap, I/O, thread, and global variable construction</span></p>
<p class="_tgt transPara grammarSection"><span class="transSent" data-group="2-0">After the entry function completes the initialization, it calls the main function to officially start executing the main part of the program</span></p>
<p class="_tgt transPara grammarSection"><span class="transSent" data-group="3-0">After the main function finishes executing, it returns to the entry function, which does the cleanup, including global variable destructing, heap destruction, closing I/O, and so on, and then the system call terminates the process</span></p> PostVer 0

Please login to reply. Login

2955836006qqcom • 2021-03-19 14:52:09
The program runs, according to theirĀ  logical order decided by the algorithm which the problem reflects. Take an mathematical problem forgot instance , The program firstly receives the data input, then deals with it by the algorithm design before , finally output PostVer 0

Please login to reply. Login

542236691qqcom • 2021-03-19 16:54:11
The program we write is stored in the hard disk.When running,the computer transfers it to the memory, and the data in the register in the CPU is loaded from the memory.Then the CPU will operate the data in the register according to the corresponding instructions,such as addition,subtraction,multiplication and division, so as to complete the running of a program in the computer. PostVer 0

Please login to reply. Login

1525693772qqcom • 2021-03-19 19:07:50
A program is loaded into a computer from an external device, usually a hard disk. If it is the normal computer structure we use now, then the program will be loaded into the memory. Instructions are executed serially until a jump or transfer instruction is executed, or an interrupt occurs. All of these instructions change the contents of the instruction register. PostVer 0

Please login to reply. Login

2287245796qqcom • 2021-03-19 19:47:16
1.read the instruction from memory (using data and address buses and program counter stuff)

2.store data in register inside CPU

3.Now ALU does arithmetic operations, of course after decoding the instruction, or take a jump if its an if like instruction
<ol>
<li>4.And then communicating with other resources if needed like with output device and so on. Processes beyond this are trivial for now.</li>
</ol> PostVer 0

Please login to reply. Login

2542886026qqcom • 2021-03-19 20:46:43
If a program can run , it must be have instructions and data. And there are some specializedĀ registers to store them in CPU of computer. We write a program with computer luangage . When the program compiled , the computer change our code to binary . These binary information to tell computer what to do as execution. PostVer 0

Please login to reply. Login

wx287_oz26ftyeszxunhjb6ehly8qq5vdi • 2021-03-19 20:49:25
retrive the next instruction from memory and then increment the program counter
decode the bit pattern in the instruction register
perform the action required by the instruction register PostVer 0

Please login to reply. Login

3058218005qqcom • 2021-03-19 21:40:48
<strong>Preprocession-&gt;</strong><strong>Compilation-&gt;</strong><strong>Assembly-&gt;</strong><strong>Linking</strong> PostVer 0

Please login to reply. Login

387940240qqcom • 2021-03-19 23:02:01
1.The CPU outputs the address of the memory location containing the required instruction (this address is kept in the program counter). The sample address is shown in hexadecimal form, but it is output in binary form on the address lines from the processor. The address decoder logic uses the address to select the RAM chip that has been allocated to this address. The address bus also connects directly to the RAM chip to select the individual location, giving a two-stage memory location select process.

2.The instruction code is returned to the CPU from the RAM chip via the data bus. The CPU reads the instruction from the data bus into an instruction register. The CPU then decodes and executes the instruction. The operands (code to be processed) are fetched from the following locations in RAM via the data bus, in the same way as the instruction.

3.The instruction execution continues by feeding the operand to the data processing logic. Additional data can be fetched from memory. The result of the operation is stored in a data register, and then, if necessary, in memory for later use. In the meantime, the program counter has been incremented (increased) to the address of the next instruction code. The address of the next instruction is then output and the sequence repeats from step 2. PostVer 0

Please login to reply. Login

wx287_oz26ftx_gczjz0jpscvm1-d3flry • 2021-03-19 23:57:08
PostVer 0

Please login to reply. Login

1498139310qqcom • 2021-03-19 23:58:23
<strong>C source program header file --- &gt; CPP --- &gt; compiler itself -- &gt; optimizer -- &gt; assembler -- &gt; linker -- &gt; executable file</strong>

1. Load the relevant data code of the executable program into the corresponding section of the memory
2. Waiting for the CPU to schedule this program is to obtain the right to use the CPU
3. Operation… PostVer 0

Please login to reply. Login

1917871807qqcom • 2021-03-20 08:24:38
At the begin,program is put in the hard disk, at run time will be added into memory, that is to say, in memory data from hard drive, and CPU registers in the data is loaded from memory, the CPU will then according to the data in the corresponding instructions to register, such as addition, subtraction, multiplication, and division in order to complete a program running in the computer. PostVer 0

Please login to reply. Login

nintendolinkfoxmailcom • 2021-03-20 14:27:16
<p class="p1"><span class="s1">The CPU performs its job by continually repeating an algorithm that guides it through a three-step process known as the machine cycle.</span></p>
<p class="p1"><span class="s1">First, fetch.The computer retrieve the next instruction from memory (as indicated by the program counter) and then increment the program counter.</span></p>
<p class="p1"><span class="s1">Second, decode.The computer decode the bit pattern in the instruction register.</span></p>
<p class="p1"><span class="s1">Third, execute.The computer perform the action required by the instruction in the instruction register.</span></p> PostVer 0

Please login to reply. Login

1634605411qqcom • 2021-03-20 21:18:01
head file-&gt;cpp-&gt;preprocession-&gt;compilation-&gt;assembler-&gt;linking-&gt;execute PostVer 0

Please login to reply. Login

981193371qqcom • 2021-03-21 08:59:55
The CPU will
<ol>
<li>retrieve the next instruction from memory and then increment the program counter.</li>
<li>decode the bit pattern in instruction register.</li>
<li>perform the action required by the instruction in instruction register.</li>
</ol>
to run program execution. PostVer 0

Please login to reply. Login

3301794392qqcom • 2021-03-21 14:45:05
the program execution cycle proceeds as follows:FIRST:The CPU outputs the address of the memory location containing the required instruction (this address is kept in the program counter). Ā TheĀ address decoderĀ logic uses the address to select the RAM chip that has been allocated to this address. The address bus also connects directly to the RAM chip to select the individual location, giving a two-stage memory location select process.SECOND:The instruction code is returned to the CPU from the RAM chip via the data bus. The CPU reads the instruction from the data bus into an instruction register. The CPU then decodes and executes the instruction . The operands (code to be processed) are fetched from the following locations in RAM via the data bus, in the same way as the instruction.THIRD:The instruction execution continues by feeding the operand to the data processing logic . Additional data can be fetched from memory . The result of the operation is stored in a data register, and then, if necessary, in memory for later use. In the meantime, the program counter has been incremented (increased) to the address of the next instruction code. The address of the next instruction is then output and the sequence repeats from step SECOND.The operating system, the application program and the user data are stored in different parts of RAM during program execution, and the application program calls up operating system<span id="B9780080969114100011-p17"></span>Ā routines as required to read in, process and store the data. PC processors have multi-byte instructions, which are stored in multiple 8-bit locations, and use complex memory management techniques to speed up program execution.

<article class="snippet column">
<div class="snippet-content"></div>
</article> PostVer 0

Please login to reply. Login

1772435220qqcom • 2021-03-21 16:25:12
To start executing the program, we must first give the program counter PC the first instruction address 00H, and then enter the first instruction instruction fetching stage.

The execution process of the first instruction:

Instruction fetch stage

@ sends the contents of the program counter PC (00H) to the address register AR, marked as PC AR1

ā‘” The content of the program counter PC is automatically increased by 1 to 01H, in preparation for taking the next instruction byte, which is recorded as PC+1 PC.

ā‘¢ The address register AR sends 00H to the memory through the address bus, and decoded by the address decoder. The unit 00 is selected and marked as AR

M.

The CPU issues the "read" command.

⑤ The content BOH of selected unit 00 is read to data bus DB and denoted as (00H) DB.

ā‘„ Through the data bus DB, the read BOH is sent to the data register, marked as DB DR.

Cruelly data register DR will be sent to the instruction register IR, its content after decoding, control logic from hosting A series of control signal, which commands to DR IR, IR ID, PLA, after decoding, CPU "recognition" out of the opcode is MOV. A, 03 instructions, so it "notify" controller issued the implementation of this instruction various control commands. PostVer 0

Please login to reply. Login

1017364560qqcom • 2021-03-23 08:24:52
The CPU performs its job by continually repeating an algorithm that guide it through a three-step process known as the machine cycle.The steps in the machine cycle are fetch, decode, and execute. During the fetch step, the CPU requests that main memory provide it with the instruction that is stored at the address indicated by the program counter. Since each instruction in our machine is two bytes long, this fetch process involves retrieving the contents of two memory cells from main memory. The CPU places the instruction received from memory in its instruction register and then increments the program counter by two so that the counter contains the address of the next instruction stored in memory. Thus the program counter will be ready for the next fetch.With the instruction now in the instruction register, the CPU decodes the instruction. The CPU then executes the instruction by activating the appropriate circuitry to perform the requested task. For example, if the instruction is a load from memory, the CPU sends the appropriate signals to main memory, waits for main memory to send the data, and then places the data in the requested register. If the instruction is for an arithmetic operation, the CPU activates the appropriate circuitry in the arithmetic/ logic unit with the correct registers as inputs and waits for the arithmetic/ logic unit to compute the answer and place it in the appropriate register. Once the instruction in the instruction register has been executed, the CPU again begins the machine cycle with the fetch step. Observe that since the program counter was incremented at the end of the previous fetch, it again provides the CPU with the correct address. PostVer 0

Please login to reply. Login

1281489327qqcom • 2021-03-28 10:05:12
To start executing the program, we must first give the program counter PC the first instruction address 00H, and then enter the first instruction instruction fetching stage.

The execution process of the first instruction:

Instruction fetching stage:

ā‘  Send the contents of program counter PC (00H) to address register AR, marked as PC AR.

ā‘” The content of the program counter PC is automatically increased by 1 to 01H, in preparation for taking the next instruction byte, which is recorded as PC+1 PC.

(3) The address register AR sends 00H to memory through the address bus, decode by the address decoder, select the unit 00, and mark it as AR M.

The CPU issues the "read" command.

⑤ The content of unit 00 selected B0H is read to data bus DB and denoted as (00H) DB.

ā‘„ After the data bus DB, the read B0H is sent to the data register, marked as DB DR.

⑦ The data register DR sends its contents to the instruction register IR. After decoding, the control logic issues a series of control signals to entertain the instruction, which are recorded as DR IR, IR ID, PLA. After decoding, the CPU" recognizes "the opcode as the MOV A, 03 instruction, and it" informs "the controller to issue the various control commands that execute the instruction.

PostVer 0

Please login to reply. Login

wx287_oz26ftxkg9s80omiw6ifl9sdtr-s • 2021-03-28 16:22:46
The operating system loads the program code into memory. The program entry address is sent to PC (program counter). The CPU takes out the instruction in the memory unit pointed by PC, adds 1 to PC, and executes the instruction (which may be a transfer instruction, that is, changing the value of PC). Then the instruction in the memory unit pointed by PC is taken out, and the PC adds 1 to execute the instruction. PostVer 0

Please login to reply. Login

wx287_oz26ft4i1taklosxq83xveqlblcc • 2021-03-30 08:33:42
When starting to execute the program, you must first assign the program counter PC to the first address 00H of the first instruction, and then enter the instruction fetch stage of the fetch of the first instruction.
The execution process of the first instruction:
Instruction fetch stage:
ā‘ Send the content of the program counter PC (00H) to the address register AR and record it as PC AR.
ā‘”The content of the program counter PC is automatically incremented by 1 to become 01H, in preparation for the next instruction byte, recorded as PC + 1 PC.
ā‘¢The address register AR sends 00H to the storage through the address bus, converts by the address decoder, and puts it into unit 00, which is recorded as ARM.
ā‘£ The CPU issues a "read" command.
⑤ The content B0H of the selected unit 00 is read into the data bus DB, and it is recorded as (00H) DB.
ā‘„ Send the redirected B0H to the data register via the data bus DB, which is recorded as DB DR.
The decoding data register DR sends its content to the instruction register IR. After interruption, the control logic sends out a segment control signal to entertain the instruction, which is recorded as DR IR, IR ID, PLA. The operation code is the MOV A, 03 instruction, so it "notifies" the controller to issue various control commands to execute this instruction. PostVer 0

Please login to reply. Login

2653815589qqcom • 2021-03-30 08:53:51
The calculation program -- (compiler) -- assembly language -- machine code -- (instruction set) -- high and low level signal -- logic gate circuit -- control signal PostVer 0

Please login to reply. Login

rababboug69gmailcom • 2021-04-06 07:21:00
<b>Execution</b>Ā in computerĀ and software engineering is the process by which a computerĀ or virtual machineĀ reads and acts on the instructions of aĀ computer program.Ā Each instruction of a program is a descr iption of a particular action which must be carried out, in order for a specific problem to be solved. As the executing machine follows the instructions, specific effects are produced in accordance with theĀ semanticsĀ of those instructions.Programs for a computer may be executed in aĀ batch processĀ without human interaction or a userĀ may type commandsĀ in an interactive sessionĀ of an interpreter. In this case, the "commands" are simply program instructions, whose execution is chained together. PostVer 0

Please login to reply. Login

1115727260qqcom • 2021-04-06 10:11:47
Retrieve the next instruction from memory(as indicated by the program counter)and then increment the program couter .Decode the bit pattern in the instruction register.Perform the action required by the instruction in the instruction register. PostVer 0

Please login to reply. Login

wx287_oz26ft_ppvmz0yhrwncdglpjyuum • 2021-04-17 18:33:30
For a program to run, the computer loads the program code and may load data, initializing it into a start state, and then invoking a boot mechanism. At the lowest level, these start with a boot sequence. In most computers, the operating system, such as windows, loads and executes many programs. In this case, a computer program is a single executable mapping, not all the programs currently running on the computer. PostVer 0

Please login to reply. Login

2848519344qqcom • 2021-04-19 23:03:53
A process is a running activity of a program, which is a dynamic concept. A program is an ordered set of static instructions, a static concept. One process can execute one or more processes. A program can be used as a software resource that can be maintained for a long time, while a process is a one-time execution process. It is temporary, generated and terminated dynamically. PostVer 0

Please login to reply. Login

Reversion History

Loading...
No reversions found.