FCP-L2 Fundamentals of Computer Programming
FCP-L2 Fundamentals of Computer Programming
Computer
• The I/O unit consists of the input unit and the output unit.
• CPU performs calculations and processing on the input
data, to generate the output.
• The memory unit is used to store the data, the instructions
and the output information.
• Address Bus connects CPU and RAM with set of wires similar to data bus. The
width of address bus determines the maximum number of memory locations
the computer can address. Currently, Pentium Pro, II, III, IV have 36–bit address
bus that can address 236 bytes or 64 GB of memory.
• Control Bus specifies whether data is to be read or written to the memory, etc.
Fundamental of Computer Programmimg 26
Instruction Set
• A computer program is a set of instructions that describe
the steps to be performed for carrying out a computational
task.
• An instruction is designed to perform a task and is an
elementary operation that the processor can accomplish.
• An instruction is divided into groups called fields. The
common fields of an instruction are—
1. Operation (op) code
2. Operand code
• The remainder of the instruction fields differs from one
computer type to other. The operation code represents
action that the processor must execute. It tells the
processor what basic operations to perform.
• The operand code defines the parameters of the action and
depends on the operation. It specifies the locations of the
data or the operand on which the operation is to be
performed. It can beFundamental
data ofor a memory
Computer Programmimg address. 27
Fundamental of Computer Programmimg 28
Fundamental of Computer Programmimg 29
• A processor has a set of instructions that it understands, called as
instruction set.
• An instruction set or an instruction set architecture is a part of
the computer architecture. It relates to programming,
instructions, registers, addressing modes, memory architecture,
etc.
• An Instruction Set is the set of all the basic operations that a
processor can accomplish.
• The instructions in the instruction set are the language that a
processor understands. All programs have to communicate with
the processor using these instructions.
• An instruction in the instruction set involves a series of logical
operations (may be thousands) that are performed to complete
each task. The instruction set is embedded in the processor
(hardwired), which determines the machine language for the
processor.
• All programs written in a high-level language are compiled and
translated into machine code before execution, which is
understood by the processor for which the program has been
coded. Fundamental of Computer Programmimg 30
• Two processors are different if they have different
instruction sets. A program run on one computer
may not run on another computer having a
different processor.
• Two processors are compatible if the same
machine level program can run on both the
processors. Therefore, the system software is
developed within the processor’s instruction set.
• Examples