COMPUTER ARCHITECTURE AND ORGANIZATION.pdf

Full Transcript

COMPUTER ARCHITECTURE AND ORGANIZATION COMPUTER ARCHITECT COMPUTER SYSTEM ARCHITECTURE - Determines what attributes are important for a new computer,...

COMPUTER ARCHITECTURE AND ORGANIZATION COMPUTER ARCHITECT COMPUTER SYSTEM ARCHITECTURE - Determines what attributes are important for a new computer, then design a computer to maximize performance while ARCHITECTURE staying within cost, power, and availability constraints - The practice of building design and its resulting products TASKS OF A COMPUTER ARCHITECT - Customary usage refers only to those design and Instruction set design structures that are culturally significant Functional organization ARCHITECTURE (Computer Science) Logic design implementation - A general term referring to the structure of all or part of a computer system - Covers the design of system software, such as the OS - The combination of hardware and basic software RELEVANT TOOLS, STANDARDS, AND/OR ENGINEERING that links the machines on a computer network CONSTRAINTS COMPUTER SYSTEMS ARCHITECTURE 1. Design Goals - Refers to an entire structure and to the details 2. Cost needed to make it functional 3. Performance - Covers computer systems, microprocessors, 4. Power Consumption circuits, and system programs 5. Instruction Set Architecture - Implies how the elements of a computer fit DESIGN GOALS together - The precise shape of a computer system is determined b the COMPUTER ORGANIZATION constraints and objectives for which it was designed. - Represents the implementation of the computer VARIABLES IN DESIGN architecture - Refers to the computer’s implementation in terms Standards of its actual hardware Cost Memory Space Latency FACTORS AFFECTING THE COMPUTER DESIGNER Throughput Features Architecture Scale System Weight Organization Reliability Tools Expandability - Refer to a range of software products, from Power Consumption packages that perform hardware design at circuit level, to computer simulator, to suites of programs COST used as benchmarks or test cases to compare the - Generally kept constant and are dictated by device or speeds of different computers commercial criteria Applications - Refer to the end users of the computer PERFORMANCE Technology - Indicates the importance of the processes used to CLOCK SPEED manufacture computer components - The number of cycles per second that the CPU’s main clock runs at. COMPUTER TECHNOLOGIES - Often used to describe a computers output in MHz or GHz Application - A system with a higher clock rate does not always Buses mean it will work better - Affects the performance of a computer in terms of structure, organization, and control SPEED OF A COMPUTER Magnetic Materials - Amount of cache a processor has - Used for hard disks Peripherals PROCESSOR Optical Technology - Used for CD-ROMS, DVD, Blu-ray drives and - The faster the processor runs, the higher its speed network links and the larger its cache Semiconductor Technology THINGS THAT AFFECT THE SPEED OF A COMPUTER - Used to fabricate the processor and its main memory Number of functional units in the system Device Technologies Bus speed - Determine the speed of the computer and the Usable memory capacity of its memory system Type and order of instructions in the program being executed TWO MAIN TYPES OF SPEED OF A COMPUTER 1951 1. LATENCY - Eckert and Mauchly built the UNIVAC (Universal - Refers to the interval between the start of a process Automatic Computer) that can calculate 10,000 and its completion addition per second. INTERRUPT LATENCY VACUUM TUBE - Refers to the system’s guaranteed optimal response - An electronic tube about the size of light bulbs, time to an electronic event used as the internal computer components. LOW INTERRUPT LATENCY PROBLEMS OF USING VACUUM TUBES -Needed by computers that control machinery to Generates a great deal of heat causing many problems in prevent system failure as they work in real-time regulation and climate control environment. Burnt out frequently 2. THROUGHPUT People operating the computer did not know that the problem - Refers to the sum of work completed per unit of time. was in the programming machine PERFORMANCE DEPENDING ON THE APPLICATION DOMAIN SECOND GENERATION COMPUTERS (1965 – 1963) - Other metrics may be used to assess a computer’s success. A FAMOUS COMPUTER SCIENTISTS DURING THIS ERA device may be: CPU Bound (numerical calculation) John Bardeer I/O Bound (web serving application) Walter Houser Brattain Memory Bound (database application) William Shockley BENCHMARKING ATTEMPT TRANSISTOR - The process of running a series of tests on a computer - Used in the 2nd generation computers program, a set of programs, or other operations, in order to - Smaller than vacuum tubes assess the relative performance of a computer. - Consumes less energy - May reveal strengths, but it may not aid in the selection of a - No warmup time is needed computer - Generated much less heat - Example: other device may be better at handling science - Faster and more reliable applications than another at playing common video games THIRD GENERATION COMPUTERS (1964 – 1971) - Designers have also been known to include special features in their products that allow a particular benchmark to run quickly 1964 but do not provide similar benefits for other more general - The IBM 370 series was introduced, and it came in tasks several model and sizes. - Was used for business and scientific programs - Other computer models introduced were CDC 7600 EVOLUTION OF COMPUTERS and B2500 THE EARLY YEARS COUNTING MACHINE INVENTIONS YEAR NAME 200 BC Chinese Abacus SILICONE CHIPS / INTEGRATED CIRCUIT 500 BC Egyptian Abacus - Manufactured in 1961 at Silicone Valley 1620 Napier’s Bone (John Napier) 1653 Pascaline (Blaise Pascal) MICROCHIP 1673 Leibniz’s (Gottfried Wilhelm - A device that replaced the Magnetic Core Memory Von Leibniz) 1801 Weaving loom (Joseph Marie INTEGRATED CIRCUIT TECHNOLOGY Jacquard) - Used in 3rd generation computers that reduced the 1823 Mechanical Calculator Machine size and cost of computers (Charles Babbage) 1941 Mark 1 (Harvard University) ADVANTAGES OF INTEGRATED CIRCUIT (IC) Reliable, compact, and cheaper FIRST GENERATION COMPUTERS (1941 – 1956) Hardware and software are sold separately which created the software industry 1941 Customer service industry flourished (reservation and credit - Huge, slow, expensive, and often unreliable checks) SOFTWARE TECHNOLOGY - More sophisticated - Several programs run at the same time PRESPER ECKERT and WILLIAM MAUCHLY - Sharing computer resources - Built the ENIAC (Electronic Numerical Integrator - Support interactive processing and Computer) that uses vacuum tube FOURTH GENERATION COMPUTERS (1971 – PRESENT) - A set of named storage locations (registers, memory) - Took 55 years for the 4 generations to evolve - A set of addressing modes (ways to name location) - Hardware technology such as silicone chips, microprocessor, - A part of the processor architecture and storage devices were invented - Works as an interface between hardware and COMPUTER MODELS INVENTED IN THE 4TH GENERATION software - The entire group of commands that the processor Apple Macintosh can perform, to execute the program instructions Dell IBM Acer 1971 - Intel created the first microprocessor 1976 - Steve Jobs built the 1st Apple computer 1981 - IBM introduces its first personal computer MICROPROCESSOR INTEL 8085 ISA - A specialized chip which is developed for computer - Consist of 246 operation code and 74 instructions memory and logic - A large-scale integrated circuit which contained thousands of transistor that is capable of performing all of the functions of a computer’s CPU ADVANTAGES OF MICROPROCESSORS Computers became 100 times smaller than ENIAC Gain in speed, reliability, and storage capacity Personal and software industry boomed HOW INSTRUCTION SET ARCHITECTURE IS IMPLEMENTED? FIFTH GENERATION COMPUTERS (PRESENT AND BEYOND) MICROARCHITECTURE - Technologies are more advanced and still being developed so - The processor architecture at the hardware level that it is more efficient - Defined as the actual hardware implementation of - Contains programs which translate languages the ISA - The hardware circuitry of the processor chip that FIFTH GENERATION COMPUTERS implements one particular ISA Silicone Chips Processor Robotics Virtual Reality Intelligent Systems NEW ERA COMPUTERS - Technology of computers that are more advanced, sophisticated, and modern LATEST INVENTION OF NEW ERA Supercomputers Mainframe computers Minicomputers Personal computers Mobile computers INSTRUCTION SET ARCHITECTURE - A specific set of standardized programmer-visible interface to hardware - A set of instructions with associated argument fields, assembly syntax, and machine encoding FOUR STAGES OF THE PROGRAM COMPILATION PROCESS 1. PRE PROCESSOR will replace pre processor directives with actual code to get PURE HLL. 2. COMPILER accepts pure hll as input and converts into Assembly language as output 3. ASSEMBLER accepts assembly code as input and converts binary machine object code as output 4. LINKER links all object code files, library references and provide executable file as output GENERAL PURPOSE REGISTER ISAs 1. LOAD/STORE (0,3) - ALU instruction: 3 register, 3 operands - Special load/store instructions for accessing CLASSIFICATION OF ARCHITECTURE BASED ON ADDRESSING MODES memory - Easy to pipeline, but higher instruction count (RISC) 1. STACK ARCHITECTURE 2. REGISTER-MEMORY (1,2) - Operands implicitly on top of a stack - ALU instruction: 1 register, 2 operands 2. ACCUMULATOR ARCHITECTURE - Harder pipelining, but more compact program (x86) - One operand is implicitly an accumulator 3. MEMORY-MEMORY (2,2) or (3,3) - Essentially, this is a 1 register machine - ALU instruction: 2/3 memory, 2/3 operands 3. GENERAL PURPOSE REGISTER ARCHITECTURE - Hardest pipelining, most compact program a. REGISTER MEMORY ARCHITECTURE - Not used today (DEC VAXX) One operand can be a memory b. LOAD-STORE ARCHITECTURE OPERATION TYPES IN THE INSTRUCTION SET All operands are registers (except for OPERATOR EXAMPLES load/store) TYPE Arithmetic Integer arithmetic and logical and logical operations: add, or Data transfer Load-stores (move on machines with memory addressing) Control Branch, jump, procedure call, and return, traps System OS call, virtual memory management instructions Floating point Floating point operations: add, multiply Decimal Decimal add, decimal multiply, decimal to character conversion String String move, string compare, string search Graphics Pixel operations, compression/decompression operations COMPLEX INSTRUCTION SET COMPUTER (CISC) - Have a larger set of instructions with many addressing modes REDUCED INSTRUCTION SET COMPUTER (RISC) - Have a smaller set of instructions with few addressing modes -If it is difficult to measure, an independent tester will have great difficulty in confirming it. CONSISTENCY - If it is precisely defined and can be applied across different systems. - Should be called universality or generality to avoid confusion with repeatability. INDEPENDENCE - Independent of commercial influence TERMINOLOGY FOR COMPUTER PERFORMANCE EFFICIENCY - An indication of the fraction of time that it is doing a useful work. 𝒕𝒐𝒕𝒂𝒍 𝒕𝒊𝒎𝒆 𝒆𝒙𝒆𝒄𝒖𝒕𝒊𝒏𝒈 𝒖𝒔𝒆𝒇𝒖𝒍 𝒘𝒐𝒓𝒌 𝒐𝒑𝒕𝒊𝒎𝒂𝒍 𝒕𝒊𝒎𝒆 𝑬𝒇𝒇𝒊𝒄𝒊𝒆𝒏𝒄𝒚 = = 𝒕𝒐𝒕𝒂𝒍 𝒕𝒊𝒎𝒆 𝒂𝒄𝒕𝒖𝒂𝒍 𝒕𝒊𝒎𝒆 THROUGHPUT - A measure of the amount of work it performs per unit time. - Amount of work = instruction execution is meaningful only if the instructions are performing useful calculations. LATENCY - the delay between activating a process and the start of operation. - The waiting time RELATIVE PERFORMANCE - Refers to how one computer performs with respect to another. - The relative performance of computer A and B is the inverse of their execution times. 𝒑𝒆𝒓𝒇𝒐𝒓𝒎𝒂𝒏𝒄𝒆𝒄𝒐𝒎𝒑𝒖𝒕𝒆𝒓𝑨 𝒆𝒙𝒆𝒄𝒖𝒕𝒊𝒐𝒏 𝒕𝒊𝒎𝒆𝒄𝒐𝒎𝒑𝒖𝒕𝒆𝒓𝑩 𝑷𝒆𝒓𝒇𝒐𝒓𝒎𝒂𝒏𝒄𝒆𝑨_𝒕𝒐_𝑩 = = 𝑷𝒆𝒓𝒇𝒐𝒓𝒎𝒂𝒏𝒄𝒆𝒄𝒐𝒎𝒑𝒖𝒕𝒆𝒓𝑩 𝒆𝒙𝒆𝒄𝒖𝒕𝒊𝒐𝒏 𝒕𝒊𝒎𝒆𝒄𝒐𝒎𝒑𝒖𝒕𝒆𝒓𝑨 COMPUTER METRICS METRICS - Measures of quantitative assessment commonly used for comparing and tracking performance or production. CRITERIA OF METRICS (DAVID LILJA) LINEARITY REFERENCE MACHINE - Suggests that a metric should be linear, increasing - Previous machine, same machine without the performance of a computer by a fraction x improvement, a competitor’s machine should be reflected by an increase of fraction x in - Also called baseline machine the metric. RELIABILITY SPEEDUP RATIO - Should be reliable and correctly indicate whether one computer is faster than another. - A measure of relative performance - Also called monotonicity, an increase in the value 𝒆𝒙𝒆𝒄𝒖𝒕𝒊𝒐𝒏 𝒕𝒊𝒎𝒆 𝒐𝒏 𝒓𝒆𝒇𝒆𝒓𝒆𝒏𝒄𝒆 𝒎𝒂𝒄𝒉𝒊𝒏𝒆 of metric should indicate an increase in the speed 𝑺𝒑𝒆𝒆𝒅𝒖𝒑 𝑹𝒂𝒕𝒊𝒐 = 𝒆𝒙𝒆𝒄𝒖𝒕𝒊𝒐𝒏 𝒕𝒊𝒎𝒆 of the computer. REPEATABILITY - Always yield the same result under the same condition. EASE OF MEASUREMENT CLOCK RATE - the most obvious indicator of a computer’s performance. - The speed at which fundamental operations are carried out within the computer. - Also considered the worst metric by which to judge by the computer - A poor indicator of performance because there’s no simple relationship between clock rate and system performance across different platforms. ASSEMBLY LANGUAGE PROGRAMMING MILLIONS OF INSTRUCTIONS PER SECOND (MIPS) - Removes the discrepancy between systems with different numbers of clocks per operation by measuring instructions per second rather than clocks per second. - Tells only how fast a computer executes instructions, but doesn’t tell what is actually achieved by the instructions being executed 𝒏 𝑴𝑰𝑷𝑺 = 𝒕𝒆𝒙𝒆𝒄𝒖𝒕𝒆 × 𝟏𝟎𝟔 Where: 𝒏 is the number of instructions executed 𝒕𝒆𝒙𝒆𝒄𝒖𝒕𝒆 is the time taken to execute them MACHINE LANGUAGE - Native to a processor: executed directly by hardware - Instructions consist of binary code: 1s and 0s ASSEMBLY LANGUAGE - A programming language that uses symbolic names to represent operations, registers, and memory locations - Slightly higher-level language - Readability of instructions is better than machine language - One-to-one correspondence with machine language instructions ASSEMBLERS - Translate assembly to machine code COMPILERS - Translate high-level programs to machine code either directly or indirectly via an assembler INSTRUCTION - Each command of a program that instructs the computer what to do MAPPING BETWEEN ASSEMBLY LANGUAGE AND HIGH-LEVEL - Must be in binary format LANGUAGE INSTRUCTION SET Translating HLL programs to machine language programs is not - The set of all instructions in binary form that makes a one-to-one mapping up the computer’s machine language A HLL instruction (usually called a statement) will be translated to one or more machine language instructions MACHINE LANGUAGE INSTRUCTIONS - Usually made up of several fields that specifies different information for the computer MAJOR TWO FIELDS OF MACHINE LANGUAGE INSTRUCTIONS OPCODE FIELD - Stands for operation code and it specifies that particular operation that is to be performed - Each operation has its unique opcode OPERANDS FIELD ADVANTAGES OF HIGH-LEVEL LANGAUGES - Specify where to get the source and destination operands for the operation specified by the Program development is faster opcode. Program maintenance is easier - The source/destination of operands can be a Programs are portable constant, the memory or one of the general- WHY LEARN ASSEMBLY LANGUAGE? purpose registers Accessibility to system hardware o Assembly language is useful for implementing system software o Also useful for small embedded system applications Space and time efficiency o Understanding sources of program inefficiency o Tuning program performance ASSEMBLY VS. MACHINE CODE o Writing compact code Writing assembly programs gives the computer designer the needed deep understanding of the instruction set and how to design one To be able to write compilers for HLL, we need to be experts with the machine language. Assembly programming provides this experience ASSEMBLY VS. HIGH-LEVEL LANGUAGE ASSEMBLER - Machine resources that can be managed with these instructions - A program that converts source code programs Memory written in assembly language into object files in Programmer-accessible registers machine language - Provides a hardware/software interface POPULAR ASSEMBLER FOR THE INTEL FAMILY OF PROCESSORS TASM (Turbo Assembler for Borland) NASM (Netwide Assembler for both Windows and Linux) GNU (assembler distributed by the free software foundation) LINKER PROGRAM - Needed to produce executable files - Combines your program’s object file created by the assembler with other object files and link libraries, and produces a single executable program LINK32.EXE - The linker program provided with MASM distribution for linking 32-bit programs IRVINE32.LIB - A link library for input and output developed by KIP IRVINE - Works in Win32 console mode under MS-Windows ASSEMBLE AND LINK PROCESS - A project may consist of multiple source files - Assembler translates each source files separately into an object file - Linker links all object files together with link libraries DEBUGGER - Allows you to trace the execution of a program - Allows you to view code, memory, registers, etc. COMPUTER ARITHMETIC BINARY OVER DECIMAL EDITOR INFORMATION - Allows you to create assembly language source files - Some editors provide syntax highlighting features Handled in a computer by and can be customized as a programming electronic/electrical components environment ELECTRONIC COMPONENTS INSTRUCTION SET ARCHITECTURE Operate in binary mode - Collection of assembly/machine instruction set of BINARY MODE the machine Can only indicate 2 states (on or off ) BINARY NUMBER SYSTEM Has only 2 digits (0 and 1), and is suitable for expressing 2 possible states Computer circuits only have to handle 2 binary digits rather than ten decimal digits causing: Simpler internal circuit design Less expensive More reliable circuits EXAMPLE OF FEW DEVICES THAT WORK IN BINARY MODE COMPLEMENT OF A NUMBER BINARY ARITHMETIC - Simple to learn as binary number system BINARY ADDITION COMPLEMENT OF A BINARY NUMBER - Obtained by transforming all its 0’s and 1’s and all its 1’s and 0’s. COMPLEMENTARY METHOD OF SUBTRACTION - Additive approach of subtraction STEP 1: Find the complement of the number you are subtracting (subtrahend). BINARY SUBTRACTION STEP 2: Add this to the number from which you are taking away BINARY MULTIPLICATION (minuend). STEP 3: If there is a carry of 1, add it to obtain the result; if there is no carry, recomplement the sum and attach a negative sign. BINARY SUBTRACTION USING COMPLEMENTARY METHOD BINARY DIVISION RULES FOR BINARY DIVISION 1. Start from the left of the dividend. 2. Perform a series of subtractions in which the divisor is subtracted from the dividend. 3. If subtraction is possible, put a 1 in the quotient and subtract the divisor from the corresponding digits of dividend. 4. If subtraction is not possible (divisor greater than remainder), record a 0 in the quotient 5. Bring down the next digit to add to the remainder digits. Proceed as before in a manner similar to long division. CLASSIFICATION OF PROCESSOR 1. VON-NEUMANN ARCHITECTURE - Designed by John Von Neumann and his colleagues in 1946 - Stores program and data in same memory - Designed to overcome the limitation of previous ENIAC computer LIMITATION OF THE ENIAC COMPUTER The task of entering and altering programs for the ENIAC was extremely tedious. ADDITIVE METHOD OF MULTIPLICATION AND DIVISION - Most computers use additive methods for performing multiplication and division operations because it simplifies the internal circuit design of computer systems. RULES FOR ADDITIVE METHOD OF DIVISION 2. HARVARD ARCHITECTURE Subtract the divisor repeatedly from the dividend until the - Physically separate storage and signal pathways for result of subtraction becomes less than or equal to zero. instructions and data If result of subtraction is zero, then: - Originated from the Harvard Mark relay-based o quotient = total number of times subtraction was computer, which stored: performed Instructions on punched tape (24 buts wide) o remainder = 0 Data in electro-mechanical counters If result of subtraction is less than zero, then: - In some systems, instructions can be stored in read- o quotient = total number of times subtraction was only memory while data memory generally requires performed minus 1 read-write memory o remainder = result of the subtraction previous to the - In some systems, there is much more instruction last subtraction memory than data memory - Used in MCS-51, MIPS, etc. PROCESSOR ORGANIZATION COMPONENTS OF PROCESSOR - refers to the way a given instruction set 1. PROCESSOR CONTROL UNIT (CU) architecture is implemented in a particular - A unit that controls all activities that go on within processor the device - determines how the CPU processes instructions, 2. ARITHMETIC LOGIC UNIT manages dataflow, and interfaces with memory and - It is where all calculation and logic operations input/output devices happen - Made up of arithmetic and logic units PROCESSOR ARITHMETIC UNIT - also referred to as CPU - a sophisticated machine to process data Deals with basic arithmetic operation such - executes its native instructions over data as addition, subtraction, multiplication, and division LOGIC UNIT INTERNAL INSTRUCTIONS OF A CPU Caters to logic operations such as AND, OR, DATA TRANSFER INSTRUCTIONS NOT, NOR - Move data between registers, memory, and I/O 3. MAIN MEMORY (RAM) devices - Counted as part of the CPU, but it is not integrated ARITHMETIC INSTRUCTIONS within the microchip that carries other - Perform basic arithmetic operations on data components. LOGIC INSTRUCTIONS - Used to temporarily store data that is required for - Execute logical operation on binary data processing within the CPU CONTROL INSTRUCTIONS 4. CENTRAL PROCESSING UNIT REGISTERS - Manage the sequence of operations, including - The very first temporary memories that are jumps, branches, and calls integrated within the processor SHIFT INSTRUCTIONS - Manipulate the bit positions within registers for SEVERAL REGISTERS THAT ARE USED FOR DIFFERENT FUNCTION operations like multiplication or division by powers WITHIN THE PROCESSOR of 2 PROGRAM COUNTER STATUS REGISTER MANIPULATION - Stores the next instruction - Update flags in the status register that include MEMORY ADDRESS REGISTER (MAR) conditions such as zero, carry, overflow, or sign - Stores the address of the next instruction MEMORY DATA REGISTER (MDR) - Contains data that is to be read-written to or MEMORY SYSTEM ORGANIZATION AND ARCHITECTURE from the address CURRENT INSTRUCTION REGISTERS (IR) MEMORY - Stores instructions being executed currently - The faculty of the brain by which data or ACCUMULATOR REGISTE (AR) information is encoded, stored, and retrieved when - Used to store intermediate results that are needed. produced. 5. COMPUTER BUSES TWO CATEGORIES OF MEMORY - Pathways that data travels when the CPU is 1. VOLATILE MEMORY communication with RAM and other i/o devices - This loses data when power is switched off 3 TYPES OF COMPUTER DEVICES 2. NON-VOLATILE MEMORY - This is a permanent storage and does not lose any 1. ADDRESS BUS data when power is switched off - It carries the address of where data is going to and coming from in the RAM MEMORY HIERARCHY 2. CONTROL BUS - A pyramid structure that is commonly used to - It carries control signal data that is used to control illustrate the significant differences among memory the communication between devices types 3. DATA BUS - It carried the real data that is being transmitted MEMORY HIERARCHY SYSTEM from one location to another 6. CACHE MEMORY - Consist if all storage devices employed in a - A memory type that is used to store data that is computer system frequently used by the CPU MEMORY ACCESS METHODS - Increases the access speed of data since it is faster than the RAM RANDOM ACCESS - The ability to access memory location directly and 2 TYPES PF CACHE MEMORY in a constant amount of time, regardless of the 1. PRIMARY CACHE position of the data in memory. - Mostly integrated within the processor SEQUENTIAL ACCESS 2. SECONDARY CACHE - Allows data to be read or written in a sequence or - Can either be within or outside the processor in order 7. CPU CLOCK DIRECT ACCESS - An electronic pulse that determinates the number - A technique where data can be accessed from a of cycles that a CPU executes instructions per storage device without needing to sequentially second. traverse through other data. - The cycles are measured in Hertz - Each memory location or storage unit has a unique - The current computer processor has a speed of address, allowing the system to retrieve or store Gigahertz (billion cycles per second) data directly at that location INTERNAL INSTRUCTIONS OF A CPU MAIN MEMORY - The micro-operations that dictate how data is - Memory unit that communicates directly within the processed within the processor. CPU - The central storage unit of the computer system - A large and fast memory used to store data during computer operations - Made up od RAM and ROM RANDOM ACCESS MEMORY (RAM) CACHE MEMORY - A type of computer memory that allows data to be - The data or contents of the main memory that are read from and written to in any order, giving it its used again and again by CPU, are stored in the “random-access” capability cache memory so that we can easily access that - Loses its stored data when the system is powered data in shorter time. off - Whenever the CPU needs to access memory, it first checks the cache memory. If the data is not found READ ONLY MEMORY (ROM) in cache memory, then the CPU moves onto the - Used for storing programs tat are permanently main memory. It also transfers block of recent data resident in the computer into the cache and keeps on deleting the old data in - Needed for storing an initial program called cache to accommodate the new one bootstrap loader, which is needed to start the L1 CACHE (2kb – 64kb) computer software when power is turned off - Also known as primary cache or level 1 cache RAM TYPES - The topmost cache in the hierarchy of cache levels STATIC RAM (SRAM) of a CPU - Each cell stored bit with a 6-transistor (diode) - The fastest cache circuit - Has a smaller size and smaller delay - Retains value indefinitely, as long as it is kept L2 CACHE (256kb – 512kb) powered - Relatively insensitive to disturbances such as - Next to L1 in hierarchy electrical noise - Accessed only if the data looking for is not found in - Faster and more expensive that DRAM L1 DYNAMIC RAM (DRAM) - Typically implemented using DRAM - Each cell stores bit with a capacitor and transistor L3 CACHE (1mb – 8mb) - Value must be refreshed every 10-100 ms. - Sensitive to disturbances - That largest among all the cache, even though it is - Slower and cheaper than SRAM slower, it is still faster than the RAM ROM TYPES ASSOCIATIVE MEMORY MASKED ROM - Also known as Content Addressable Memory - Programmed with its data when the chip is (CAM) fabricated - Enables data retrieval based on the content of the PROM data rather than its specific address in memory - Programmable ROM, by the user using a standard - Allows for storage and retrieval of information by PROM programmer, by burning some special type matching a given input with stored patterns or data of fuses ASSOCIATIVE MEMORY IS ORGANIZED IN SUCH A WAY: - Once programmed, it will not be possible to program it again ARGUMENT REGISTER (A) EPROM - It contains the word to be searched - Erasable ROM, the chip can be erased and - Has n bits (one for each bit of the word) reprogrammed KEY REGISTER (K) - Programming process consists in charging some - Specifies which part of the argument word needs to internal capacitors; the UV light (method of erase) be compared with words in memory makes those capacitors to leak their charge, thus - If all bits in register are 1, the entire word should be resetting the chip compared EEPROM - Otherwise, only the bits having k bit set to 1 will be - Electrically Erasable PROM: it is possible to modify compared individual locations of the memory, leaving others ASSOCIATIVE MEMORY ARRAY unchanged; one common use of the EEPROM is in - It contains the words which are to be compared BIOS of personal computers. with the argument word AUXILIARY MEMORY MATCH REGISTER (M) - It has m bits, one bit corresponding to each word in - bulk of information is stored in the auxiliary the memory array. memory - After matching words in match, registers are set to - also called backing storage or secondary storage 1 AUXILIARY MEMORY DEVICES ▪ Memory Card Reader ▪ USB Flash Memory ▪ Media Devices ▪ External Optical Drive INPUT/OUTPUT INTERFACING AND COMMUNICATION - Refers to the interaction between a system and the external environment, typically involving the exchange of data between internal components of - Temporarily holds data being transferred a device and the outside world I/O MODULE I/O PROBLEMS - Hardware that connects the CPU with external Wide variety of peripherals devices Need I/O modules to act as a bridge between - Acts as a translator, allowing different devices to processor/memory bus and the peripherals communicate with the computer system MAJOR FUNCTION OF AN I/O MODULE CONTROL AND TIMING - To coordinate the flow of traffic between internal resources and external resources CPU COMMUNICATION - Communicate with the processor in terms of accepting commands from processor, exchange EXTERNAL DEVICES data, status reporting, and address recognition DEVICE COMMUNICATION - A device that provides a means of exchanging data - Communicate with external devices between the external environment and the DATA BUFFERING computer - Temporarily hold data being transferred between - Attaches to the computer by a link to an I/O the I/O module and external devices module ERROR DETECTION - Also referred to as a peripheral device/peripheral - Detect errors and report errors to the processor 3 CATEGORIES OF EXTERNAL DEVICES 1. HUMAN READABLE - Communicate with the computer user - Monitor, printer, keyboard, mouse 2. MACHINE READABLE - Communicate with equipment - Hard drive, CD ROM, sensors, actuators 3. COMMUNICATION - Suitable with remote devices - Modem, network, interface card PROGRAMMED I/O - One of the I/O technique other than the interrupt driven I/O and direct memory access (DMA) - The most simple type of I/O technique for the exchanges of data or any types of communication between the processor and the external devices. PROGRAMS EXECUTED BY THE PROCESSOR TO CONTROL I/O OPERATION EXTERNAL DEVICE INTERFACE Sensing device status Sending a read or write command CONTROL SIGNAL Transferring data - Determine the function that the device will perform (READ/WRITE) OPERATION OF THE PROGRAMMED I/O DATA - In the form of a set of bits to be sent to The processor is executing a program and encounters an or received from the i/o module instruction relating to i/o operation STATUS SIGNAL The processor then executes that instruction by issuing a - Indicates the state of the device (READY, command to the appropriate I/O module NOT READY) The I/O module will perform the requested action based on CONTROL LOGIC the I/o command issued by the processor (READ/WRITE) and - Associated with the device, controls the set the appropriate bits in the I/O status register device operation in response to The processor will periodically check the status of the I/O direction from the i/o module until it finds that the operation is complete TRANSDUCER - Converts data from electrical to other form of energy during output and from other forms to electrical during input BUFFER Usually done by the hardware manufacturer/OS maker, e.g. Microsoft 2 MAIN PROBLEMS OF INTERRUPT I/O 1. There are multiple I/O module, how should the processor determine the device that issued the interrupt signal? 2. How does the processor decide which module to process when multiple interrupts have occurred? 4 MAIN WAYS TO COUNTER THE PROBLEMS 1. Multiple Interrupt Lines 2. Software Poll 3. Daisy Chain (Hardware Poll, Vectored) 4. Bus Arbitration (vectored) DIRECT CACHE MEMROY ACCESS CACHE MEMORY - A small, high-speed RAM buffer located between the CPU and main memory - Accelerates your computer while keeping the price low ADVANTAGES OF CACHE MEMORY INTERRUPT DRIVERS I/O The main memory is slower than cache memory It creates a way for fast data transfers, so it consumed less - A method of managing i/o activity where a access time as compared to main memory peripheral device signals the need for data transfer, It stores frequently access that can be executed within a short triggering a program interrupt period of time - The processor responds by entering an interrupt service routine, which handles the request based DISADVANTAGES OF CACHE MEMORY on the system’s interrupt levels and priorities - While this technique demands more complex It is limited capacity memory hardware and software, it greatly improves the It is very expensive as compared to RAM and hard disk efficiency of the computer’s time and resources FOR INPUT DIRECT ACCESS MEMORY (DMA) - The device interrupts the CPU when new data has - A feature of computerized systems that allows arrived and is ready to be retrieved by the system certain hardware subsystems to access main system processor. The actual actions to perform depend on memory independently of the CPU whether the device uses I/O ports or memory - Provides data access to the memory while the mapping microprocessor is temporarily disabled FOR OUTPUT - Both CPU and DMA controller have access to main memory via a shared system bus having data, - The device delivers an interrupt either when it is address and control lines ready to accept new data or to acknowledge - Sometimes referred to as a channel successful data transfer. Memory-mapped and DMA-capable devices usually generate interrupts to DMA CONTROLLER tell the system they are done with the buffer - A special interface circuit that connects I/O devices BASIC OPERATIONS OF INTERRUPT to the system bus - May be incorporated directly into the I/O device 1. CPU issues read command 2. I/O module gets data from peripheral whilst CPU does other DMA TRANSFER work - Used to do high-speed memory-to-memory 3. I/O module interrupts CPU, CPU requests data transfer 4. I/O module transfers data - Can be done in two ways ADVANTAGES Fast Efficient DISADVANTAGES Can be tricky to write if using a low-level language Can be tough to get various pieces to work well together

Use Quizgecko on...
Browser
Browser