Docsity

Computer Architecture: Memory, Instructions, and Micro-Operations, Study Guides, Projects, Research of Architecture

Partial preview of the text

Download Computer Architecture: Memory, Instructions, and Micro-Operations and more Study Guides, Projects, Research Architecture in PDF only on Docsity!

CHAPTER-

BASIC STRUCTURE OF COMPUTER HARDWARE

Computer is a machine which accepts input information in the digitized form, process the input according to a set of stored instruction and gives an output in form understandable by humans.

Function unit : computer consist of

  1. Memory unit
  2. General add special purpose registers.
  3. Control circuits consisting of flip flops, decoders
  4. Common data and address pulse. Input unit:- Computer accept coded information through input unit and delivers the output through output unit. Memory unit:- memory unit used to store programs as well as data. It may be classified into primary storage and secondary storage. Primary storage:- It is a memory mode of up semi conductor storage cells. The these cells are grouped together in a fixed size called word. The word may be 16-bit to 64-bits. Secondary storage:- It is used to store large amount of data add program (hard disk, floppy disk, magnetic disk, optical disk). CPU:- The ALU and CU together form the control processing unit. It is known as processor (The computer performs the following functions.  Accepts program and data through input unit and store them in memory.  The store data are processed by the ALU under program control.  The process information is delivered through the logic and output unit.  The program that is to be executed is stored in memory the CPU then fetches the instructions from the memory one after another and program the required operation given by the instructions.

Input

Output

Arithmetic and logic

Control

Memory

Bus

I/O Processor

Performance:- performance is the ability of the computer and to quickly exact the program. the speed at which the computer execute the program OS design by its hardware and machine language instruction.

Basic performance mesure:-

The speed of operator of an com is generally decided by

i) Response time ii) Through put.

  1. Response time:- Response time is the time spent to complete and even or ad operation (Execution time).
  2. Through put: - Through put is the amount of work done per unit of time that is called through put.  The amount of processing a accomplished during giving interval time (Band width).  Time spent from the start of execution of a program to its completion as called elapsed.

A = 100

G = 200 time el time. C = a+b

Performance parameter:-

The basic performance parameter equation

T = (NxS)/R

Where T performance parameter of an application program N number of machine language instruction required to complete the execution required to complete the execution if an program S. Average num of basic steps required are clock rate of the processor in cycle per second.

Pipe lining and parallel processing:-

C:\ DIR:→ abc

In case of pipe lining of the instruction to a computer have executed one after another. But in case of parallel processing multiple functional unit are used to create a parallel path. True which different on completed instructions can be execution. Thus due to state of execution several instruction in every where clock cycle.

Measuring performance:-

Response time and true pull are independent entities. When measuring the performance of a system.

Performance = 1/execution time

CPU performance equation:-

The CPU are construct using the clock running at a constant time.

CPU time = CPU clock cycle for program x clock cycle time

Cycles per instructions:-

Program consists of a number of CPU instruction be represented by instruction count.

CPI = instruction Count X Clock Cycle time / clock rate

Memory location and address:-

15 A 100 100 101

110 111 1000

r index r (10)

r (1) ↓ 10

r (2) ↓ 21

r (3) ↓ 50

--- r (10)

100

The maximum size of the memory that can be used in nay computer are determine by the addressing skim. A 16 bit computer can generate a 16 bit address capable of addressing upto 2^16 K (kilobit) memory locations

232 = 4 GB

Memory operations:-

Throughput:-

Throughput is the amount of work done per unit of time. i.e. the amount of processing that can be accomplished during a given interval of time.

 It is also called as bandwidth of the system.  In general, faster response time leads to better throughput.

Elapsed time:-

 Elapsed time is a time spent from the start of execution of the program to its completion is called elapsed time.  This performance measure is affected by the clock speed of the processor and the concerned input output device.

MIPS

A nearly measure of computer performance has the rate at which a given machine executed instruction.  This is calculated by dividing the no. of instruction and the time required to run the program

CPI/IPC

CPI – Clock cycle per Instruction

IPC – Instruction per cycle.

It is another measuring that which is calculated as the number of clock cycle required to execute one instruction (cycle per instruction) by the instruction executed per cycle.

Speed up:-

Computer architecture use the speed up to describe the performance of architectural charges as different improvement are made to the system.

It is defined as ratio of execution time before to the execution time after the charge.

Speed up = execution time before Execution time after = performance of system after Execution time before

Amdahl’s law:-

This law states that “performance improvement to be gained by using a faster mode of execution is limited by the fraction of time the faster made can be used”.

Amdahl’s law defines the term speed up.

Speed up = performance of entire task using enhancement Performance of in time task without using enhancement

Performance = 1. Execution time

Speed up = execution time without using enhancement Execution time with using enhancement

Factors affecting speedup are as follows:

i) The fraction of computation time in the original machine can be modified to use the advantage of the enhancement. ii) This is called fraction enhanced which is always less than or equal to one. Fraction enhanced ≤ 1 Ex: if a program that usually it will take 30 seconds for execution using the enhancement Fraction enhanced = 30/

  1. Improvement granted by the enhanced execution made is the speed with which the taks could run faster using the enhancement.

Speed up > 1

Speed up enhanced = time in original mode Time in enhance mode

Ex. Let us a program takes 5 second in enhanced mode while it takes 10 second earlier.

So, speedup enhanced = 10/8 = 2

The new execution time can be calculated as follow:

Execution time new =

Execution time original X ((1-fraction enhanced) + fraction enhanced/speedup enhanced)

The speedup overall = execution time original/execution time new

Speedup overall = 1/(1-fraction enhancement)+fraction enhances/Speedup enhance

Performance parameter

The basic performance equation is given by T = NxS/R

Where Q.t. – Performance parameter of an application program.

NS – No. of instruction required to complete the exe^2 of a program.

CHAPTER-

INSTRUCTION AND INSTRUCTION SEQUENCING

The types of addressing modes are available with instruction set.

  1. functionality complex minimal instruction set.
  2. Instruction set based on speed of execution ‘RISC’ reduce Instruction set computer.
  3. A more elaborate instruction set that into frequently used sequence including a single processor operation.

Types of operands:-

Machine operations depends on the types of data being process. operand can be one of the following.

  1. Address
  2. Numbers
  3. Characters
  4. Logical data

Address:- Address are the for of number that represent specific location in memory.

Number data type:- Number data type are used by all machine language data type fix point floating point and decimal.

Character:- character are entered using ASCIIC. Encoding also another including character i.e. EBCDIC (Extended binary coded decimal inter change code) used for character.

Logical date:-

The Boolean data can be stored using 1(True) 0(false).

OPcode types:-

1. Arithmetic – add supply multiply divide 2. Logical – AND, OR, NOT 3. Data transfer – move, store, load, push, pop 4. Conversion – translate, convert 5. system control – reserve for operating system 6. Input output control – Input-readout – white. 7. Control transfer – Jump, returned, skip, halt.

Instruction format:- Opcode 4 bit Op1 Op 6 bit 6 bit

An instruction is read into the instruction register (IR).

OP Code Operation code Address of Operand → Format of instruction

Operation Code (OP Code) This specifies the operation to be performed. e.g. :- Add, sub & Load Address of Operand:- The operand specified by the OP code may involve one or more sources for operands. These operands are the inputs for operations. Classification of Instruction:- Instruction are classified depending upon the number of operand address they contain such as classification is follows:-

  1. 0-Address instruction :- The 0-address type instruction do not contain any operand address. The operand address are implied. e.g. :- ADD TO S ← (A+B) 2. 1-Address Instruction:- In 1-adress instruction only one operand address is specified in the instruction. The other operand is in accumulator. e.g.:- LOAD A AC ← M [A] ADD B AC ← AC+M[B] 3. 2-Address instruction:- In 2-address instruction both operand address are specified. The result is placed in one of the specified address. e.g.:-MOV R 1 , A R 1 ← M[A] ADD R1, B R 2 ← R 1 + M[B] MOV R 2 , C R 2 ← M[C] 4. 3-Address instruction:- In 3-address instruction two address are specified for two operands & one address for the result e.g.:-ADD R 1 , A, B R 1 ← M[A] + M[B] ADD R2, C, D R 2 ← M[C] + M[D] MUL *, R1, R 2 M[X] ← R 1 *R 2 Addressing technique:- To specify a memory address in an instruction word, the most obvious technique is simply to give the address in binary form. This called direct addressing, although direct addressing provides the most straight forward way to give a memory address, several other techniques are also used. The use of the these techniques is generally motivated by one of the following considerations. (1) Desire to shorten address section (2) Programmer convenience. (3) System operation facilities.

binary code of register B.

(3) In register indirect addressing address of the operand is given indirectly. The contents of the register or register pair are the address of operand.

LXIH, 2400 MOV

A, M =

Load H-L pair with 2400 H move the content of the memory location (M) whose address is in H-L pair )1, 0, 2400 H), to the contents of the accumulation.

In this example MOV A, M is an example of register indirect addressing. The address of the operand is not directly given but the address of the memory location is stored in H-L pair, which has been specified by the earlier instruction LXIH, 2400 H.

LXIH, 2200 H ADDM - Load H-L pair with 2200H add the content the memory location (M)

whose address is in H-L pair to the contents of accumulator. Here ADDM is an example of indirect addressing.

(4) Immediate addressing:- In immediate addressing the operand is given in the instruction it self. e.g. - # MV1, 06 move 06 to accumulator

ADI 05 ADD immediate 05 to the contents of a accumulator

LXIH, 2500 H

(5) Base register addressing:- In many computer system it becomes necessary to move programme from one place to another, in the memory. To solve this problem many computer use base register. The addressing mode employing a base register is known as Base register. In this mode of addressing an offset is added to the contents of the base register to obtain the effective address.

Instruction R

Operand

Memory

Instruction R

Register

Operand

Operand

Instruction

The instruction contain an offset. When a program is moved into memory. The starting address is placed in the base register.

(6) Indirect addressing:- In indirect addressing the address field of the instruction gives the address of the instruction gives the address of the operand. Control fetches the instruction from memory and uses its address port to access memory register to read the effective address. e.g. - # IAD 302 – Indirect add the number whose address is stored at the address 302.

Address

OP Code Register Address A

Instruction

Pointer to^ Operand operand

Register

Instruction

A

Operand

Register in directing addressing:- The address field refers to a resister and the effective address is the address given by the register given by of the address field.

Stack addressing:- Stack addressing in form of addressing.

Questions:

**1. Explain addressing mode.

  1. Explain the various types of instructions.**

CHAPTER-

ARITHMETIC OPERATIONS

Basic Arithmetic operations:-

The 4 basic arithmetic operations are addition subtraction, multiplication, division.

Addition:-

A full adder ckt can be uses with the help of logic gate for adder ckt. The simplest form of adder is the serial binary adder. Which adds 2 numbers bit by bit and hence required a cycle. Compute come of 2 n bit number. It consists of combinations full adder and flip flop to store ci. Output is generated to each click cycle. A carry i.e. generated is stored for using during the next clock cycle. There are ckt called parallel adder that can add all the bits of 2 number simultaneously in parallel in one clock cycle. Full adder ckt:- Flip flop is a register which storing the element

The full order ckt simple binary operation 0+0 = 00 0+1 = 01 1+0= 1+1 = 10

The 2’s complement can be obtained by taking the 1’s complement and adding one to the cost significant bit.

Ex. 011011

Msb csb

The addition and subtraction operation can be perform using one common CK1 by using an executive or gate with each full order. The control line mark m will control the operation.

Multiplication algorithm:-

Multiplication of two fixed point binary numbers in signed magnitude representation is done by a shift and add operation. If the multiplier bit is a1, the multiplicand is copied down otherwise here are copies down.

The numbers copied down in successive line are sifted one position to the left from the previous number. Finally the numbers are added and their sum forms the product. Multiplication of fixed point numbers:-

2 bit by 2 bit array multiples

Multipli land bits B11B

Multiplier bits A11A

Products C3 C2 C1 C

Partical product A0 with B1, B

Multiplication of two bits A0, B6 = 1

Otherwise = 0

Because and operation

Division algorithm:- the division of two fix point binary number in sign magnitude representation is done by process of successive compare, shift, and subtract operation.