ec305.2 computer architecture

42
Good morning class

Upload: -

Post on 17-Dec-2014

370 views

Category:

Technology


7 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Ec305.2 computer architecture

Good morning class

Page 2: Ec305.2 computer architecture

week2

EC305Lecture 2: Компьютерийн бүтцийн задаргаа болон үндсэн командын

процесс

Page 3: Ec305.2 computer architecture

• Компьютерийн задаргаа

• Control and Datapaths дахь ерөнхий командын процедур

• ISA

• Control Unit үндсэн функцууд -- Read and Write Selects

Page 4: Ec305.2 computer architecture

Компьютерийг бүтцийн хувьд Von Newmann architecture :

1. Процессор

2. Санах байгууламж

3. Оролт гаралт

4. интерфейсүүд

Processor

Connections

I/O Devices

Mem

ory

Page 5: Ec305.2 computer architecture

Процессор нь үндсэн хэсгийн нэг бөгөөд = Datapath + Control

Datapath нь санах байгууламжийн дээд хэсэгт байрлах ба ж нь зарим тохиолдолд cache-уудаар дамжих нь бий. Түүнчлэн зарим нь санах байгууламжийг бүхэлд нь агуулдаг.

Datapath

(Processing ofdata accordingto instructions))

ControlUnit

Control Signals

StatusSignals

Most processors consist of a datapath and a control unit, with a large part of the control unit dedicated to regulating the interaction between the datapath and memory.

Page 6: Ec305.2 computer architecture

Өгөгдлийн хэсэгт хамаарагдах нэгжүүд

• Багц өгөгдлийн шугам

– Багц 16битийн сигнал дамжуулалтын хэсэг

– Өгөгдлийн оролтыг хянах 3 төлөвт төхөөрөмжүүд буфер мультф-р

• Багц өгөгдлийн шугамд сигнал байгааг тогтоох

• Нэг удаа зөвхөн нэг багц 16-bit) сигнал тавигдана.

• Хяналтын хэсэгт багц өгөгдлийн шугамд ямар сигнал дамжихийг шийднэ.

– Өгөгдлийг унших хэсэг

үүнд хяналтын хэсэгт өгөгдөл бичих зөвшөөрөл тавигдсан тохиолдолд регисторууд өгөгдлийг уншина.

Page 7: Ec305.2 computer architecture

• Арифметик логик хэсэг– Оролт : (IR) ийн тэмдэгтийн өргөтгөлийн битүүд эсвэл register file н гаралт – Output: өгөгдлийн багц ; used by…

• Нөхцөлд тэмдэгтийн регисторууд • Өгөгдлийн регистор • Санах байгууламж болон оролт гаралтын регисторууд

• Өгөгдлийн регистор– Өгөгдөл унших хоёр хаяглалт, нэг өгөгдөл бичих хаяглалт (тус бүр нь 3

bits)– Оролт : өгөгдлийн багцаас 16 битийн сигнал

• ALU-н үйлдлийн үр дүн эсвэл санах ой (I/O) д уншигдсан сигнал– Гаралт : 16-битийн хоёр сигналын гаралт

• Гаралт нь ALU, санах ойн хаягт • ALU хэсэгт дуудагдах командуудыг дамжуулна.

Page 8: Ec305.2 computer architecture

• Нөхцөлд логик

– ALU ээс ирэх сигналаас хамаарч N, Z, P төрлийн сигналуудыг тавина.

– сигналаар хяналтын хэсэгт N,Z,P сигнал ирснээр регисторууд уншигдана.

• Хяналтын хэсэг

– Уншигдах команд бүрийн төлөв нь дараах нөхцөлийг тогтооно үүнд :

• Өгөгдлийн шугам ?

• Өгөгдөл унших регистор ?

• ALU д ямар үйлдэл хэрэгжих ?

Lets Look at Instruction Processing next..

Page 9: Ec305.2 computer architecture

Өгөгдөл боловсруулалттай холбоотой бүхий л үйлдлүүдийн гүйцэтгэл бүхий ALU хэсгийн нэгдлийг Datapath гэж ойлгоно. Энэ нь үндсэн дараах хэсгүүдээс тогтдог:

• Data Memory• Register File • ALU Data Memory

Memory Interface (Buses + Regs)

Register File

ALU

O/P Reg.

Datapath Нэгж хугацаанд процессорт хэрэгжигдэх өгөгдөл түүгээр дамжих өгөгдөл тэдгээрийн төлөвт болон үр дүнгийн элементүүдийн нэгдлийг өгөгдлийн багц гэнэ.

Page 10: Ec305.2 computer architecture

Data Path

Filled arrow = info to be processed.

Unfilled arrow= control signal.

The data path of a computer is all the logic used to process information

CONTROL

UNIT

Page 11: Ec305.2 computer architecture

командууд

• Процессорын үндсэн хэсгийн үйлдлүүд . • бүтэц

– Opcode: operation to be performed– Operands: data/locations to be used for operation

• Encoded as a sequence of bits (just like data!)– Sometimes have a fixed length (e.g., 16 or 32 bits)– Atomic: operation is either executed completely, or not at all

Page 12: Ec305.2 computer architecture

computer science,-m instruction гэдэг нь процессорын нэг үйлдлийг хэлэх бөгөөд энэ нь командын нэгдсэн бүтцээр тодорхойлогдоно. Өргөн утгаар

тодорхойлбол bytecode бүхий гүйцэтгэгдэх програмын элементүүд бүрийн тайлбар code. Харин командын нэгдэл нь процессор эсвэл virtual machine,

interpreter зэргийн гүйцэтгэх бүхий л командуудын жагсаалт юм.

Компьютерийн командуудад нь :• Arithmetic үйлдлийн : add and subtract • Logic үйлдлийн : and, or, and not • Өгөгдлийн move, input, output, load, and store • Control flow буюу хяналтын сигналын goto, if ... goto,

call, and return.

Page 13: Ec305.2 computer architecture

• instruction set, болон instruction set architecture (ISA) нь өгөгдлийн төрлүүд, командууд, регисторууд,хаяглалтын хэлбэрүүд, санах ойн бүтэц, тасалдалт зэрэг болон гадаад өргөтгөлийн шийдэл зэрэг програмтай холбоотой компьютерийн бүтцийн нэг хэсэг юм.

Page 14: Ec305.2 computer architecture

• Machine language is built up from discrete statements or instructions. On the processing architecture, a given instruction may specify:

• Particular registers for arithmetic, addressing, or control functions

• Particular memory locations or offsets • Particular addressing modes used to interpret

the operands • More complex operations are built up by

combining these simple instructions, which (in a von Neumann machine) are executed sequentially, or as otherwise directed by control flow instructions.

Page 15: Ec305.2 computer architecture

• Some operations available in most instruction sets include:

• moving

• computing

• affecting program flow

Page 16: Ec305.2 computer architecture

Some examples of "complex" instructions include:• saving many registers on the stack at once • moving large blocks of memory • complex and/or floating-point arithmetic (sine,

cosine, square root, etc.) • performing an atomic test-and-set instruction • instructions that combine ALU with an operand

from memory rather than a register

Page 17: Ec305.2 computer architecture

Time to Complete One Instruction

• Команд тус бүрийн гүйцэтгэлийн сигналын өмнөх болон хойд фронтын давталтын тоо. It takes fixed number of clock ticks (repetition of rising or falling edge) to execute each instruction Сигнал хоорондын нэг гүйцэтгэлийн үе хоорондыг clock

cycle Тиймээс командын гүйцэтгэл бүр нэгж clock cycle-р

хэмжигдэнэ

• нэгж командын сигналын өмнөх фронтын фазын дарааллыг нэг clock

• So what determines the time between ticks i.e. the length of the clock cycle?

Page 18: Ec305.2 computer architecture

Clocking Methodology

• Defines when signals can be read and when they can be written

• It is important to specify the timing of reads and writes because, if a value is written at the same time it is read, the value of read could be old, new or mix of both

• All values are stored on clock edge (edge-triggered) i.e. within a defined interval of time (length of the clock cycle)

• In a processor, since only memory elements can store values this means that Any collection of combinational logic must have its inputs coming

from a set of memory elements and its outputs written into a set of memory elements

Page 19: Ec305.2 computer architecture

• The length of the clock cycle is determined as follows:

• The time necessary for the signals to reach memory element 2 defines the length of the clock cycle i.e. minimum clock cycle time must be at least as great as the

maximum propagation delay of the circuit

Page 20: Ec305.2 computer architecture

Instruction Processing

DECODE instructionDECODE instruction

EVALUATE ADDRESSEVALUATE ADDRESS

FETCH OPERANDSFETCH OPERANDS

EXECUTE operationEXECUTE operation

STORE resultSTORE result

FETCH instruction from mem.FETCH instruction from mem.

Page 21: Ec305.2 computer architecture

Instruction Processing: FETCH

• Idea– Put next instruction in IR & increment PC

• Steps– Load contents of PC into MAR– Increment PC– Send “read” signal to memory– Read contents of MDR, store in IR

EAEA

OPOP

EXEX

SS

FF

DD

Page 22: Ec305.2 computer architecture

FETCH

Load PC into MAR (inc PC)

Control

Data

CONTROL

UNIT

Page 23: Ec305.2 computer architecture

FETCH

Load PC into MAR

Read Memory

Control

Data

CONTROL

UNIT

Page 24: Ec305.2 computer architecture

FETCH

Load PC into MAR

Read Memory

Copy MDR into IR

Control

Data

CONTROL

UNIT

Page 25: Ec305.2 computer architecture

Instruction Processing: DECODE

• Identify opcode– In LC-3, always first four bits of instruction– 4-to-16 decoder asserts control line corresponding

to desired opcode

• Identify operands from the remaining bits– Depends on opcode

e.g., for LDR, last six bits give offsete.g., for ADD, last three bits name source operand #2

EAEA

OPOP

EXEX

SS

FF

DD

Page 26: Ec305.2 computer architecture

DECODE

CONTROL

UNITDecoding usually a part of the Control Unit but can be seperate

Page 27: Ec305.2 computer architecture

Instruction Processing: EVALUATE ADDRESS

• Compute address– For loads and stores – For control-flow instructions

• Examples– Add offset to base register (as in LDR)– Add offset to PC (as in LD and BR)

EAEA

OPOP

EXEX

SS

FF

DD

Page 28: Ec305.2 computer architecture

EVALUATE ADDRESS

Load/Store

CONTROL

UNIT

Page 29: Ec305.2 computer architecture

Instruction Processing: FETCH OPERANDS

• Get source operands for operation

• Examples– Read data from register file (ADD)– Load data from memory (LDR)

EAEA

OPOP

EXEX

SS

FF

DD

Page 30: Ec305.2 computer architecture

FETCH OPERANDS

ADD

CONTROL

UNIT

Page 31: Ec305.2 computer architecture

FETCH OPERANDS

LDR

CONTROL

UNIT

Page 32: Ec305.2 computer architecture

Instruction Processing: EXECUTE

• Actually perform operation

• Examples– Send operands to ALU and assert ADD signal– Do nothing (e.g., for loads and stores)

EAEA

OPOP

EXEX

SS

FF

DD

Page 33: Ec305.2 computer architecture

EXECUTE

ADD

CONTROL

UNIT

Page 34: Ec305.2 computer architecture

Instruction Processing: STORE

• Write results to destination– Register or memory

• Examples– Result of ADD is placed in destination reg.– Result of load instruction placed in destination reg.– For store instruction, place data in memory

• Set MDR

• Assert WRITE signal to memory

EAEA

OPOP

EXEX

SS

FF

DD

Page 35: Ec305.2 computer architecture

STORE

ADD

CONTROL

UNIT

Page 36: Ec305.2 computer architecture

STORE

LDR

CONTROL

UNIT

Page 37: Ec305.2 computer architecture

STORE

STORESet MDR

CONTROL

UNIT

Page 38: Ec305.2 computer architecture

STORE

STORESet MDRAssert “write”

CONTROL

UNIT

Page 39: Ec305.2 computer architecture

Outline of the Book (2)

• CPU Structure and Function

• Reduced Instruction Set Computers

• Superscalar Processors

• Control Unit Operation

• Microprogrammed Control

• Multiprocessors and Vector Processing

• Digital Logic (Appendix)

Page 40: Ec305.2 computer architecture

Internet Resources- Web site for book

• http://WilliamStallings.com/COA6e.html– links to sites of interest– links to sites for courses that use the book– errata list for book– information on other books by W. Stallings

• http://WilliamStallings.com/StudentSupport.html– Math– How-to– Research resources– Misc

Page 41: Ec305.2 computer architecture

Internet Resources- Web sites to look for

• WWW Computer Architecture Home Page• CPU Info Center• ACM Special Interest Group on Computer

Architecture• IEEE Technical Committee on Computer

Architecture• Intel Technology Journal• Manufacturer’s sites

– Intel, IBM, etc.

Page 42: Ec305.2 computer architecture

Internet Resources - Usenet News Groups

• comp.arch

• comp.arch.arithmetic

• comp.arch.storage

• comp.parallel