Docsity

Computer Memory Hierarchy: A Comprehensive Guide - Prof. Okayeso, Cheat Sheet of Advanced Computer Architecture

Partial preview of the text

Download Computer Memory Hierarchy: A Comprehensive Guide - Prof. Okayeso and more Cheat Sheet Advanced Computer Architecture in PDF only on Docsity!

COMPUTER ARCHITECTURE

FOURTH YEAR ELECTRONIC 2016-

BY

Assist. Prof. Dr. EYAD I. ABBAS

COMPUTER ARCHITECTURE

Digital Computer The digital computer is a digital system that performs various computational tasks. Digital computers use the binary number system, which has two digits: 0 and 1. A binary digit is called a bit. Information is represented in digital computers in groups of bits. By using various coding techniques, groups of bits can be made to represent not only binary numbers but also other discrete symbols, such as decimal digits or letters of the alphabet. By judicious use of binary arrangements and by using various coding techniques, the groups of bits are used to develop complete sets of instructions for performing various types of computations. A computer system is sometimes subdivided into two functional entities 1- The hardware of the computer consists of all the electronic components and electromechanical devices that comprise the physical entity of the device. 2- Computer software consists of the instructions and data that the computer manipulates to perform various data-processing tasks. The system software of a computer consists of a collection of programs whose purpose is to make more effective use of the computer. The programs included in a systems software package are referred to as the operating system.

Computer Hardware The hardware of the computer is usually divided into three major parts, as shown in Fig(1):

The central processing unit (CPU) contains arithmetic and logic unit for manipulating data, a number of registers for storing data, and control circuits for fetching and executing instructions. The memory of a computer contains storage for instructions and data. It is called a random- access memory (RAM) because the CPU can access any location in memory at random and retrieve the binary information within a fixed interval of time. The input and output processor (IOP) contains electronic circuits for communicating and controlling the transfer of information between the computer and the outside world. The input and output devices connected to the computer include keyboards, printers, terminals, magnetic disk drives, and other communication devices.

Computer Organization Computer organization is concerned with the way the hardware components operate and the way they are connected together to form the computer system. The various components are assumed to be in place and the task is to investigate the organizational structure to verify that the computer parts operate as intended.

Computer Design Computer design is concerned with the hardware design of the computer. Once the computer specifications are formulated, it is the task of the designer to develop hardware for the system. Computer design is concerned with the determination of what hardware should be used and how the parts should be connected. This aspect of computer hardware is sometimes referred to as computer implementation.

Computer Architecture Computer architecture is concerned with the structure and behavior of the computer as seen by the user. It includes the information formats, the instruction set, and techniques for addressing memory. The architectural design of a computer system is concerned with the specifications of the various functional modules, such as processors and memories, and structuring them together into a computer system.

Instruction Set Architecture 1- Opcodes : Consists of : operate instructions: as logical and arithmetical instructions Data movement instructions Control instructions 2- Data types :consists of 8, 16, 32 , and 64 bits 3- Addressing modes : consists of

  • operands specified
  • next instruction to execute is specified
  • Architecture-specific
  • An instruction can use several addressing modes

Register Transfer Language Digital systems vary in size and complexity from a few integrated circuits to a complex of interconnected and interacting digital computers. Digital system design invariably uses a modular approach. The modules are constructed from such digital components as registers, decoders, arithmetic elements, and control logic. The various modules are interconnected with common data and control paths to form a digital computer system. Digital modules are best defined by the registers they contain and the operations that are performed on the data stored in them. The operations executed on data stored in registers are called

name of the 16-bit register is PC. The symbol PC(0-7) or PC(L) refers to the low-order byte and PC(8-15) or PC(H) to the high-order byte.

Information transfer from one register to another is designated in symbolic form by means of a replacement operator. The statement: 𝑅2 ← 𝑅 Denotes a transfer of the content of register Rl into register R2. It designates a replacement of the content of R2 by the content of Rl. By definition, the content of the source register Rl does not change after the transfer.

If we want the transfer to occur only under a predetermined control condition. This can be shown by means of an if-then statement. 𝐼𝑓(𝑃 = 1)𝑡ℎ𝑒𝑛(𝑅2 ← 𝑅1) where P is a control signal generated in the control section. It is sometimes convenient to separate the control variables from the register transfer operation control function by specifying a control function. 𝑃: 𝑅2 ← 𝑅 The control condition is terminated with a colon. It symbolizes the requirement that the transfer operation be executed by the hardware only if P = 1.

To separate two or more operations that is executed at the same time by using the comma as the statement: 𝑇: 𝑅2 ← 𝑅1, 𝑅5 ← 𝑅

The basic symbols of the register transfer notation are listed in Table (1) Registers are denoted by capital letters, and numerals may follow the letters. Parentheses are used to denote a part of a register by specifying the range of bits or by giving a symbol name to a portion of a register.

Bus and Memory Transfers A typical digital computer has many registers, and paths must be provided to transfer information from one register to another. The number of wires will be excessive if separate lines are used between each register and all other registers in the system. A bus structure consists of a set of common lines, one for each bit of a register, through which binary information is transferred one at a time. Control signals determine which register is selected by the bus during each particular register transfer. The multiplexers select the source register whose binary information is then placed on the bus. For example, the construction of a bus system for four registers is shown in Fig(3) Each register has four bits, numbered 0 through 3. The bus consists of four 4x1 multiplexers each having four data inputs, 0 through 3, and two selection inputs, S1 and S0.

The table(2) shows the register that is selected by the bus for each of the four possible binary values of the selection lines.

Arithmetic Microoperations The arithmetic operations are listed in the Table(3):

The multiply and divide are not listed in Table(3), these two operations are valid arithmetic operations but are not included in the basic set of microoperations. In most computers, the multiplication operation is implemented with a sequence of add and shift microoperations. Division is implemented with a sequence of subtract and shift microoperations. The digital circuit that generates the arithmetic sum of two binary numbers of any length is called a binary adder as shown in Fig(5).

The addition and subtraction operations can be combined into one common circuit by including an exclusive-OR gate with each full-adder as shown in Fig(6).

The increment microoperation adds one to a number in a register. For example, if a 4-bit register has a binary value 0110, it will go to 0111 after it is incremented. The diagram of a 4- bit combinational circuit incrementer is shown in Fig(7):

The arithmetic microoperations listed in the Table above can be implemented in one composite arithmetic circuit. The basic component of an arithmetic circuit is the parallel adder. By controlling the data inputs to the adder, it is possible to obtain different types of arithmetic operations as shown in Fig(8).

It is possible to generate the eight arithmetic microoperations listed in Table(4):

The diagram shows (Fig 9-a) one typical stage with subscript i. For a logic circuit with n bits, the diagram must be repeated n times for i = 0,1, 2,..., n - 1. The selection variables are applied to all stages. The function table in Fig.(9-b) lists the logic microoperations obtained for each combination of the selection variables.

Shift Microoperations Shift microoperations are used for serial transfer of data. The contents of a register can be shifted to the left or the right. There are three types of shifts: logical, circular, and arithmetic. The symbolic notation for the shift microoperations is shown in Table (7):

An arithmetic shift is a microoperation that shifts a signed binary number to the left or right. The arithmetic shift-left inserts a 0 into R 0 , and shifts all other bits to the left. The initial bit of Rn-1 is lost and replaced by the bit from Rn-2. A sign reversal occurs if the bit in Rn- changes in value after the shift and caused an overflow. The arithmetic shift-right leaves the sign bit unchanged and shifts the number (including the sign bit) to the right.

Ex: If the content of 8 bits register is (10100011). What is the result of the operation after executing to the register: a. shl R: shift left register by 3. b. cil R : circular shift left register by 3. c. ashl R: arithmetic shift left register by 3. d. ashr R: arithmetic shift right register by 3. Ans: (a) 00011000. (b) 00011101. (c) 00011000. Overflow (d) 11110100

A combinational circuit shifter can be constructed with multiplexers as shown in Fig(10). The 4-bit shifter has four data inputs, A 0 through A 3 , and four data outputs, H 0 through H 3. There are two serial inputs, one for shift left (IL) and the other for shift right (IR).

Instruction Codes A computer instruction is a binary code that specifies a sequence of microoperations for the computer. Instruction codes together with data are stored in memory. The computer reads each instruction from memory and places it in a control register. The control then interprets the binary code of the instruction and proceeds to execute it by issuing a sequence of microoperations. Every computer has its own unique instruction set. The ability to store and execute instructions, the stored program concept, is the most important property of a general- purpose computer. An instruction code is a group of bits that instruct the computer to perform a specific operation. It is usually divided into parts, each having its own particular interpretation. The most basic part of an instruction code is its operation part. The operation code of an instruction is a group of bits that define such operations as add, subtract, multiply, shift, and complement. The number of bits required for the operation code of an instruction depends on the total number of operations available in the computer. The simplest way to organize a computer is to have one processor register and an instruction code format with two parts. The first part specifies the operation to be performed and the second specifies an address. The memory address tells the control where to find an operand in memory. This operand is read from memory and used as the data to be operated on together with the data stored in the processor register. For a memory unit with 4096 words we need 12 bits to specify an address since 212 = 4096. If we store each instruction code in one 16-bit memory word, we have available four bits for the operation code (abbreviated opcode) to specify one out of 16 possible operations, and 12 bits to specify the address of an operand. The control reads a 16-bit instruction from the program portion of memory. It uses the 12-bit address part of the instruction to read a 16-bit operand from the data portion of memory. Fig(12) depicts this type of organization.

Computers that have a single-processor register usually assign to it the name accumulator and label it AC.

For example, operations such as clear AC, complement AC, and increment AC operate on data stored in the AC register. When the second part of an instruction immediate code specifies an operand, this type is called immediate operand. When the second part specifies the address of an operand, the instruction is said to have a direct address. The third possibility called indirect address , where the bits in the second part of the instruction designate an address of a memory word in which the address of the operand is found. One bit of the instruction code can be used to distinguish between a direct and an indirect address. As an illustration of this configuration, consider the instruction code format shown in Fig(13).

Computer Registers Computer instructions are normally stored in consecutive memory locations and are executed sequentially one at a time. The control reads an instruction from a specific address in memory and executes it. It then continues by reading the next instruction in sequence and executes it, and so on. This type of instruction sequencing needs a counter to calculate the address of the next instruction after execution of the current instruction is completed. The computer needs processor registers for manipulating data and a register for holding a memory address. These requirements dictate the register configuration are listed in Table(9) and shown in Fig(14).

Computer Instructions The basic computer has three instruction code formats, as shown in Figure. Each format has 16 bits.

The type of instruction is recognized by the computer control from the four bits in positions 12through 15 of the instruction. If the three opcode bits in positions 12 through 14 are not equal to 111, the instruction is a memory-reference type and the bit in position 15 is taken as the addressing mode J. If the 3-bit opcode is equal to 111, control then inspects 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. Note that the bit in position 15 of the instruction code is designated by the symbol J but is not used as a mode bit when the operation code is equal to

The instructions for the computer are listed in Table(10):

The set of instructions are said to be complete if the computer includes a sufficient

number of instructions in each of the following categories:

  1. Arithmetic, logical, and shift instructions.
  2. Instructions for moving information to and from memory and processor registers.
  3. Instructions that check status information to provide decision making capabilities.
  4. Input and output instructions.
  5. The capability of stopping the computer.