0% found this document useful (0 votes)
100 views

Microprocessor &interfaces

The document discusses how a CPU executes programs on a computer. It explains that when a program is installed, its code and data are stored on the hard drive. When the user runs the program, the code is loaded into memory. The CPU then executes the instructions step-by-step from memory. It recognizes instructions based on its instruction set. Results are stored back in memory and later saved to storage. The program is translated into machine language understandable by the CPU before execution. Machine language uses opcodes and operands to indicate operations and data locations.

Uploaded by

Mohar Singh
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
100 views

Microprocessor &interfaces

The document discusses how a CPU executes programs on a computer. It explains that when a program is installed, its code and data are stored on the hard drive. When the user runs the program, the code is loaded into memory. The CPU then executes the instructions step-by-step from memory. It recognizes instructions based on its instruction set. Results are stored back in memory and later saved to storage. The program is translated into machine language understandable by the CPU before execution. Machine language uses opcodes and operands to indicate operations and data locations.

Uploaded by

Mohar Singh
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

1(a) Following on from looking at the structure and architecture of the central processing unit itself, we shall now

look at how the CPU is used to execute programs and make the computer as a whole run smoothly and efficiently. To do this, we must take a step back from concentrating solely on the processor, and look at the complete computer unit.

A flow diagram illustrating the flow of data within the PC during program execution and the saving of data. Further explanation can be found below. When software is installed onto a modern day personal computer (most commonly from a CDROM, though other media or downloading from the internet is also common), code comprising the program and any associated files is stored on the hard drive. This code comprises of a series of instructions for performing designated tasks, and data associated with these instructions. The code remains there until the user chooses to execute the program in question, on which point sections of the code are loaded into the computers memory. The CPU then executes the program from memory, processing each instruction in turn. Of course, in order to execute the instructions, it is necessary for the CPU to understand what the instruction is telling it to do. Therefore, recognition for instructions that could be encountered needs to be programmed into the processor. The instructions that can be recognized by a processor are referred to as an 'instruction set', and are described in greater detail on the next page of the tutorial. Once the instruction has been recognized, and the actions that should be carried out are decided upon, the actions are then performed before the CPU proceeds on to the next instruction in memory. This process is called the 'instruction execution cycle', and is also covered later on in this tutorial. Results can then be stored back in the memory, and later saved to the hard drive and possibly backed up onto removal media or in seperate locations. This is the same flow of information as when a program is executed only in reverse, as illustrated in the diagram above.

When a processor is executing a program, the program is in a machine language. However, programmers almost never write their programs directly into this form. While it may not have been originally written in this way, it is translated to a machine language at some point before execution so that it is understandable by the CPU. Machine language can be directly interpreted by the hardware itself, and is able to be easily encoded as a string of binary bits and sent easily via electrical signals. The instruction set is a collection of pre-defined machine codes, which the CPU is designed to expect and be able to act upon when detected. Different processors have different instruction sets, to allow for greater features, easier coding, and to cope with changes in the actual architecture of the processor itself. Each machine code of an instruction set consists of two seperate fields: Opcode Operand(s)

The opcode is a short code which indicates what operation is expected to be performed. Each operation has a unique opcode. The operand, or operands, indicate where the data required for the operation can be found and how it can be accessed (the addressing mode, which is discussed in full later). The length of a machine code can vary - common lengths vary from one to twelve bytes in size.

Or 1(a)

ROM is the acronym for 'Read Only Memory'. ROM is an internal memory in the computer which is used to store critical information required by the computer like booting programs. They are prerecorded and are read only.

RAM is the acronym for 'Random Access Memory'. RAM is another form of internal memory. RAMs are used to store temporary programs that are currently being executed. They come in large sizes of 4GB's and higher. They are accessible and can be changed.

2(a)

You might also like