Basic Computer Organization and Design Part 3/3

Similar documents
2

ECE290 Fall 2012 Lecture 22. Dr. Zbigniew Kalbarczyk

Enrico Nardelli Logic Circuits and Computer Architecture

UNIVERSITY OF WISCONSIN MADISON

System Data Bus (8-bit) Data Buffer. Internal Data Bus (8-bit) 8-bit register (R) 3-bit address 16-bit register pair (P) 2-bit address

Logic and Computer Design Fundamentals. Chapter 8 Sequencing and Control

CprE 281: Digital Logic

CMP 334: Seventh Class

Figure 4.9 MARIE s Datapath

Design at the Register Transfer Level

Menu. Excitation Tables (Bonus Slide) EEL3701 EEL3701. Registers, RALU, Asynch, Synch

Chapter 5. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 5 <1>

Lecture 13: Sequential Circuits, FSM

Lecture 13: Sequential Circuits, FSM

Design of Sequential Circuits

UNIT 8A Computer Circuitry: Layers of Abstraction. Boolean Logic & Truth Tables

Verilog HDL:Digital Design and Modeling. Chapter 11. Additional Design Examples. Additional Figures

INF2270 Spring Philipp Häfliger. Lecture 8: Superscalar CPUs, Course Summary/Repetition (1/2)

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

EECS 579: Logic and Fault Simulation. Simulation

課程名稱 : 數位邏輯設計 P-1/ /6/11

CMP 338: Third Class

CPU DESIGN The Single-Cycle Implementation

Computer Engineering Department. CC 311- Computer Architecture. Chapter 4. The Processor: Datapath and Control. Single Cycle

Shift Register Counters

CHAPTER log 2 64 = 6 lines/mux or decoder 9-2.* C = C 8 V = C 8 C * 9-4.* (Errata: Delete 1 after problem number) 9-5.

ECE 2300 Digital Logic & Computer Organization

Practice Homework Solution for Module 4

Counters. We ll look at different kinds of counters and discuss how to build them

LOGIC CIRCUITS. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

Menu. 7-Segment LED. Misc. 7-Segment LED MSI Components >MUX >Adders Memory Devices >D-FF, RAM, ROM Computer/Microprocessor >GCPU

ECE 3401 Lecture 23. Pipeline Design. State Table for 2-Cycle Instructions. Control Unit. ISA: Instruction Specifications (for reference)

Logic Design. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

EC 413 Computer Organization

ALU (3) - Division Algorithms

CMPT-150-e1: Introduction to Computer Design Final Exam

Lecture 17: Designing Sequential Systems Using Flip Flops

CSC9R6 Computer Design. Practical Digital Logic

Simple Instruction-Pipelining (cont.) Pipelining Jumps

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

Fundamentals of Digital Design

Pipelining. Traditional Execution. CS 365 Lecture 12 Prof. Yih Huang. add ld beq CS CS 365 2

Project Two RISC Processor Implementation ECE 485

EXPERIMENT Bit Binary Sequential Multiplier

Sequential Logic Circuits

Computer Science Final Examination Friday December 14 th 2001

Latches. October 13, 2003 Latches 1

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

CSE370: Introduction to Digital Design

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN-MADISON

Digital Circuits ECS 371

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

COMBINATIONAL LOGIC FUNCTIONS

NCU EE -- DSP VLSI Design. Tsung-Han Tsai 1

COMBINATIONAL LOGIC CIRCUITS. Dr. Mudathir A. Fagiri

L07-L09 recap: Fundamental lesson(s)!

ENGIN 112 Intro to Electrical and Computer Engineering

Chapter 4. Sequential Logic Circuits

Design. Dr. A. Sahu. Indian Institute of Technology Guwahati

A Second Datapath Example YH16

Processor Design & ALU Design

Load. Load. Load 1 0 MUX B. MB select. Bus A. A B n H select S 2:0 C S. G select 4 V C N Z. unit (ALU) G. Zero Detect.

Philadelphia University Student Name: Student Number:

COE 328 Final Exam 2008

Number Systems 1(Solutions for Vol 1_Classroom Practice Questions)

Review for Final Exam

Department of Electrical and Computer Engineering The University of Texas at Austin

Outline. policies for the first part. with some potential answers... MCS 260 Lecture 10.0 Introduction to Computer Science Jan Verschelde, 9 July 2014

EEE Lecture 1 -1-

Digital Logic. CS211 Computer Architecture. l Topics. l Transistors (Design & Types) l Logic Gates. l Combinational Circuits.

PAST EXAM PAPER & MEMO N3 ABOUT THE QUESTION PAPERS:

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

ww.padasalai.net

ALU A functional unit

From Sequential Circuits to Real Computers

Tribhuvan University Institute of Science and Technology 2067

Register Transfer Level

Sequential Circuits Sequential circuits combinational circuits state gate delay

Lecture 14: State Tables, Diagrams, Latches, and Flip Flop

Boolean Algebra. Digital Logic Appendix A. Postulates, Identities in Boolean Algebra How can I manipulate expressions?

Design for Testability

L10 State Machine Design Topics

Design for Testability

Lecture: Pipelining Basics

Lecture 3, Performance

IMPERIAL COLLEGE OF SCIENCE, TECHNOLOGY AND MEDICINE UNIVERSITY OF LONDON DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING EXAMINATIONS 2005

COVER SHEET: Problem#: Points

Philadelphia University Student Name: Student Number:

Chapter 3 Digital Logic Structures

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Boolean Algebra. Digital Logic Appendix A. Boolean Algebra Other operations. Boolean Algebra. Postulates, Identities in Boolean Algebra

Combinatorial Logic Design Multiplexers and ALUs CS 64: Computer Organization and Design Logic Lecture #13

Chapter 7. Synchronous Sequential Networks. Excitation for

Digital Logic Appendix A

CPE100: Digital Logic Design I

ECE 341. Lecture # 3

Arithme(c logic units and memory

A B OUT_0 OUT_1 OUT_2 OUT_

Building a Computer. Quiz #2 on 10/31, open book and notes. (This is the last lecture covered) I wonder where this goes? L16- Building a Computer 1

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec09 Counters Outline.

Transcription:

Basic Computer Organization and Design Part 3/3 Adapted by Dr. Adel Ammar Computer Organization

Interrupt Initiated Input/Output Open communication only when some data has to be passed --> interrupt. The I/O interface, instead of the CPU, monitors the I/O device. When the interface founds that the I/O device is ready for data transfer, it generates an interrupt request to the CPU Upon detecting an interrupt, the CPU stops momentarily the task it is doing, branches to the service routine to process the data transfer, and then returns to the task it was performing. IEN (Interrupt-enable flip-flop) can be set and cleared by instructions when cleared, the computer cannot be interrupted Computer Organization 2

Flowchart for Interrupt Cycle R = Interrupt F/F Instruction cycle =0 R =1 Interrupt cycle Fetch and decode instructions Store return address in location 0 M[0] PC Execute instructions R 1 =1 =1 IEN =1 FGI =0 FGO =0 =0 Branch to location 1 PC 1 IEN 0 R 0 v The interrupt cycle is a HW implementation of a branch and save return address operation. v At the beginning of the next instruction cycle, the instruction that is read from memory is in address 1. v At memory address 1, the programmer must store a branch instruction that sends the control to an interrupt service routine v The instruction that returns the control to the original program is "indirect BUN 0" Computer Organization 3

Register Transfer Microoperations in Interrupt Cycle Memory Before interrupt After interrupt cycle 0 1 0 BUN 1120 0 PC = 1 256 0 BUN 1120 255 PC = 256 1120 Main Program I/O Program 255 256 1120 Main Program I/O Program 1 BUN 0 Register Transfer Statements for Interrupt Cycle R F/F 1 if IEN (FGI + FGO)T0 T1 T2 T0 T1 T2 (IEN)(FGI + FGO): R 1 1 BUN 0 The fetch and decode phases of the instruction cycle must be modified Replace T0, T1, T2 with R'T0, R'T1, R'T2 The interrupt cycle : RT0: AR 0, TR PC RT1: M[AR] TR, PC 0 RT2: PC PC+1 Computer Organization 4

Complete Computer Description Flowchart of Operations start SC 0, IEN 0, R 0 =0(Instruction Cycle) R T 0 AR PC R T 1 IR M[AR], PC PC + 1 R =1(Interrupt Cycle) RT 0 AR 0, TR PC M[AR] TR, PC 0 RT 1 R T 2 AR IR(0~11), I IR(15) D 0...D 7 Decode IR(12 ~ 14) PC PC + 1, IEN 0 R 0, SC 0 RT 2 =1(Register or I/O) D 7 =0(Memory Ref) =1 (I/O) =0 (Register) =1(Indir) =0(Dir) I I D 7 IT 3 D 7 I T 3 D 7 IT3 D 7 I T3 Execute I/O Instruction Execute RR Instruction AR <- M[AR] Idle Execute MR D 7 T4 Instruction Computer Organization 5

Further Questions on Interrupt v How can the CPU recognize the device requesting an interrupt? v Since different devices are likely to require different interrupt service routines, how can the CPU obtain the starting address of the appropriate routine in each case? v Should any device be allowed to interrupt the CPU while another interrupt is being serviced? v How can the situation be handled when two or more interrupt requests occur simultaneously? Computer Organization 6

Fetch Decode Complete Computer Description Microoperations R T 0 : R T 1 : R T 2 : Indirect D 7 IT 3 : Interrupt T 0 T 1 T 2 (IEN)(FGI + FGO): RT 0 : RT 1 : RT 2 : Memory-Reference AND D 0 T 4 : D 0 T 5 : ADD D 1 T 4 : D 1 T 5 : LDA D 2 T 4 : D 2 T 5 : STA D 3 T 4 : BUN D 4 T 4 : BSA D 5 T 4 : D 5 T 5 : ISZ D 6 T 4 : D 6 T 5 : D 6 T 6 : AR PC IR M[AR], PC PC + 1 D0,..., D7 Decode IR(12 ~ 14), AR IR(0 ~ 11), I IR(15) AR M[AR] R 1 AR 0, TR PC M[AR] TR, PC 0 PC PC + 1, IEN 0, R 0, SC 0 DR M[AR] AC AC DR, SC 0 DR M[AR] AC AC + DR, E C out, SC 0 DR M[AR] AC DR, SC 0 M[AR] AC, SC 0 PC AR, SC 0 M[AR] PC, AR AR + 1 PC AR, SC 0 DR M[AR] DR DR + 1 M[AR] DR, if(dr=0) then (PC PC + 1), SC 0 Computer Organization 7

Complete Computer Description Microoperations Register-Reference CLA CLE CMA CME CIR CIL INC SPA SNA SZA SZE HLT Input-Output INP OUT SKI SKO ION IOF D 7 I T 3 = r IR(i) = B i r: rb 11 : rb 10 : rb 9 : rb 8 : rb 7 : rb 6 : rb 5 : rb 4 : rb 3 : rb 2 : rb 1 : rb 0 : D 7 IT 3 = p IR(i) = B i p: pb 11 : pb 10 : pb 9 : pb 8 : pb 7 : pb 6 : (Common to all register-reference instr) (i = 0,1,2,..., 11) SC 0 AC 0 E 0 AC AC E E AC shr AC, AC(15) E, E AC(0) AC shl AC, AC(0) E, E AC(15) AC AC + 1 If(AC(15) =0) then (PC PC + 1) If(AC(15) =1) then (PC PC + 1) If(AC = 0) then (PC PC + 1) If(E=0) then (PC PC + 1) S 0 (Common to all input-output instructions) (i = 6,7,8,9,10,11) SC 0 AC(0-7) INPR, FGI 0 OUTR AC(0-7), FGO 0 If(FGI=1) then (PC PC + 1) If(FGO=1) then (PC PC + 1) IEN 1 IEN 0 Computer Organization 8

Design of Basic Computer v Hardware Components of Basic Computer v A memory unit: 4096 x 16. v Registers: ð AR, PC, DR, AC, IR, TR, OUTR, INPR, and SC v Flip-Flops (Status): ð I, S, E, R, IEN, FGI, and FGO v Decoders: ð a 3x8 Opcode decoder ð a 4x16 timing decoder v Common bus: 16 bits v Control logic gates: v Adder and Logic circuit: Connected to AC v Control Logic Gates - Input Controls of the nine registers - Read and Write Controls of memory - Set, Clear, or Complement Controls of the flip-flops - S2, S1, S0 Controls to select a register for the bus - AC, and Adder and Logic circuit Computer Organization 9

Control of Registers and Memory v Address Register: AR ð Scan all of the register transfer statements that change the content of AR: R T 0 : AR PC LD(AR) R T 2 : AR IR(0-11) LD(AR) D 7 IT 3 : AR M[AR] LD(AR) RT 0 : AR 0 CLR(AR) D 5 T 4 : AR AR + 1 INR(AR) LD(AR) = R'T 0 + R'T 2 + D' 7 IT 3 CLR(AR) = RT 0 T 2 R T 0 D' 7 I T 3 INR(AR) = D 5 T 4 From bus 12 LD AR INR CLR 12 To bus Clock D 5 T 4 Computer Organization 10

Control of Flags v IEN: Interrupt Enable Flag ð pb7: IEN 1 (I/O Instruction) ð pb6: IEN 0 (I/O Instruction) ð RT2: IEN 0 (Interrupt) ð p = D7IT3 (Input/Output Instruction) D 7 I T 3 p B 7 J Q IEN B 6 K R T 2 Computer Organization 11

Control of Common Bus x1 x2 x3 x4 x5 x6 x7 Encoder S 2 S 1 S 0 Multiplexer bus select inputs x1 x2 x3 x4 x5 x6 x7 S2 S1 S0 selected register 0 0 0 0 0 0 0 0 0 0 none 1 0 0 0 0 0 0 0 0 1 AR 0 1 0 0 0 0 0 0 1 0 PC 0 0 1 0 0 0 0 0 1 1 DR 0 0 0 1 0 0 0 1 0 0 AC 0 0 0 0 1 0 0 1 0 1 IR 0 0 0 0 0 1 0 1 1 0 TR 0 0 0 0 0 0 1 1 1 1 Memory For AR D 4 T 4 : PC AR D 5 T 5 : PC AR x1 = D 4 T 4 + D 5 T 5 Computer Organization 12

Design of Accumulator Logic Circuits associated with AC 16 From DR From INPR 16 8 Adder and logic circuit 16 AC 16 To bus LD INR CLR Clock All the statements that change AC Control gates D 0 T 5 : AC AC DR AND with DR D 1 T 5 : AC AC + DR Add with DR D 2 T 5 : AC DR Transfer from DR pb 11 : AC(0-7) INPR Transfer from INPR rb 9 : AC AC Complement rb 7 : AC shr AC, AC(15) E Shift right rb 6 : AC shl AC, AC(0) E Shift left rb 11 : AC 0 Clear rb 5 : AC AC + 1 Increment Computer Organization 13

Control of AC Register Gate structures for controlling the LD, INR, and CLR of AC From Adder and Logic 16 AC 16 To bus D 0 T 5 D 1 AND ADD LD INR CLR Clock D 2 T 5 p B 11 r B 9 B 7 B 6 B 5 B 11 DR INPR COM SHR SHL INC CLR Computer Organization 14

ALU (Adder and Logic Circuit) One stage of Adder and Logic circuit DR(i) AC(i) AND FA C C i i+1 ADD DR I i LD J Q AC(i) From INPR bit(i) INPR COM K SHR AC(i+1) SHL AC(i-1) Computer Organization 15

Announcements v Readings ð Chapter 5 of the textbook: Computer System Architecture, M. Mano ð 5-3, 5-4, 5-6, 5-9, 5-10, 5-11, 5-12, 5-15, 5-16, 5-17, 5-18 Computer Organization 16