Computer Organization and Architecture - BNCS1209
Document Details
Uploaded by DelightfulPrudence7183
ISBAT University
2020
Tags
Summary
This document provides an introduction to computer architecture and organization, covering key concepts like instructions, memory, and processing. It also discusses different types of computer organization and explains the relationship between architecture and organization.
Full Transcript
BNCS1209 – COMPUTER ORGANIZATION AND ARCHITECTURE CHAPTER 1 Introduction Bachelors of Networking and Cyber Security 2 Introduction Computer Architecture is a functional description of the design implementation and requirements of different comp...
BNCS1209 – COMPUTER ORGANIZATION AND ARCHITECTURE CHAPTER 1 Introduction Bachelors of Networking and Cyber Security 2 Introduction Computer Architecture is a functional description of the design implementation and requirements of different components of a computer, while Computer Organization provides information about the linking of different operational attributes of the computer system. © ISBAT UNIVERSITY – 2020. 12/31/2024 Differences between Computer Architecture and Computer Organization 3 What is Computer Architecture? Computer Architecture is a blueprint for design and implementation of a computer system. It refers to the overall design of a computer system, including the hardware and software components that make up the system and how they interact with each other © ISBAT UNIVERSITY – 2020. 12/31/2024 4 © ISBAT UNIVERSITY – 2020. 12/31/2024 5 Computer architecture provides the functional details and behavior of a computer system. It involves the design of the instruction set, the microarchitecture, and the memory hierarchy, as well as the design of the hardware and software components that make up the system. © ISBAT UNIVERSITY – 2020. 12/31/2024 6 Computer architecture refers to those attributes of the system that are visible to the software programmer and have a direct impact on the logical execution of a program, like the number of bits used to represent various data types, the instruction set of the computer, technique for addressing memory, method used for input, output, etc. It basically defines the system in an abstract manner and deals with the concepts that the programmer deals with directly. © ISBAT UNIVERSITY – 2020. 12/31/2024 7 The following 3 main categories are considered while considering the design of architecture: System Design (contains hardware components that are used for building the system) Instruction Set Architecture (includes all the instructions provided to the computer system) Micro Architecture( give minute detail about storage element) © ISBAT UNIVERSITY – 2020. 12/31/2024 8 NB:- Computer architecture plays a critical role in determining the overall performance, power efficiency, and scalability of a computer system. Design choices in architecture impact a system's ability to handle various workloads, support future technologies, and deliver a satisfactory user experience. - In the designing process of a computer system, the computer architecture is to be defined before the computer organization. © ISBAT UNIVERSITY – 2020. 12/31/2024 9 What is Computer Organization? Computer Organization refers to the way in which the hardware components of a computer system are arranged and interconnected. It implements the provided computer architecture and covers the "How to do?" part. Computer Organization is to be defined after the decision of the computer architecture. © ISBAT UNIVERSITY – 2020. 12/31/2024 10 Computer organization includes the physical connection component, like circuits with adder, subtractor. If we talk about CPU organization, its three types are: Single Accumulator Organization General Register Organization Stack Organization NB: Computer organization plays a crucial role in determining the overall performance and efficiency of a computer system. Designing efficient interactions between hardware components is essential for achieving optimal processing speeds and responsiveness © ISBAT UNIVERSITY – 2020. 12/31/2024 11 It just provides information that how operational attributes of a computer system are linked together and help in realizing the architectural specification of the computer. It involves the design of the interconnections between the various hardware components, as well as the design of the memory and I/O systems. The following table highlights how Computer Architecture is different from Computer Organization − © ISBAT UNIVERSITY – 2020. 12/31/2024 Differences between Computer Architecture and Computer Organization 12 Key Computer Architecture Computer Organization Computer architecture explains what a computer Computer organization explains Purpose should do. how a computer works. Computer architecture provides functional Computer organization provides Target behavior of computer system. structural relationships between parts of computer system. Computer architecture deals with high level Computer organization deals with Design design. low level design. Computer architecture assists in understanding Computer organization helps to Role the functionality of the computer. understand the exact arrangement of component of a computer. Actors in Computer architecture are hardware Actor in computer organization is Actors parts. performance. Computer architecture is designed first. Computer organization is started Order after finalizing computer architecture. Computer architecture involves the relationship Computer organization involves the © ISBAT UNIVERSITY – 2020. 12/31/2024 among logical attributes of the system like relationship among physical parts Involves 13 NOTE: The most important point that you should note here is that Computer Architecture explains what a computer should do, whereas Computer Organization explains how a computer works. © ISBAT UNIVERSITY – 2020. 12/31/2024 BASIC TERMINOLOGY 14 Input: Whatever is put into a computer system. Data: Refers to the symbols that represent facts, objects, or ideas. Information: The results of the computer storing data as bits and bytes; the words, umbers, sounds, and graphics. Output: Consists of the processing results produced by a computer. Processing: Manipulation of the data in many ways. © ISBAT UNIVERSITY – 2020. 12/31/2024 15 Memory: Area of the computer that temporarily holds data waiting to be processed, stored, or output. Storage: Area of the computer that holds data on a permanent basis when it is not immediately needed for processing. Assembly language program (ALP) –Programs are written using mnemonics Mnemonic –Instruction will be in the form of English like form © ISBAT UNIVERSITY – 2020. 12/31/2024 16 Assembler –is a software which converts ALP to MLL (Machine Level Language) HLL (High Level Language) –Programs are written using English like statements Compiler -Convert HLL to MLL, does this job by reading source program at once Interpreter –Converts HLL to MLL, does this job statement by statement © ISBAT UNIVERSITY – 2020. 12/31/2024 17 System software –Program routines which aid the user in the execution of programs eg: Assemblers, Compilers Operating system –Collection of routines responsible for controlling and coordinating all the activities in a computer system Word: In computer architecture, a word is a unit of data of a defined bit length that can be addressed and moved between storage and the computer processor © ISBAT UNIVERSITY – 2020. 12/31/2024 18 # Computer has two kinds of components: Hardware, consisting of its physical devices (CPU, memory, bus, storage devices,...) Software, consisting of the programs it has (Operating system, applications, utilities,...) © ISBAT UNIVERSITY – 2020. 12/31/2024 FUNCTIONAL UNITS 19 A computer consists of five functionally independent main parts input, memory, arithmetic logic unit (ALU), output and control unit. © ISBAT UNIVERSITY – 2020. 12/31/2024 Input devices 20 Input device accepts the coded information as source program i.e. high level language. This is either stored in the memory or immediately used by the processor to perform the desired operations. The program stored in the memory determines the processing steps. Basically the computer converts one source program to an object program. i.e. into machine language. Finally the results are sent to the outside world through output device. All of these actions are coordinated by the control unit © ISBAT UNIVERSITY – 2020. 12/31/2024 21 © ISBAT UNIVERSITY – 2020. 12/31/2024 22 The source program/high level language program/coded information/simply data is fed to a computer through input devices keyboard is a most common type. Whenever a key is pressed, one corresponding word or number is translated into its equivalent binary code over a cable & fed either to memory or processor. Joysticks, trackballs, mouse, scanners etc are other input devices © ISBAT UNIVERSITY – 2020. 12/31/2024 Memory unit: - 23 Its function into store programs and data. It is basically divided into two types 1. Primary memory 2. Secondary memory © ISBAT UNIVERSITY – 2020. 12/31/2024 24 Word: In computer architecture, a word is a unit of data of a defined bit length that can be addressed and moved between storage and the computer processor. Usually, the defined bit length of a word is equivalent to the width of the computer's data bus so that a word can be moved in a single operation from storage to a processor register. For any computer architecture with an eight-bit byte, the word will be some multiple of eight bits. © ISBAT UNIVERSITY – 2020. 12/31/2024 25 A word can contain a computer instruction, a storage address, or application data that is to be manipulated (for example, added to the data in another word space). The number of bits in each word is known as word length. Word length refers to the number of bits processed by the CPU in one go. With modern general purpose computers, word size can be 16 bits to 64 bits. The time required to access one word is called the memory access time. The small, fast, RAM units are called caches. They are tightly coupled with the processor and are often contained on the same IC chip to achieve high performance © ISBAT UNIVERSITY – 2020. 12/31/2024 26 © ISBAT UNIVERSITY – 2020. 12/31/2024 27 1. Primary memory: - Is the one exclusively associated with the processor and operates at the electronics speeds ,programs must be stored in this memory while they are being executed. The memory contains a large number of semiconductors storage cells. Each capable of storing one bit of information. These are processed in a group of fixed size called word. To provide easy access to a word in memory, a distinct address is associated with each word location. Addresses are numbers that identify memory location. © ISBAT UNIVERSITY – 2020. 12/31/2024 28 Number of bits in each word is called word length of the computer. Programs must reside in the memory during execution. Instructions and data can be written into the memory or read out under the control of processor. Memory in which any location can be reached in a short and fixed amount of time after specifying its address is called random access memory (RAM). The time required to access one word in called memory access time. Memory which is only readable by the user and contents of which can’t be altered is called read only memory (ROM) it contains operating system. © ISBAT UNIVERSITY – 2020. 12/31/2024 29 Caches are the small fast RAM units, which are coupled with the processor and are often contained on the same IC chip to achieve high performance. Although primary storage is essential it tends to be expensive. 2. Secondary memory: - Is used where large amounts of data & programs have to be stored, particularly information that is accessed infrequently. Examples: - Magnetic disks & tapes, optical disks (ie CD-ROM’s), floppies etc., © ISBAT UNIVERSITY – 2020. 12/31/2024 Arithmetic logic unit (ALU):- 30 Most of the computer operators are executed in ALU of the processor like addition, subtraction, division, multiplication, etc. the operands are brought into the ALU from memory and stored in high speed storage elements called register. Then according to the instructions the operation is performed in the required sequence. The control and the ALU are many times faster than other devices connected to a computer system. This enables a single processor to control a number of external devices such as key boards, displays, magnetic and optical disks, sensors and other mechanical controllers. © ISBAT UNIVERSITY – 2020. 12/31/2024 Output unit:- 31 These actually are the counterparts of input unit. Its basic function is to send the processed results to the outside world. Examples:- Printer, speakers, monitor etc. © ISBAT UNIVERSITY – 2020. 12/31/2024 Control unit:- 32 It effectively is the nerve center that sends signals to other units and senses their states. The actual timing signals that govern the transfer of data between input unit, processor, memory and output unit are generated by the control unit. © ISBAT UNIVERSITY – 2020. 12/31/2024 BASIC OPERATIONAL CONCEPTS 33 To perform a given task an appropriate program consisting of a list of instructions is stored in the memory. Individual instructions are brought from the memory into the processor, which executes the specified operations. Data to be stored are also stored in the memory. © ISBAT UNIVERSITY – 2020. 12/31/2024 34 Examples: - Add LOCA, R0 This instruction adds the operand at memory location LOCA, to operand in register R0 & places the sum into register. This instruction requires the performance of several steps, 1. First the instruction is fetched from the memory into the processor. 2. The operand at LOCA is fetched and added to the contents of R0 3. Finally the resulting sum is stored in the register R NB: The preceding add instruction combines a memory access operation with an ALU Operations © ISBAT UNIVERSITY – 2020. 12/31/2024 35 Transfers between the memory and the processor are started by sending the address of the memory location to be accessed to the memory unit and issuing the appropriate control signals. The data are then transferred to or from the memory © ISBAT UNIVERSITY – 2020. 12/31/2024 36 © ISBAT UNIVERSITY – 2020. 12/31/2024 37 The fig above shows how memory & the processor can be connected. In addition to the ALU & the control circuitry, the processor contains a number of registers used for several different purposes. © ISBAT UNIVERSITY – 2020. 12/31/2024 Register: 38 It is a special, high-speed storage area within the CPU. All data must be represented in a register before it can be processed. For example, if two numbers are to be multiplied, both numbers must be in registers, and the result is also placed in a register. (The register can contain the address of a memory location where data is stored rather than the actual data itself.) © ISBAT UNIVERSITY – 2020. 12/31/2024 39 The number of registers that a CPU has and the size of each (number of bits) help determine the power and speed of a CPU. For example a 32-bit CPU is one in which each register is 32 bits wide. Therefore, each CPU instruction can manipulate 32 bits of data. In high-level languages, the compiler is responsible for translating high-level operations into low-level operations that access registers. © ISBAT UNIVERSITY – 2020. 12/31/2024 Some important registers 40 © ISBAT UNIVERSITY – 2020. 12/31/2024 41 The other two registers which facilitate communication with memory are: - 1. MAR – (Memory Address Register):- It holds the address of the location to be accessed. 2. MDR – (Memory Data Register):- It contains the data to be written into or read out of the address location. © ISBAT UNIVERSITY – 2020. 12/31/2024 Instruction Format: 42 What are Computer Instructions? A computer has programs stored in its RAM in the form of 1s and 0s that are interpreted by the CPU as instructions. One word of RAM includes one instruction in the machine language. These instructions are loaded to the CPU one at a time, where they are received, decoded and implemented. © ISBAT UNIVERSITY – 2020. 12/31/2024 43 NOTE: Computer instructions are the basic components of a machine language program. They are also known as macro operations, since each one is comprised of sequences of micro operations. Each instruction initiates a sequence of micro operations that fetch operands from registers or memory, possibly perform arithmetic, logic, or shift operations, and store results in registers or memory © ISBAT UNIVERSITY – 2020. 12/31/2024 44 Instructions are encoded as binary instruction codes. Each instruction code contains an operation code, or opcode, which designates the overall purpose of the instruction (e.g. add, subtract, move, input, etc.). The number of bits allocated for the opcode determines how many different instructions the architecture supports. © ISBAT UNIVERSITY – 2020. 12/31/2024 45 In addition to the opcode, many instructions also contain one or more operands, which indicate where in registers or memory the data required for the operation is located. For example, and add instruction requires two operands, and a not instruction requires one. © ISBAT UNIVERSITY – 2020. 12/31/2024 46 The opcode and operands are most often encoded as unsigned binary numbers in order to minimize the number of bits used to store them. For example, a 4-bit opcode encoded as a binary number could represent up to 16 different operations. The control unit is responsible for decoding the opcode and operand bits in the instruction register, and then generating the control signals necessary to drive all other hardware in the CPU to perform the sequence of micro operations that comprise the instruction. © ISBAT UNIVERSITY – 2020. 12/31/2024 47 A basic computer has three instruction code formats such as: the memory reference instruction, the register reference instruction, the input-output instruction format. © ISBAT UNIVERSITY – 2020. 12/31/2024 Memory Reference Instruction 48 A memory-reference instruction uses 12 bits to specify an address and one bit to determine the addressing mode I. I is the same as 0 for direct address and to 1 for indirect address. © ISBAT UNIVERSITY – 2020. 12/31/2024 Register Reference Instruction 49 The register reference instructions are identified by the operation code 111 with a 0 in the leftmost bit (bit 15) of the instruction. It determines an operation on or a test of the AC register. An operand from memory is not required because the additional 12 bits are used to determine the operation or test to be implemented. © ISBAT UNIVERSITY – 2020. 12/31/2024 Input-Output Instruction 50 An input-output instruction does not require a reference to memory and is identified by the operation code 111 with a 1 in the leftmost bit of the instruction. The remaining 12 bits can determine the type of input- output operation or test implemented. © ISBAT UNIVERSITY – 2020. 12/31/2024 Identifying the type of instruction 51 The type of instruction is identified by the computer control from the four bits in positions 12 through 15 of the instruction. If the three opcode bits in positions 12 through 14 are not similar to 111, the instruction is a memory-reference type and the bit in position 15 is taken as the addressing mode I. If the 3-bit opcode is similar to 111, the control then examines the bit in position 15. If this bit is 0, the instruction is a register-reference type. If the bit is 1, the instruction is an input-output type. © ISBAT UNIVERSITY – 2020. 12/31/2024 THE VON NEUMANN ARCHITECTURE 52 Programming process can be easy if the program could be represented in a form suitable for storing in memory alongside the data. Then, a computer could get its instructions by reading them from memory, and a program could be set or altered by setting the values of a portion of memory. This idea is known a the stored-program concept. © ISBAT UNIVERSITY – 2020. 12/31/2024 53 © ISBAT UNIVERSITY – 2020. 12/31/2024 It consists of: 54 main memory, which stores both data and instruction An arithmetic and logic unit (ALU) capable of operating on binary data A control unit, which interprets the instructions in memory and causes them to be executed Input and output (I/O) equipment operated by the control unit © ISBAT UNIVERSITY – 2020. 12/31/2024 BUS STRUCTURES: 55 In computer architecture, a bus is a communication system that transfers data between components inside a computer, or between computers Bus structures in computer plays important role in connecting the internal components of the computer. The bus in the computer is the shared transmission medium. This means multiple components or devices use the same bus structure to transmit the information signals to each other. © ISBAT UNIVERSITY – 2020. 12/31/2024 56 At a time, only one pair of devices can use this bus to communicate with each other successfully. If multiple devices transmit the information signal over the bus at the same time, the signals overlap each other and get jumbled. © ISBAT UNIVERSITY – 2020. 12/31/2024 Bus Structure in Computer Architecture 57 A system bus has typically from fifty to hundreds of distinct lines where each line is meant for a certain function. These lines can be categorized into three functional groups i.e., data lines, address lines, and control lines. Let us discuss them one by one each. © ISBAT UNIVERSITY – 2020. 12/31/2024 58 © ISBAT UNIVERSITY – 2020. 12/31/2024 1. Data Lines 59 Data lines coordinate in transferring the data among the system components. The data lines are collectively called data bus. A data bus may have 32 lines, 64 lines, 128 lines, or even more lines. The number of lines present in the data bus defines the width of the data bus. Each data line is able to transfer only one bit at a time. So the number of data lines in a data bus determines how many bits it can transfer at a time. The performance of the system also depends on the width of the data bus © ISBAT UNIVERSITY – 2020. 12/31/2024 2. Address Lines 60 The content of the address lines of the bus determines the source or destination of the data present on the data bus. The number of address lines together is referred to as the address bus. The number of address lines in the address bus determines its width. The width of the address bus determines the memory capacity of the system. Whenever the processor has to read a word from memory, it simply places the address of the corresponding word on the address line. © ISBAT UNIVERSITY – 2020. 12/31/2024 3. Control Lines 61 The address lines and data lines are shared by all the components of the system, so there must be some means to control the use and access of data and address lines. The control signals placed on the control lines control the use and access to the address and data lines of the bus. The control signal consists of the command and timing information. Here the command in the control signal specifies the operation that has to be performed. And the timing information over the control signals specifies when the data and address information is valid. © ISBAT UNIVERSITY – 2020. 12/31/2024 The control lines include the lines for: 62 Memory Write: This command causes the data on the data bus to be placed over the addressed memory location. Memory Read: This command causes the data on the addressed memory location to be placed on the data bus. I/O Write: The command over this control line causes the data on the data bus to be placed over the addressed I/O port. I/O Read: The command over this control line causes the data from the addressed I/O port to be placed over the data bus. © ISBAT UNIVERSITY – 2020. 12/31/2024 63 Transfer ACK: This control line indicates the data has been received from the data bus or is placed over the data bus. Bus Request: This control line indicates that the component has requested control over the bus. Bus Grant: This control line indicates that the bus has been granted to the requesting component. © ISBAT UNIVERSITY – 2020. 12/31/2024 64 Interrupt Request: This control line indicates that interrupts are pending. Interrupt ACK: This control line acknowledges when the pending interrupt is serviced. Clock: This control line is used to synchronize the operations. © ISBAT UNIVERSITY – 2020. 12/31/2024 65 Thank you © ISBAT UNIVERSITY – 2020. 12/31/2024