A computer program consists of instructions and data on which the instruction operates. How are the instructions of a program executed by a computer? Where are the instructions and data stored during execution? What is the role played by Input/output devices?

How Computer Work: The CPU and Memory
The Central Processing Unit: (CPU),
Buses,
Ports and controllers, ROM;
Main Memory (RAM); Input Devices; Output Devices; Secondary Storage; floppy disks,
hard disk, CD-ROM

The Central Processing Unit (CPU)
The computer does its primary work in a part of the machine we cannot see, a control center that converts data input to information output. This control center, called the central processing unit (CPU), is a highly complex, extensive set of electronic circuitry that executes stored program instructions. All computer, large and small, must have a central processing unit.
The Control Unit

• The control unit of the CPU contains circuitry that uses electrical signals to direct the entire computer system to carry out, or execute, stored program instructions. Like an orchestra leader, the control unit does not execute program instructions; rather, it directs other parts of the system to do so. The control unit must communicate with both the arithmetic/logic unit and memory.


• The Arithmetic/Logic Unit
• The arithmetic/logic unit (ALU) contains the electronic circuitry that executes all arithmetic and logical operations.


INSTRUCTION EXECUTION:
AN EXAMPLE:
“How does the Computer execute a Program?” Let us explain this with the help of an example from higher level language domain.
Problem: Write a program to add two numbers.
A sample C program (Assuming two fixed values of numbers as a = 5 and b = 2)
1. #include
2. main () 3.
{ 4. int a =5, b=2, c;
5. c= a+b;
6. printf (“\n The added value is: % d”, c); 7. }
The program at line 4 declares variables that will be equivalent to 3 memory locations namely a, b and c. At line 5 these variables are added and at line 6 the value of c is printed.
The execution of the instructions will be as follows: Fetch First Instruction into CPU:
Step 1: Find or calculate the address of the first instruction in memory: In this machine example, the next instruction address is contained in PC register. It contains 1, which is the address of first instruction to be executed.
Step 2: Bring the binary instruction to IR register. This step requires: • Passing the content of PC to Memory Address Registers so that the instruction pointed to by PC is fetched. That is location 1’s content is fetched. • CPU issues “Memory read” operation, thus, brings contents of location pointed by MAR (1 in this case) to the MBR register. • Content of MBR is transferred to IR. In addition PC is incremented to point to next instruction in sequence (2 in this case).
Step 3: The IR has the instruction LOAD A, which is decoded as “Load the content of address A in the accumulator register”.

Step 4: The address of operand that is 13, that is A, is transferred to MAR register. Step 5: The content of memory location (specified by MAR that is location 13) is transferred to MBR.
Step 6: The content of MBR is transferred to Accumulator Register. Thus, the accumulator register is loaded with the content of location A, which is 5. Now the instruction 1 execution is complete, and the next instruction that is 2 (indicated by PC) is fetched and PC is incremented to .
This instruction is ADD B, which instruct CPU to add the contents of memory location B to the accumulator. On execution of this instruction the accumulator will contain the sum of its earlier value that is A and the value stored in memory location B. On execution of the instruction at memory location 3, PC becomes 4; the accumulator results are stored in location C, that is 15, and IR still contains the third instruction.
Please note that the execution of the instructions in the above example is quite simple and requires only data transfer and data processing operations in each instruction. Also these instructions require one memory reference during its execution.
Role Play By Input Devices and Output Devices
Input is information that goes into the computer. This can be USB device, Hard Drive, Microphone. (They are information that will go IN the computer, so its called INPUT).

With output, you can send information out. So this can be connected with Scanner, Projector, Screen, Sound, etc. (They are information that will come OUT of the computer, so its called OUTPUT).

In Spanish language
Cómo funcionan las computadoras: la CPU y la memoria
La Unidad Central de Procesamiento: (CPU),
Autobuses,
Puertos y controladores, ROM;
Memoria principal (RAM); Los dispositivos de entrada; Dispositivos de salida; Almacenamiento secundario; disquetes,
disco duro, CD-ROM

La Unidad Central de Procesamiento (CPU)
La computadora hace su trabajo principal en una parte de la máquina que no podemos ver, un centro de control que convierte la entrada de datos a la salida de información. Este centro de control, denominado unidad de procesamiento central (CPU), es un conjunto de circuitos electrónicos altamente complejos y extensos que ejecuta las instrucciones del programa almacenado. Todas las computadoras, grandes y pequeñas, deben tener una unidad de procesamiento central.
La unidad de control
 

• La unidad de control de la CPU contiene circuitos que utilizan señales eléctricas para dirigir todo el sistema de la computadora para llevar a cabo, o ejecutar, las instrucciones almacenadas del programa. Al igual que un líder de orquesta, la unidad de control no ejecuta las instrucciones del programa; más bien, dirige otras partes del sistema para que lo hagan. La unidad de control debe comunicarse con la unidad aritmética / lógica y la memoria.


• La Unidad Aritmética / Lógica
• La unidad aritmética / lógica (ALU) contiene el circuito electrónico que ejecuta todas las operaciones aritméticas y lógicas.


EJECUCIÓN DE INSTRUCCIÓN:
UN EJEMPLO:
“¿Cómo ejecuta la computadora un programa?” Expliquemos esto con la ayuda de un ejemplo de dominio de lenguaje de nivel superior.
Problema: escriba un programa para agregar dos números.
Un programa de muestra C (suponiendo dos valores fijos de números como a = 5 yb = 2)
1. #include
2. main () 3.
{4. int a = 5, b = 2, c;
5. c = a + b;
6. printf (“\ n El valor agregado es:% d”, c); 7.}
El programa en la línea 4 declara variables que serán equivalentes a 3 ubicaciones de memoria, a saber, a, b y c. En la línea 5 estas variables se agregan y en la línea 6 se imprime el valor de c.
La ejecución de las instrucciones será la siguiente: Obtener la primera instrucción en la CPU:
Paso 1: Encuentre o calcule la dirección de la primera instrucción en la memoria: en este ejemplo de máquina, la siguiente dirección de instrucción se encuentra en el registro de PC. Contiene 1, que es la dirección de la primera instrucción que se ejecutará.
Paso 2: Llevar la instrucción binaria al registro IR. Este paso requiere: • Pasar el contenido de la PC a los Registros de direcciones de memoria para que se obtenga la instrucción apuntada por la PC. Es el contenido de la ubicación 1 que se busca. • La CPU emite una operación de “lectura de memoria”, por lo tanto, los contenidos de la ubicación son señalados por MAR (1 en este caso) al registro de MBR. • El contenido de MBR se transfiere a IR. Además, la PC se incrementa para apuntar a la siguiente instrucción en secuencia (2 en este caso).
Paso 3: El IR tiene la instrucción LOAD A, que se decodifica como “Cargar el contenido de la dirección A en el registro del acumulador”.
 
Paso 4: la dirección del operando que es 13, que es A, se transfiere al registro MAR. Paso 5: El contenido de la ubicación de la memoria (especificado por MAR que es la ubicación 13) se transfiere a MBR.
Paso 6: El contenido de MBR se transfiere a Acumulator Register. Por lo tanto, el registro del acumulador se carga con el contenido de la ubicación A, que es 5. Ahora se completa la ejecución de la instrucción 1, y se obtiene la siguiente instrucción que es 2 (indicada por PC) y la PC se incrementa a.
Esta instrucción es ADD B, que ordena a la CPU que agregue los contenidos de la ubicación de la memoria B al acumulador. Al ejecutar esta instrucción, el acumulador contendrá la suma de su valor anterior que es A y el valor almacenado en la ubicación de memoria B. Al ejecutar la instrucción en la ubicación de memoria 3, PC se convierte en 4; los resultados del acumulador se almacenan en la ubicación C, es decir 15, e IR todavía contiene la tercera instrucción.
Tenga en cuenta que la ejecución de las instrucciones en el ejemplo anterior es bastante simple y solo requiere transferencia de datos y operaciones de procesamiento de datos en cada instrucción. Además, estas instrucciones requieren una referencia de memoria durante su ejecución.
Juego de roles por dispositivos de entrada y dispositivos de salida
La entrada es información que entra a la computadora. Esto puede ser un dispositivo USB, Disco Duro, Micrófono. (Son información que ingresará en la computadora, por lo que se llama INPUT).

Con salida, puede enviar información. Entonces esto se puede conectar con un escáner, proyector, pantalla, sonido, etc. (Son información que saldrá de la computadora, por lo que se llama SALIDA).

IGNOU EXAM DATE SHEET DECEMBER 2017

Afflluence Writng Service

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

error: Content is protected !!