DOC-20241002-WA0000..pdf
Document Details
Uploaded by Deleted User
Tags
Full Transcript
Reference book used : 1.Computer and Organization: Subrata Ghosal 2. Computer Fundamentals- Anita Goel Unit -1 C...
Reference book used : 1.Computer and Organization: Subrata Ghosal 2. Computer Fundamentals- Anita Goel Unit -1 Computer Organisation 1.1 Personal Computer, Workstation, Server, Mainframe, Supercomputer, Embedded System 1.2 Basic building blocks – CPU, interconnection Bus, Input-Output 1.3 Internal architecture of processor – Register, ALU, Control Unit, Program Counter, Stack Pointer 1.4 Inter connection Bus structure – Data Bus, Address Bus, Control Bus 1.5 Processor Operations – Instruction cycle, Instruction fetch, Instruction decode, instruction execute, Program flow control, Processor clock, Machine cycle and State, interrupts and interrupt service routine Types of computer A computer is an electronic device wherein we need to input raw data to be processed with a set of programs to produce a desirable output. Computers have the ability to store, process and manipulate data. Prepared by: Prof. Meghavi Dave The term “computer” is derived from the Latin word compute. Which means to calculate. Computers can be categorized in two ways. Computers can either be differentiated based on their data handling capabilities or based on their sizes. If we take data handling capabilities then there are three types of computers. On the basis of data handling capabilities, the computer is of three types: 1. Analog computers 2. Digital computers 3. Hybrid computers Analog computers Analogue computers are designed to process analogue data. Analogue data is continuous data that changes continuously and cannot have discrete values. We can say that analogue computers are used where we don't need exact values such as speed, temperature, pressure and current. Analogue computers directly accept the data from the measuring device without first converting it into numbers and codes. They measure the continuous changes in physical quantity and generally render output as a reading on a dial or scale. Speedometer (Used for measuring speed.) and mercury thermometer (used to determine the temperature of body, liquid, and vapor)are examples of analog computers. Prepared by: Prof. Meghavi Dave Digital Computer These computers are designed in such a way that they can easily perform calculations and logical operations at high speed. Such a type of computer takes up raw data as input and processes it with programs stored in its memory to produce the final output. A Digital computer only understands the binary input 0 and 1, so the raw input data is converted to 0 and 1 by the computer and further processed Prepared by: Prof. Meghavi Dave by the computer to give the result or final output. Present-day modern electronic gadgets such as laptops, and desktops including smartphones are digital computers. Hybrid computer hybrid, which means made by combining two different things. Similarly, the hybrid computer is a combination of both analog and digital computers. Hybrid computers are fast like analog computers and have memory and accuracy like digital computers. So, it has the ability to process both continuous and discrete data. For working when it accepts analog signals as input then it converts them into digital Prepared by: Prof. Meghavi Dave form before processing the input data. So, it is widely used in specialized applications where both analog and digital data are required to be processed. A processor which is used in petrol pumps that converts the measurements of fuel flow into quantity and price is an example of a hybrid computer. Prepared by: Prof. Meghavi Dave Supercomputer Supercomputers are the fastest and the most expensive machines. They have high processing speed compared to other computers. The speed of the supercomputer is generally measured in FLOPS (Floating point operations per second). Some of the faster supercomputers can perform trillions of calculations per second.supercomputer are built by interconnecting thousands of processors that can work in parallel. The first supercomputer was developed by Seymour Cray in 1976. Supercomputers are used for highly calculation-intensive tasks such as weather forecasting,climate research (global warming),molecular research, biological research, nuclear research and aircraft design. They are also used in major universities, military agencies and scientific research laboratories. Some examples of supercomputers are IBM Roadrunner,Frontier and Intel ASCI red. PARAM is a series of supercomputers assembled in India by C-DAC (Center of Development of Advanced Computing), in pune. Examples of the Indian supercomputers are AIRAWAT , PARAM-Siddhi AI,Pratyush. Prepared by: Prof. Meghavi Dave Mainframe Computer Mainframe computers are designed to support hundreds or thousands of users simultaneously. They can support multiple programs at the same time. It means they can execute different processes simultaneously. These features of mainframe computers make them ideal for big organizations like banking and telecom sectors, which need to manage and process a high volume of data that requires integer operations such as indexing, comparisons, etc. Some examples of mainframe computers are CDC6600 and IBM ES000 series. Characteristics of Mainframe Computers: It can process huge amounts of data, e.g. millions of transactions in a second in the banking sector. It has a very long life. It can run smoothly for up to 50 years after proper installation. Prepared by: Prof. Meghavi Dave It gives excellent performance with large scale memory management. It has the ability to share or distribute its workload among other processors and input/output terminals. There are fewer chances of error or bugs during processing in mainframe computers. If any error occurs it can fix it quickly without affecting the performance. It has the ability to protect the stored data and other ongoing exchange of information and data. Personal Computer Desktop ,laptop,palmtop and all other tops belong to this category.essentially they are capable of executing user’s software as they are equipped with some type of operating system.inside these PCs,we would be able to locate some microprocessor which are more powerful and interfaced with larger size of memory than the Prepared by: Prof. Meghavi Dave previously described embedded system. Price-wise also they are more expensive than the embedded system and consume more electrical power to function. Personal computers are characterized by their ability for extensive user-interaction which is not offered by other large computer e.g servers,mainframe or supercomputers.This user-interaction is not limited to interactive video game but also extended to program development,spreadsheet,graphical editing and also word processing. However, essentially these PCs are single user systems. Work Stations Workstation is a single user computer that is designed for technical or scientific applications. It has a faster microprocessor, a large amount of RAM and high speed graphic adapters. It generally performs a Prepared by: Prof. Meghavi Dave specific job with great expertise accordingly, they are of different types such as graphics workstation, music workstation and engineering design workstation. Characteristics of workstation computer: It is a high-performance computer system designed for a single user for business or professional use. It has larger storage capacity, better graphics, and a more powerful CPU than a personal computer. It can handle animation, data analysis, CAD, audio and video creation and editing. Prepared by: Prof. Meghavi Dave Servers These are hardware components or software programs that are built to assist other computers termed as clients. Together this architecture is called the client-server model. The client sends a request to the server and the server responds in return with a result or a solution. This proves that these server computers are more powerful than standard computers. The main purpose of these computers is to share data and resources with other computers. Different types of servers are useful for different needs and applications. For example, cloud server, application server, database server, file server, etc. Each of these servers has a different purpose for different client needs. Embedded System Starting without mobile handsets, these embedded systems. We can locate almost every corner around us, for example ipods,automatic weighing machines, digital cameras, robots and so on. They are essentially controlled by some type of microcontrollers which are already indicated before,single-chip computers and contain all necessary hardware and software to run the system for which it is programmed. These tiny computers are generally not capable of executing any user program,which our PCs can. However they are capable of running the system designated around them.in most of the cases, they are Prepared by: Prof. Meghavi Dave battery or solar cell operated, consuming extremely less power. Their memory size and speed of executing are also at lower levels. Yet, they are essentially computers as they can compute electronically. Prepared by: Prof. Meghavi Dave Basic building blocks CPU(Central processing Unit) Central processing unit is also called the brain of the computer.CPU consists of an arithmetic logic unit(ALU) and Control unit (CU). In addition,the CPU also has a set of registers which are temporary storage areas for holding data and instructions. ALU performs the arithmetic and logic operations on the data that is made available to it.CU is responsible for organizing the processing of data and instructions.CU controls and coordinates the activity of the other units of the computer. The CPU uses the registers to store the data,instructions during processing. CPU executes the stored program instructions, i.e instruction and data are stored in memory before execution. For processing the CPU get data and instructions from the memory.it interprets the program instructions and performs the arithmetic and logic operations required for the processing of data. Then it sends the processed data or result to the memory.CPU also acts as an administrator and is responsible for supervising operations of other parts of the computer. The CPU is fabricated as a single integrated circuit (IC) chip, and is also known as the microprocessor.the microprocessor is plugged into the motherboard of the computer. Prepared by: Prof. Meghavi Dave Interconnection Bus CPU sends data, instructions and information to the components inside the computer as well as to the peripheral devices attached to it.Bus is a set of electronic signal pathways that allows information and signal to travel between components inside or outside of a computer. The different components of a computer i.e CPU,I/O unit and memory unit are connected with each other by a bus. Prepared by: Prof. Meghavi Dave The data instructions and the signals are carried between the different components via a bus.the features and functionality of a bus are as follows 1. A bus is a set of wires used for interconnection where each wire can carry one bit of data. 2. A bus width is defined by the number of wires in the bus. 3. A computer bus can be divided into two types - internal bus and external bus. 4. The internal bus connects components inside the motherboard like CPU and system memory. It is also called the system bus.interaction between processor and memory. 5. The external bus connects the different external devices,peripherals,expansion slots,I/O port and drive connection to the rest of the computer. The external bus allows various devices to be attached to the computer. It allows for the expansion of computer’s capabilities. It is generally slower than the system bus.it is also referred to as the expansion bus. Prepared by: Prof. Meghavi Dave Input/Output The user interacts with the computer via the I/O unit.The input unit accepts data from the user and the output unit provides the processed data i.e.the information to the user. The input unit converts the data that it accepts from the user, into a form that is understandable by the computer. Similarly the output unit provides the output in a form that is understandable by the user. The input is provided to the computer using input devices like keyboard,trackball and mouse. Some of the commonly used output devices are monitor and printer. Prepared by: Prof. Meghavi Dave Internal architecture of processor– Register, ALU, Control Unit, Program Counter, Stack Pointer Register Registers are high-speed storage areas within the CPU but have the least storage capacity. Registers are not referenced by their address, but are directly accessed and manipulated by the CPU during instruction execution. Registers store data, instructions,address and intermediate results of processing. Registers are often referred to as the CPU’s working memory. The data and instructions that require processing must be brought in the registers of CPU before they can be processed. For example, if two numbers are to be added, both numbers are brought in the registers in CPU. 1. Accumulator(AC) stores the result of arithmetic and logic operations. 2. Instruction Register (IR) contains the current instruction most recently fetched. 3. Program counter(PC) contains the address of the next instruction to be processed. 4. Memory Address Register (MAR) contains the address of the next location in the memory to be accessed. 5. Memory Buffer Register (MBR) temporarily stores data from memory or the data to be sent to memory. Prepared by: Prof. Meghavi Dave 6. Data register(DR) stores the operands and any other data. The number of registers and the size of each register in the CPU helps to determine the power and the speed of a CPU. The size of the register, also called word size, indicates the amount of data with which the computer can work at any given time. The bigger the size the more quickly it can process data.the size of a register may be 8,16,32 or 64 bits. For example a 32 bit CPU is one in which each register is 32 bits wide and its CPU can manipulate 32 bits of data at a time.Nowadays PCs have 32-bit or 64 bit registers. 32 bit processor and 64 bit processor are the terms used to refer to the size of the registers.Other factors remaining the same a 64 bit processor can process the data twice as fast as one with a 32-bit processor. ALU (Arithmetic logic unit) ALU consists of two units-arithmetic and logic unit The arithmetic performs arithmetic operation on the data that is made available to it. Some of the arithmetic operations supported by the arithmetic unit are - addition,subtraction,multiplication and division. Prepared by: Prof. Meghavi Dave The logic unit of ALU is responsible for performing logic operations. Logic unit performs comparisons of numbers, letters and special characters. Logic operations include testing for greater than or equal to condition. ALU performs arithmetic and logic operations and uses registers to hold the data that is being processed. Control Unit The control unit of a computer does not do any actual processing of data. It organizes the processing of data and instructions.it acts as a supervisor and controls and coordinates the activity of the other units of the computer. CU coordinates the input and output device of a computer.it directs the computer to carry out stored program instruction by communicating with ALU and the register. CU uses the instructions in the instruction register to decide which circuit needs to be activated. It also instructs the ALU to perform the arithmetic or logic operation. When a program is run the program counter register keeps track of the program instruction to be executed next. CU tells when to fetch the data and instructions,what to do, where to store the results, the sequencing of events during processing etc. CU also holds the CPU’s instruction set which is list of all operations that the CPU can perform Prepared by: Prof. Meghavi Dave The function of a (CU) can be considered synonymous with that of a conductor of an orchestra.the conductor in orchestra does not perform any work by itself but manages the orchestra and ensures that the members of orchestra work in proper coordination. Program Counter (PC) This is a 16-bit register which holds the address of the next instruction that has to be fetched from the main memory and loaded into the instruction register. The program controlling the operation is stored in the main memory and instructions are retrieved from this memory normally in order. Therefore, normally the address contained in the PC is incremented after each instruction is fetched. However, certain classes of instruction can modify the PC so that the programmer can provide for branching away from the normal program flow. Stack Pointer (SP) This is also a 16-bit register and is used by the programmer to maintain a stack in the memory while using subroutines.The stack pointer is also a register used as a memory pointer; initially, it will be called the stack pointer register to emphasize that it is a register. A stack pointer is a small register Prepared by: Prof. Meghavi Dave that stores the memory address of the last data element added to the stack or, in some cases, the first available address in the stack Inter connection Bus structure – Data Bus, Address Bus, Control Bus Data Bus The data bus provides a path for moving the data. This bus typically consists of 8,16 or 32 separate lines, each line being capable of transferring one bit. The number of lines is referred to as the width of the data bus, which is a key factor to determine the performance of the system, as the number of lines determines how many bits can be transferred at time. Address Bus The address lines are used to specify the source and destination address of the data to be read or written. For example, to read a word from the memory, the address of the desired word is put on the data lines. Control Bus Control bus transmits both the command and timing information between the system module and is used to control the functioning of various components of the computer system. The operations that the CUP has to perform are identified by the command signals,whereas the timing signals indicate the time during which the data and address are present and are valid. Prepared by: Prof. Meghavi Dave The functioning of the bus is that if a module wants to send data to another module then permission is obtained for the use of the bus and data is transferred. If a module wants to request data from another module then permission is obtained for the use of the bus transfer. The request is sent to the other module via control lines and waits for the second module to send data. Prepared by: Prof. Meghavi Dave Processor Operations – Instruction cycle, Instruction fetch, Instruction decode, instruction execute, Program flow control, Processor clock, Machine cycle and State, interrupts and interrupt service routine Instruction cycle The primary responsibility of a computer processor is to execute a sequential set of instructions that constitute a program. CPU executes instructions in a series of steps called instruction cycle A instruction cycle involves four steps Fetching: the processor fetches the instruction from the memory.The fetch 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 writes back the result of execution to the computer’s memory. Prepared by: Prof. Meghavi Dave Instruction Fetch If we now assume that the original content of the PC was that address of memory, which contains the executable program, then the memory reading by the above-mentioned process must be to fetch an instruction of the program, and the procedure is known as instruction fetch.after completion of this instruction fetch binary content of the memory location is available within the processor itself. It is needless to mention that in the next clock cycle the PC would be incremented by one and the whole process would be repeated as we shall see a little later. Instruction decode Now the processor becomes busy with instructions byte,freshly fetched from the memory, to understand what is all about. After all, for every instruction the processor must do something special as per that instruction. This concept of understanding the instruction is also known as decoding the instruction or instruction decode. The more the total number of instructions offered by the processor the more complex would be this instruction decoding unit. We shall be familiar with microprogramming and other techniques for instruction decoding and its execution. Instruction Execute From the instruction decoding module after the processor knows what to do, it immediately starts to carry out the order.this execution may be of various types, depending upon the instruction and the processor, like Fetch an operand from memory or Prepared by: Prof. Meghavi Dave Add two registers Whatever be the job, once it is executed, the procedure, which started with the increment of the PC, becomes complete. The cycle of incrementing PCs and so on. Program flow control Whatever we have discussed so far is an over-simplified discussion of processor’s basic activities.However from this discussion one may misunderstand that the software execution must be sequential and there is no chance of program branching. This notion is incorrect and Prepared by: Prof. Meghavi Dave there are procedures to control the flow of the program,which may be carried out in only one special way,by altering the value present within the PC. We have learnt so far that whatever is the content of the PC, it is emitted as the target address for the memory area.we have also learnt that with each click pulse. This PC is incremented by one.However, if this PC, at any time is loaded with a new value, then the instruction fetch world be from that freshly loaded address only, whose value is last loaded within the PC. This, essentially, is the trick of program branching-altering the value of the PC. This alternation may be for various reasons. It may be due to conditional or unconditional program branching,subroutine call or return from a subroutine. Processor clock The heart of any processor is its clock, which stats almost the moment a computer switched on.this clock is a simple digital signal producing on and off states alternately,at equal time intervals,the X-axis indicates time and the Y-axis represents DC voltage.this oscillating phenomenon generate two different edges of the clock signal, rising edge and falling edge.it would be explained how these edge or transitions may be used to increment or decrement any binary counter. Presently let us assume that the clock signal is capable of running this phenomenon. Which counter is affected by this processor? The answer is the program counter. Prepared by: Prof. Meghavi Dave Interrupts In all processors some input pin are provided through which external devices can send signals to the processor to draw its immediate attention.may be necessary to receive a byte of data or to terminate process or similar features related with the external device - which is sending external signal.the major point is it must be recognized as urgent request and the processor must leave everything whatsoever it was performing and must service the attention- drawing device immediately. These input of the processor are designed as interrupt input and the procedure through which the immediate need is fulfilled is known as interrupt handling. The number of available interrupts inputs varies from processor to processor.the minimum number is two while the maximum may be five or more. It may be noted that after servicing any interrupt, the processor must resume its original work, which was left half because of the interrupt. This is achieved through the usage of the system stack. Prepared by: Prof. Meghavi Dave Interrupt service routine(ISR) An interrupt service routine (ISR) is a software routine that hardware invokes in response to an interrupt. ISR examines an interrupt, determines how to handle it, executes it, and returns a logical interrupt value. If no further handling is required, the ISR notifies the kernel with a return value. An ISR must perform very quickly to avoid slowing down the operation of the device and the operation of all lower-priority ISRs. Although an ISR might move data from a CPU register or a hardware port into a memory buffer, generally, it relies on a dedicated interrupt thread (or task), called the interrupt service thread (IST), to do most of the required processing. If additional processing is required, the ISR returns a logical interrupt value to the kernel. Then it maps a physical interrupt number to a logical interrupt value. Prepared by: Prof. Meghavi Dave