<<

INSTRUCTION FORMAT A program is a set of instructions that describe the steps to be performed for carrying out a computational task The program and the data, on which the program operates, are stored in main memory, waiting to be processed by the processor. This is also called the stored program concept.

Instruction ● tells perform a task ● is an elementary operation that the processor can do. ● is divided into groups called fields. ● The common fields of an instruction are ○ Operation (op) code ○ Operand code

The operation code ● represents action that the processor must execute. ● tells the processor what basic operations to perform. The operand code ● defines the parameters of the action and depends on the operation. ● specifies the locations of the data or the operand on which the operation is to be performed. ● can be data or a memory address.

E.g. format of ADD instruction

INSTRUCTION SET Instruction set is set of instructions that a processor can understand. An Instruction Set is the set of all the basic operations that a processor can do. ● The instructions in the instruction set are the languages that a processor understands. ● All programs have to communicate with the processor using these instructions. An instruction set is a part of the architecture. ● It relates to programming, instructions, registers, addressing modes, memory architecture, etc. Two processors are different if they have different instruction sets.

INSTRUCTION CYCLE The primary responsibility of a computer processor is to execute a set of instructions (program) CPU executes each instruction in a series of steps, called instruction cycle.

A instruction cycle involves four steps— ● Fetching The processor fetches the instruction from the memory. ○ The fetched instruction is placed in the Instruction Register. ○ Program Counter holds the address of next instruction to be fetched and is incremented after each fetch. ● Decoding The instruction that is fetched is broken down into parts or decoded. ○ The instruction is translated into commands so that they correspond to those in the CPU’s instruction set. ○ The instruction set architecture of the CPU defines the way in which an instruction is decoded. ● Executing The decoded instruction or the command is executed. ○ CPU performs the operation implied by the program instruction. ■ For example, if it is an ADD instruction, addition is performed. ● Storing CPU store the results of execution, to the computer’s memory.

Fig. Instruction cycle

Fig. Steps in instruction cycle

Instructions are of different categories:- ● Memory access or transfer of data between registers. ● Arithmetic operations like addition and subtraction. ● Logic operations such as AND, OR and NOT. ● Control the sequence, conditional connections, etc.

INTERCONNECTING THE UNITS OF A COMPUTER

BUS ● is a set of electronic signal pathways that allows information and signals to travel between components inside or outside of a computer. ● The different components of computer, i.e., CPU, I/O unit, and memory unit are connected with each other by a bus. ● The data, instructions and the signals are carried between the different components via a bus. Features and functionality of a bus are: ● Bus is a set of wires used for interconnection ● Each wire carry 1 bit data ● Bus width = No. of wires in the bus BUS can be divided into two types:- ● INTERNAL BUS: ○ Connects components inside motherboard (CPU & System memory) ○ Known as ● EXTERNAL BUS: ○ Connects peripherals, expansion slots, I/O ports & drives to the rest of computer. ○ Allows devices to be attached to the computer (Expansion of computer’s capabilities) ○ Known as EXPANSION BUS

Fig. Interaction between CPU and memory A system bus or expansion bus comprise of three kinds of buses — data bus, address bus and .

Fig. Interaction between CPU, memory and peripheral devices The interaction of CPU with memory and I/O devices involves all the three buses. ● The command to access the memory or the I/O device is carried by the control bus. ● The address of I/O device or memory is carried by the address bus. ● The data to be transferred is carried by the data bus. System Bus Data Bus ● Transfers data between CPU and Memory ● Bus width affect speed of computer ● Size of data bus defines size of processor ● 8-bit processor – 8 wire data bus (carry 1 /8bits of data) ● 16-bit processor – 16 wire data bus Address Bus ● Connects CPU and RAM with set of wires similar to data bus ● Width defines maximum number of memory locations the computer can address Control Bus ● Specifies whether data is to be read or written to memory etc.

Expansion Bus

Data Bus ● Transfers data between CPU and I/O devices. ● EISA: Extended Industry Standard Architecture (32 bit bus architecture) ● PCI: Peripheral Component Interconnect (for hard disks, sound cards, network cards, and graphics cards) ● AGP: Accelerated Graphics Port (for 3D and full motion video) ● USB: Universal Serial Bus Address Bus ● Carry address of different I/O devices to be accessed (eg: HDD, CD etc) Control Bus ● Carry read/write commands, status of I/O devices etc.

Ports

Connections to the bus and peripheral devices are done via ports and sockets at the sides of computer Some standard ports: ● Port for mouse, Keyboard, Monitor, Network, Modem, audio, , and USB port •Ports are physically distinguishable by their DIFFERENT shapes, size of contact pins, number of pins. The I/O ports are the external interfaces that are used to connect input and output devices like printer, modem and joystick to the computer. The I/O devices are connected to the computer via the serial and parallel ports, Universal Serial Bus (USB) port, Firewire port, etc.

Figure Interaction of serial and parallel port interfaces We can connect external devices to the ports and interfaces, which get connected to the computer’s motherboard. ● Serial Port— to connect old peripherals(modems,plotters,barcode reader) ○ A serial port transmits one bit of data through a single wire. ○ Since data is transmitted serially as single bits, serial ports provide slow speed data transmission.

● Parallel Port— to connect old printers. ○ A parallel port is an interface for connecting eight or more data wires. ○ The data flows through the eight wires simultaneously. They can transmit eight bits of data in parallel. As a result, parallel ports provide high speed data transmission

● USB Ports—to connect newer peripherals like cameras, scanners and printers to the computer. ○ feature- can use without rebooting ● Firewire is another bus, used today mostly for video cameras and external hard drives. ● RJ45 connector (called LAN or port) is used to connect the computer to a network. ○ .

Fig Ports at the rear(backside) of computer

● VGA connector for connecting a monitor. This connector interfaces with the built-in graphics card. ● Audio plugs (line-in, line-out and )-.(MIDI Musical Instruments Digital Interface port), for connecting sound speakers and the microphone. This connector interfaces with the built-in ● PS/2 port to connect mouse and keyboard into PC. ● SCSI port for connecting the hard disk drives and network connectors.

Expansion Slots They are located on the motherboard. The expansion cards are located in the expansion slots. These cards gives the computer new features or increased performance. Different expansion slots are: ● AGP(Accelerated Graphics port) slot ● PCI(Peripheral Component InterConnect ) slot - to connect audio,video and graphics.

Performance of a Computer Factors affecting performance: ● Registers - Bigger the size of register more quickly it can process data ● RAM - Larger the RAM , better Is the performance ● Bus - Higher the bus speed, better s the performance ● System clock - Clock speed defines the frequency with which a processor executes instruction ○ Greater the clock speed, better the speed of computer- greater the performance ● Cache memory - Larger the size of cache better s the performance