2

Similar documents
Basic Computer Organization and Design Part 3/3

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

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

Logic and Computer Design Fundamentals. Chapter 8 Sequencing and Control

UNIVERSITY OF WISCONSIN MADISON

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

CprE 281: Digital Logic

CMP 334: Seventh Class

Design of Sequential Circuits

Enrico Nardelli Logic Circuits and Computer Architecture

Project Two RISC Processor Implementation ECE 485

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

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

Shift Register Counters

ECE290 Fall 2012 Lecture 22. Dr. Zbigniew Kalbarczyk

Design at the Register Transfer Level

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

Chapter 7. Sequential Circuits Registers, Counters, RAM

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.

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

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

Processor Design & ALU Design

EC 413 Computer Organization

Sample Test Paper - I

L07-L09 recap: Fundamental lesson(s)!

ALU (3) - Division Algorithms

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

EEE Lecture 1 -1-

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

CMP 338: Third Class

CPU DESIGN The Single-Cycle Implementation

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

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

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.

Chapter 7: Digital Components. Oregon State University School of Electrical Engineering and Computer Science. Review basic digital design concepts:

EECS150 - Digital Design Lecture 17 - Sequential Circuits 3 (Counters)

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

Chapter 7. Synchronous Sequential Networks. Excitation for

Simple Instruction-Pipelining (cont.) Pipelining Jumps

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

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

Practice Homework Solution for Module 4

Figure 4.9 MARIE s Datapath

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

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

A Second Datapath Example YH16

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

on candidate s understanding. 7) For programming language papers, credit may be given to any other program based on equivalent concept.

EECS 579: Logic and Fault Simulation. Simulation

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

EECS150 - Digital Design Lecture 11 - Shifters & Counters. Register Summary

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

Instruction register. Data. Registers. Register # Memory data register

ww.padasalai.net

A L A BA M A L A W R E V IE W

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

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

CSC9R6 Computer Design. Practical Digital Logic

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

Decoding A Counter. svbitec.wordpress.com 1

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

Lecture 13: Sequential Circuits, FSM

Adders, subtractors comparators, multipliers and other ALU elements

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

LABORATORY MANUAL MICROPROCESSOR AND MICROCONTROLLER

Review for Final Exam

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

4. (3) What do we mean when we say something is an N-operand machine?

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

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

3. (2) What is the difference between fixed and hybrid instructions?

EXPERIMENT Bit Binary Sequential Multiplier

COE 328 Final Exam 2008

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

Lecture 3, Performance

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

COMBINATIONAL LOGIC FUNCTIONS

Fundamentals of Digital Design

Computer Architecture

Digital Logic Appendix A

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

Unit 12 Problem Solutions

Spiral 2-1. Datapath Components: Counters Adders Design Example: Crosswalk Controller

Adders, subtractors comparators, multipliers and other ALU elements

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) State any two Boolean laws. (Any 2 laws 1 mark each)

Lecture 13: Sequential Circuits, FSM

Digital Techniques. Figure 1: Block diagram of digital computer. Processor or Arithmetic logic unit ALU. Control Unit. Storage or memory unit

Computer Science. Questions for discussion Part II. Computer Science COMPUTER SCIENCE. Section 4.2.

Design for Testability

VHDL DESIGN AND IMPLEMENTATION OF C.P.U BY REVERSIBLE LOGIC GATES

Design for Testability

ALU A functional unit

Unit 1 - Digital System Design

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

Lecture 3, Performance

[2] Predicting the direction of a branch is not enough. What else is necessary?

Logic Design II (17.342) Spring Lecture Outline

Latches. October 13, 2003 Latches 1

[2] Predicting the direction of a branch is not enough. What else is necessary?

Transcription:

Computer System AA rc hh ii tec ture( 55 )

2

INTRODUCTION ( d i f f e r e n t r e g i s t e r s, b u s e s, m i c r o o p e r a t i o n s, m a c h i n e i n s t r u c t i o n s, e t c P i p e l i n e E t c 2 5 M M o r r i s M a n o B a s i c C o m p u t e r P r o c e s s o r R T L M o d e l h i g h e r l e v e l c o m p u t e r. ). - -......... 3

TH E E BB AA SS IC COM PP UTE R B a s i c C o m p u t e r p r o c e s s o r m e m o r r y C o m p o n e n t s M e m o r y 4 0 9 6 w o r d 4 0 9 6 = 2, 1 2 b i t s w o r d w o r d 1 6 b i t s.. 12.. CPU RAM 0 15 0 4095 4

INS TRUCTIONS Instruction codes A s e q u e n c e o f ( m a c h i n e ) i n s t r u c t i o n s - (Machine) Instruction S p e c i f i c o p e r a t i o n b i t. m em ory. C P U m em ory. Instruction Register (IR ). C ontrol unit C ontrol circuitry m icroop eration seq uence. 5

Instruction codes. O p e r a t i o n C o d e ( o p c o d e ). ( a n d / o r ). 4 0 9 6 (= 2 12 ) 1 2., 1 5 b it (a d d r e s s i n g m o d e ). (0:, 1 : ) 1 6 b it 3 b its op cod e. Instruction Format 15 14 12 11 0 I Opcode Address Addressibg mode 6

A DDRE S S ING M ODE S Instruction codes. :. : 22 Direct addressing 0 ADD 457 35 Indirect addressing 1 ADD 300 300 1350 457 Operand 1350 Operand + + AC AC - Effective Address (EA).,. 7

Instruction codes PROCESSOR REGISTERS. (a d d r e s s e s, d a t a, e t c ) Program Counter (P C ). 4096 P C 1 2 b i t s.,. : A d d res s R egi s ter (A R ) A R 1 2 b i t. D ata R egi s ter (D R )... t h e Accumulator (A C ) 8

Instruction codes PROCESSOR REGISTERS. AC. ; AC.. ; Temporary Register (T R ). i n p u t / o u t p u t (I / O ). ch a ra cter da ta 8. 8. I n N P R b i t c h a r a c t e r pu t Register (I ) 8. O u U T R b i t c h a r a c t e r tpu t Register (O ) 8. 9

B A SIC COM PU TER REGISTERS Registers Registers in the Basic Computer 11 0 PC 11 0 AR 15 0 IR 15 0 TR 7 0 7 0 OUTR INPR Memory 4096 x 16 15 0 DR 15 0 AC CPU DR 16 Data Register Holds memory operand AR 12 Address Register Holds address for memory AC 16 Accumulator Processor register IR 16 Instruction Register Holds instruction code PC 12 Program Counter Holds address of instruction TR 16 Temporary Register Holds temporary data INPR 8 Input Register Holds input character OUTR 8 Output Register Holds output character List of BC Registers 10

COM M ON B U S SY STEM Registers.. 11

COM M ON B U S SY STEM Registers Memory unit 4096 x 16 Write Read AR S2 S1 S0 Address Bus 7 1 LD INR CLR PC 2 LD INR CLR DR 3 LD INR CLR ALU E AC 4 LD INR CLR INPR LD IR TR 5 6 LD INR CLR OUTR LD 16-bit common bus Clock 12

Registers COM M ON B U S SY STEM Memory 4096 x 16 Read Write Address E ALU INPR AC L I C L I C L L I C DR IR L I C PC TR AR OUTR LD L I C 7 1 2 3 4 5 6 16-bit Common Bus S 0 S 1 S 2 13

COM M ON B U S SY STEM Registers S 2, S 1, S 0. S 2 S 1 S 0 Register 0 0 0 x 0 0 1 AR 0 1 0 PC 0 1 1 DR 1 0 0 AC 1 0 1 IR 1 1 0 TR 1 1 1 Memory.. 12 A R, P C 0 4. 8 O U T R 8. 14

B A SIC COM PU TER IN STRU CTION S Instructions Memory-Reference Instructions (OP-code = 000 ~ 110) 15 14 12 11 0 I Opcode Address Register-Reference Instructions (OP-code = 111, I = 0) 15 12 11 0 Register operation 0 1 1 1 Input-Output Instructions (OP-code =111, I = 1) 15 12 11 0 I/O operation 1 1 1 1 15

B A SIC COM PU TER IN STRU CTION S Instructions 16

IN STRU CTION SET COM PL ETEN ESS Instructions - Arithmetic, logic, and shift instructions - ADD, CMA, INC, CIR, CIL, AND, CLA - Data transfers between the main memory and the processor registers - LDA, STA - Program sequencing and control - BUN, BSA, ISZ - Input and output - INP, OUT 17

Instruction codes CON TROL U N IT 18

TIM IN G A N D CON TROL Timing and control Control unit of Basic Computer Instruction register (IR) 15 14 13 12 11-0 Other inputs 3 x 8 decoder 7 6 5 4 3 2 1 0 I D 0 D7 Combinational Control logic Control signals T15 T0 15 14.... 2 1 0 4 x 16 decoder 4-bit sequence counter (SC) Increment (INR) Clear (CLR) Clock 19

TIM IN G SIGN A L S Timing and control - 4-bit 4 16 decoder - SC. - Example: T 0, T 1, T 2, T 3, T 4, T 0, T 1,... Assume: At time T 4, SC is cleared to 0 if decoder output D3 is active. D 3 T 4 : SC 0 Clock T0 T1 T2 T3 T4 T0 T0 T1 T2 T3 T4 D3 CLR SC 20

IN STRU CTION CY CL E 1 F a n n m m o 2 D n 3 R a m m o n h a a n a n.. etch in stru ctio fro em ry. eco de th e in stru ctio. ea d th e effective ddress fro em ry if th e in stru ctio s in direct ddress 4. Ex ecu te th e in stru ctio 1. :. 21

F ETCH a n d D ECOD E Instruction Cycle Fetch and Decode T0: AR PC (S 0 S 1 S 2 =010, T0=1) T1: IR M [AR], PC PC + 1 (S0S1S2=111, T1=1) T2: D0,..., D7 Decode IR(12-14), AR IR(0-11), I IR(15) T1 T0 S 2 S 1 Bus Memory unit Read Address S 0 7 AR 1 LD PC 2 INR IR 5 LD Common bus Clock 22

D ETERM IN E TH E TY PE OF IN STRU CTION Instrction Cycle Start SC 0 AR PC T0 IR M[AR], PC PC + 1 Decode Opcode in IR(12-14), AR IR(0-11), I IR(15) T1 T2 (Register or I/O) = 1 D7 = 0 (Memory-reference) (I/O) = 1 = 0 (register) (indirect) = 1 I Execute input-output instruction SC 0 I = 0 (direct) T3 T3 T3 T3 Execute AR M[AR] Nothing register-reference instruction SC 0 Execute memory-reference instruction SC 0 T4 D'7IT3: D'7I'T3: D7I'T3: D7IT3: AR M[AR] Nothing Execute a register-reference instr. Execute an input-output instr. 23

REGISTER REF EREN CE IN STRU CTION S Instruction Cycle - D 7 = 1, I = 0 - IR b 0 ~ b 11. - T 3... r = D 7 I T 3 => Register Reference Instruction B i = IR(i), i=0,1,2,...,11 r: SC 0 CLA rb 11 : AC 0 CLE rb 10 : E 0 CMA rb 9 : AC AC CME rb 8 : E E CIR rb 7 : AC shr AC, AC(15) E, E AC(0) CIL rb 6 : AC shl AC, AC(0) E, E AC(15) INC rb 5 : AC AC + 1 SPA rb 4 : if (AC(15) = 0) then (PC PC+1) SNA rb 3 : if (AC(15) = 1) then (PC PC+1) SZA rb 2 : if (AC = 0) then (PC PC+1) SZE rb 1 : if (E = 0) then (PC PC+1) HLT rb 0 : S 0 (S is a start-stop flip-flop) 24

M EM ORY REF EREN CE IN STRU CTION S MR Instructions Symbol Operation Decoder Symbolic Description AND D 0 AC AC M[AR] ADD D 1 AC AC + M[AR], E C out LDA D 2 AC M[AR] STA D 3 M[AR] AC BUN D 4 PC AR BSA D 5 M[AR] PC, PC AR + 1 ISZ D 6 M[AR] M[AR] + 1, if M[AR] + 1 = 0 then PC PC+1 - Instruction AR. T 2 I = 0, T 3 I = 1 - CPU.. - MR Instruction T. 4 AND to AC D 0 T 4 : DR M[AR] Read operand D 0 T 5 : AC AC DR, SC 0 AND with AC ADD to AC D 1 T 4 : DR M[AR] Read operand D 1 T 5 : AC AC + DR, E C out, SC 0 Add to AC and store carry in E 25

MEMORY REFERENCE INSTRUCTIONS LDA: Load to AC D 2 T 4 : DR M[AR] D 2 T 5 : AC DR, SC 0 STA: Store AC D 3 T 4 : M[AR] AC, SC 0 BUN: Branch Unconditionally D 4 T 4 : PC AR, SC 0 BSA: Branch and Save Return Address M[AR] PC, PC AR + 1 20 PC = 21 Memory, PC, AR at time T4 0 BSA 135 Next instruction 20 21 Memory, PC after execution 0 BSA 135 Next instruction AR = 135 136 Subroutine 135 PC = 136 21 Subroutine 1 BUN 135 Memory 1 BUN 135 Memory 26

MEMORY REFERENCE INSTRUCTIONS MR Instructions BSA: D 5 T 4 : M[AR] PC, AR AR + 1 D 5 T 5 : PC AR, SC 0 ISZ: Increment and Skip-if-Zero D 6 T 4 : DR M[AR] D 6 T 5 : DR DR + 1 D 6 T 4 : M[AR] DR, if (DR = 0) then (PC PC + 1), SC 0 27

MR Instructions FLOWCHART FOR MEMORY REFERENCE INSTRUCTIONS Memory-reference instruction AND ADD LDA STA D 0 T 4 D 1 T 4 D 2 T 4 D 3 T 4 DR M[AR] DR M[AR] DR M[AR] M[AR] AC SC 0 D 0 T 5 D 1 T 5 D 2 T 5 AC AC DR AC AC + DR AC DR SC 0 E Cout SC 0 SC 0 BUN BSA ISZ PC AR SC 0 D T 4 4 D 5 T 4 D 6 T 4 M[AR] PC DR M[AR] AR AR + 1 PC AR SC 0 D 5 T 5 D 6 T 5 DR DR + 1 D 6 T 6 M[AR] DR If (DR = 0) then (PC PC + 1) SC 0 28

INP UT-OUTP UT A ND INTERRUP T I/O and Interrupt A Terminal with a keyboard and a Printer Input-Output Configuration Input-output terminal Printer Serial communication interface Receiver interface registers and Computer flip-flops OUTR FGO AC INPR Input register - 8 bits OUTR Output register - 8 bits FGI Input flag - 1 bit FGO Output flag - 1 bit IEN Interrupt enable - 1 bit Keyboard Transmitter interface INPR FGI Serial Communications Path Parallel Communications Path -. - The serial info. INPR. - The serial info. OUTR. - INPR OUTR AC ( ). - Flags I/O. 29

I/O and Interrupt P ROG RA M CONTROL L ED D A TA TRA NSFER -- CPU -- -- I/O Device -- /* Input */ /* Initially FGI = 0 */ loop: If FGI = 0 goto loop AC INPR, FGI 0 /* Output */ /* Initially FGO = 1 */ loop: If FGO = 0 goto loop OUTR AC, FGO 0 FGI=0 Start Input loop: If FGI = 1 goto loop INPR new data, FGI 1 loop: If FGO = 1 goto loop consume OUTR, FGO 1 FGO=1 Start Output yes FGI 0 FGI=0 no AC INPR yes AC Data FGO=0 no OUTR AC yes More Character no END yes FGO 0 More Character no END 30

INP UT-OUTP UT INSTRUCTIONS D 7 IT 3 = p IR(i) = B i, i = 6,, 11 INP pb 11 : AC(0-7) INPR, FGI 0 Input char. to AC OUT pb 10 : OUTR AC(0-7), FGO 0 Output char. from AC SKI pb 9 : if(fgi = 1) then (PC PC + 1) Skip on input flag SKO pb 8 : if(fgo = 1) then (PC PC + 1) Skip on output flag ION pb 7 : IEN 1 Interrupt enable on IOF pb 6 : IEN 0 Interrupt enable off 31

P ROG RA M-CONTROL L ED INP UT/ OUTP UT I/O and Interrupt Program-controlled I/O - Continuous CPU involvement I/O takes valuable CPU time - CPU slowed down to I/O speed - Simple - Least hardware Input LOOP, SKI DEV BUN LOOP INP DEV Output LOOP, LD DATA LOP, SKO DEV BUN LOP OUT DEV 32

INTERRUP T INITIA TED INP UT/ OUTP UT -,. --> interrupt. - I/O CPU I/O device. - I/O CPU interrupt. - CPU, service routine,. * IEN (Interrupt-enable flip-flop) - can be set and cleared by instructions - when cleared, the computer cannot be interrupted 33

FL OW CH A RT FOR INTERRUP T CYCL E I/O and Interrupt 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 =1 R 1 =1 IEN =0 =1 FGI =0 FGO =0 Branch to location 1 PC 1 IEN 0 R 0 - The interrupt cycle is a HW implementation of a branch and save return address operation. - At the beginning of the next instruction cycle, the instruction that is read from memory is in address 1. - At memory address 1, the programmer must store a branch instruction that sends the control to an interrupt service routine - The instruction that returns the control to the original program is "indirect BUN 0" 34

I/O and Interrupt REGISTER TRANSFER OPERATIONS 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 1 BUN 0 Register Transfer Statements for Interrupt Cycle - R F/F 1 if IEN (FGI + FGO)T 0 T 1 T 2 T 0 T 1 T 2 (IEN)(FGI + FGO): R 1 - The fetch and decode phases of the instruction cycle must be modified:replace T 0, T 1, T 2 with R'T 0, R'T 1, R'T 2 - The interrupt cycle : RT 0 : AR 0, TR PC RT 1 : M[AR] TR, PC 0 RT 2 : PC PC + 1, IEN 0, R 0, SC 0 35

FURTH ER Q UESTIONS ON INTERRUP T I/O and Interrupt Questions on Interrupt How can the CPU recognize the device requesting an interrupt? 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? Should any device be allowed to interrupt the CPU while another interrupt is being serviced? How can the situation be handled when two or more interrupt requests occur simultaneously? 36

COMP L ETE COMP UTER D Fl o w c h a r t o f Op e r a t i o n s ESCRIP TION Description start SC 0, IEN 0, R 0 =0(Instruction R =1(Interrupt AR PC R T Cycle) Cycle) RT 0 0 AR 0, TR PC R T 1 RT 1 IR M[AR], PC PC + M[AR] TR, PC 0 R T 2 RT 2 AR IR(0~11), I IR(15) PC PC + 1, IEN 0 D 0...D 7 Decode IR(12 ~ 14) R 0, SC 0 =1(Register or I/O) =0(Memory Ref) D 7 =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 Execute AR <- M[AR] Idle I/O RR Instruction Instruction Execute MR Instruction D 7 T 4 37

M COMP L ETE COMP UTER D i c r o o p e r a t i o n s ESCRIP TION Description Fetch Decode R T0: R T1: R T2: Indirect D7 IT3: Interrupt T0 T1 T2 (IEN)(FGI + FGO): RT0: RT1: RT2: Memory-Reference AND D0T4: D0T5: ADD D1T4: D1T5: LDA D2T4: D2T5: STA D3T4: BUN D4T4: BSA D5T4: D5T5: ISZ D6T4: D6T5: D6T6: 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 Cout, 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 38

M COMP L ETE COMP UTER D i c r o o p e r a t i o n s ESCRIP TION Description Register-Reference CLA CLE CMA CME CIR CIL INC SPA SNA SZA SZE HLT D7I T3 = r IR(i) = Bi r: rb11: rb10: rb9: rb8: rb7: rb6: rb5: rb4: rb3: rb2: rb1: rb0: (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 Input-Output INP OUT SKI SKO ION IOF D7IT3 = p IR(i) = Bi p: pb11: pb10: pb9: pb8: pb7: pb6: (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 39

D ESIG N OF B A SIC COMP UTER( B C) Design of Basic Computer Hardware Components of BC A memory unit: 4096 x 16. Registers: AR, PC, DR, AC, IR, TR, OUTR, INPR, and SC Flip-Flops(Status): I, S, E, R, IEN, FGI, and FGO Decoders: a 3x8 Opcode decoder a 4x16 timing decoder Common bus: 16 bits Control logic gates: Adder and Logic circuit: Connected to AC Control Logic Gates - Input Controls of the nine registers - Read and Write Controls of memory - Set, Clear, or Complement Controls of the flip-flops - S 2, S 1, S 0 Controls to select a register for the bus - AC, and Adder and Logic circuit 40

Design of Basic Computer CONTROL OF REG ISTERS A ND MEMORY 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 INR(AR) = D 5 T 4 T2 R T0 D T4 D' 7 I T3 From bus 12 LD AR INR CLR 12 To bus Clock 41

CONTROL OF FL A G S Design of Basic Computer IEN: Interrupt Enable Flag pb7: IEN 1 (I/O Instruction) pb6: IEN 0 (I/O Instruction) RT 2 : IEN 0 (Interrupt) p = D 7 IT 3 (Input/Output Instruction) D 7 I T 3 p B 7 J Q IEN B 6 K R T 2 42

CONTROL OF COMMON B US Design of Basic Computer x1 x2 x3 x4 x5 x6 x7 Encoder S 2 S 1 S 0 Multiplexer bus select inputs selected x1 x2 x3 x4 x5 x6 x7 S2 S1 S0 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 43

D ESIG N OF A CCUMUL A TOR L OG IC Design of AC Logic Circuits associated with AC 16 16 From DR From INPR 8 Adder and logic circuit 16 AC 16 To bus LD INR CLR Clock Control gates All the statements that change the content of AC 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 44

CONTROL OF A C REG ISTER Design of AC Logic 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 45

A L U ( A D D ER A ND L OG IC CIRCUIT) Design of AC Logic One stage of Adder and Logic circuit DR(i) AC(i) AND FA C i C i+1 ADD DR Ii LD J Q AC(i) From INPR bit(i) INPR COM K SHR AC(i+1) SHL AC(i-1) 46