Full Transcript

SCSB1301 - COMPUTER ARCHITECTURE AND ORGANIZATION UNIT I – GENERAL REGISTERS Introduction – General Register Organization – Stack Organization – Basic Computer Organization – Instruction codes – Computer Registers – Computer Instructions – Instruction Cycle Introduction In the study of computer arc...

SCSB1301 - COMPUTER ARCHITECTURE AND ORGANIZATION UNIT I – GENERAL REGISTERS Introduction – General Register Organization – Stack Organization – Basic Computer Organization – Instruction codes – Computer Registers – Computer Instructions – Instruction Cycle Introduction In the study of computer architecture, one of the fundamental components to understand is the concept of general registers within the CPU. The CPU, or Central Processing Unit, serves as the brain of the computer, executing instructions from programs through a cycle of fetching, decoding, executing, and storing. Within the CPU, registers play a critical role by providing small, fast storage locations that hold data temporarily during instruction execution. Registers can be categorized into general-purpose registers (GPRs) and special-purpose registers. GPRs are versatile and used for a wide range of functions including arithmetic operations, temporary data storage, intermediate results, data transfer, and addressing. Components of CPU Control Unit (CU) ALU (Arithmetic Logic Unit) Memory or Storage Unit Registers Control Unit As its name implies, a control unit acts as the "brain" of the CPU. A major role of a control unit is to manage and execute instructions to perform the tasks specified by a computer program. v. A CPU executes instructions by fetching them from memory, decodes them, and then executes them. So, it plays a vital role in fetch-decode-execute instructions. Functions of Control Unit Instruction Fetch − A CU fetches instructions from RAM (Random Access Memory). Instruction Decoding − It decodes the fetched instructions to operate. Instruction Execution − A CU sends control signals to perform operations like ALU for arithmetic and logical operations. Control Flow Management − It controls flow by updating the programme counter. Exception Handling − A control unit effectively manages exceptions and interruptions like hardware failures, system calls, and external events, by appropriately diverting the control flow of the CPU to the planned procedure for managing such exceptions. Synchronization − A CU plays a crucial role in facilitating the coordination of instruction execution across several cores. Arithmetic Logic Unit (ALU) The Arithmetic Logic Unit (ALU) is a component that has been extensively optimised and engineered to do multiple tasks concurrently. It is commonly built to execute operations speedily. It works in conjunction with other CPU components, such as registers, memory, and control units, to execute complex instructions. Functions of an ALU Arithmetic Operations − The ALU can perform basic arithmetic operations. Logic Operations − The ALU can also perform logical operations like AND, OR, NOT, XOR, and bit-shifting operations. Memory Unit A memory is a hardware component which is used to store and access the data whenever required. Majorly; computer memory is categorised into two parts Primary Memory (RAM) and Secondary Memory (Hard Disk). RAM is used for short-term, fast data access and is essential for active program execution. On the other hand, storage or secondary memory provides permanent data storage. Hence, memory and storage units both are critical components of a computer system. Functions of memory Primary Memory RAM is also known as primary or temporary memory; it is a type of volatile memory used for temporarily storing data. The contents inside the RAM are erased when the computer’s power gets off or restarted. RAM is actively used for program or instruction execution. Once we start the computer; system necessary files, programs and operating system files are loaded into the RAM for the smooth running of the computer. The more RAM a computer has, the better it can handle multitasking and the faster it can run applications since data can be accessed more quickly. Functions of the CPU The key functions of a CPU are as follows − The CPU performs arithmetic and logic operations. It directs the operation of the processor. It directs Input and output units that how to respond to the instructions that have been communicated to the processor. A CPU contains registers which are considered small storage locations within the CPU to hold data temporarily during execution of a program. A CPU executes instructions by fetching them from memory, decodes them, and then executes them. General Register Organization A set of flip-flops forms a register. A register is a unique high-speed storage area in the CPU. They include combinational circuits that implement data processing. The information is always defined in a register before processing. The registers speed up the implementation of programs. Registers implement two important functions in the CPU operation are as follows − It can support a temporary storage location for data. This supports the directly implementing programs to have fast access to the data if required. It can save the status of the CPU and data about the directly implementing program. Example − Address of the next program instruction, signals get from the external devices and error messages, and including different data is saved in the registers. If a CPU includes some registers, therefore a common bus can link these registers. A general organization of seven CPU registers is displayed in the figure. The CPU bus system is managed by the control unit. The control unit explicit the data flow through the ALU by choosing the function of the ALU and components of the system. Consider R1 ← R2 + R3, the following are the functions implemented within the CPU − MUX A Selector (SELA) − It can place R2 into bus A. MUX B Selector (SELB) − It can place R3 into bus B. ALU Operation Selector (OPR) − It can select the arithmetic addition (ADD). Decoder Destination Selector (SELD) − It can transfers the result into R1. The multiplexers of 3-state gates are performed with the buses. The state of 14 binary selection inputs determines the control word. The 14-bit control word defines a micro-operation. For example: MULT R1, R2, R3 This is an instruction of an arithmetic multiplication written in assembly language. It uses three address fields R1, R2, and R3. The meaning of this instruction is: R1

Use Quizgecko on...
Browser
Browser