computer architecture (cs-213)€¦ · a simple computer architecture • a portion of input to the...

26
Computer Architecture (CS-213)

Upload: others

Post on 12-May-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Computer Architecture (CS-213)

Page 2: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Main Objectives

• A Simple Computer Architecture • Instruction Set Architecture • Storage Resources • Instruction formats • Instruction Specifications • Single Cycle Hardwired Control & Isuues • Multiple cycle Hardwired Control

Page 3: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

A Simple Computer Architecture • A portion of input to the processor consists of sequence of

instructions • Instructions are usually stored in memory which is either RAM

or ROM • It is necessary to provide the address of the instruction placed

in memory. • The address comes from a register called Program Counter

(PC). • PC has the logic of a counter and capability of parallel load. • Executing an instruction means activating the necessary

sequence of micro-operations in the datapath required to perform the operation specified by the instruction.

Page 4: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Instruction Set Architecture

• Program is a set of instructions that specifies the operation to be performed.

• An instruction is a collection of bits that instructs the computer to perform a specific operation.

• Collection of instructions is called an instruction set. • The thorough description of instruction set is called an

instruction set architecture (ISA). • ISA is the way how a programmer sees the computer.

Page 5: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Instruction Set Architecture

• There are three main components to an Instruction set architecture Storage resources Instruction formats Instruction specifications

Page 6: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Storage resources

• The architecture includes two memories one for storage of information and the other for storage of data.

• These memories can be different or same memories. • The diagram below shows the resources of storage seen by

the programmer

Page 7: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Instruction formats

• Instruction is made up of various fields. • Operation code (usually called opcode) is a field which

specifies which operation is to be performed on the data. • The number of bits representing the opcode are dependent

upon how many insructions we want to make. • ‘m’ opcode bit can allow maximum of 2 instructions to be

made. • Operands field specify the data or its location on which the

operation is performed.

Page 8: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Instruction formats

• For the simple computer following three formats are illustrated.

Register

Immediate

Jump & Branch

Page 9: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Instruction Specifications

• Instruction specifications describe each of different instruction that can be used.

• Mnemonics are used to represent opcode field symbolically. • Other fields such as operands are also represented

symbolically. • Assembler is used to convert this symbolic language to binary

code (Machine Level) • A computer operation is defined by instruction in program

memory while a micro-operation is the operation performed in datapath using control word. A computer operation can have more than one micro-operations.

Page 10: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Instruction Specifications

Page 11: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Instruction Specifications

Page 12: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Single Cycle Hardwired Control

Page 13: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Instruction Decoder

Page 14: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Instruction Decoder

Page 15: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Sample Instructions

Page 16: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Example

• Write Assembly Level code for 83-(2+3) • Consider • R3 contains 248. location 248 in data memory contains 2,

location 249 contains 83, and the result is to be placed in location 250,

Page 17: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Single Cycle Computer Issues

• It cannot perform complex functions e.g. Multiplication • It requires two distinct memories • Limited clock frequency based on longer worst case delay path The path I figure is 17ns which limits clock frequency to 58.8 MHz

Page 18: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Multiple Cycle Hardwired Control

• One Instruction can take more than one clock cycle. • One memory for both data and instructions. • Since one instruction remains for more than one clock cycles,

Instruction Register (IR) is used to store instruction. • Register file has invisible registers to store the temporary data

that is generated while executing longer instructions in which one instruction can have more than one microoperations.

• Register address logic is used to create the 4-bit address of register from the 3-bit address provided with the instruction.

Page 19: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Multiple Cycle Hardwired Control

Page 20: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Modified Control Word

Page 21: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Sequential Control Design

Page 22: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

ASM Chart

Page 23: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

State Table for Two Cycle Operation

Page 24: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

Load Register Indirect (LDI) Instruction

Page 25: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

ASM Chart

Instruction

ASM Chart for Shift Multiple

Instruction

Page 26: Computer Architecture (CS-213)€¦ · A Simple Computer Architecture • A portion of input to the processor consists of sequence of instructions • Instructions are usually stored

State Table of Instructions (more than two Instruction Cycle)

State Table of Instructions (more than two Instruction Cycle)