Instruction and Control II

Slides:



Advertisements
Similar presentations
The Fetch – Execute Cycle
Advertisements

PART 5: (2/2) Processor Internals CHAPTER 15: CONTROL UNIT OPERATION 1.
ARITHMETIC LOGIC SHIFT UNIT
1 HW #6 Write an assembly program to calculate the sum of the ten scores stored in memory as shown on the right. You can use any instruction used in the.
Basic Computer Organization and Design
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
Dale & Lewis Chapter 5 Computing components. Let’s design a computer Generic CPU with registers −Program counter (PC) – 5 bits (size of addresses) −Instruction.
Computer Organization and Architecture
Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009
Computer System Architecture ESGD2204
Chapter No 5 Basic Computer Organization And Design.
1 Basic Computer Organization & Design Computer Organization Computer Architectures Lab BASIC COMPUTER ORGANIZATION AND DESIGN Instruction Codes Computer.
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
Bus Architecture Memory unit AR PC DR E ALU AC INPR 16-bit Bus IR TR
MICROPROGRAMMED CONTROL
Exam2 Review Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
Model Computer CPU Arithmetic Logic Unit Control Unit Memory Unit
Chapter # 6 PROGRAMING THE BASIC COMPUTER.
1 Purpose of This Chapter In this chapter we introduce a basic computer and show how its operation can be specified with register transfer statements.
M. Mateen Yaqoob The University of Lahore Spring 2014.
Lec 5 Basic Computer Organization
M. Mateen Yaqoob The University of Lahore Spring 2014
CSE 241 Computer Organization Lecture # 8 Ch. 7 Control Unit Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering.
COMPILERS CLASS 22/7,23/7. Introduction Compiler: A Compiler is a program that can read a program in one language (Source) and translate it into an equivalent.
Computer Systems Organization
Dale & Lewis Chapter 5 Computing components
Elements of Computer Design Why is the computer the jewel in the crown of digital devices? Church-Turing Hypothesis Minimum requirements i) There must.
1 Basic Computer Organization & Design Computer Organization Prof. H. Yoon BASIC COMPUTER ORGANIZATION AND DESIGN Instruction Codes Computer Registers.
Instruction.
Ch5. 기본 컴퓨터의 구조와 설계.
Bus Architecture Memory unit AR PC DR E ALU AC INPR 16-bit Bus IR TR
8085 processor.
Chapter 10 Control Unit Operation “Controls the operation of the processor”
1 Verilog HW #8 Write an assembly program to calculate the sum of the ten scores stored in memory as shown on the right. Store the sum in the address 99.
Basic Computer Organization - Part 2 Designing your first computer
1 BASIC COMPUTER ORGANIZATION AND DESIGN Instruction Codes Computer Registers Computer Instructions Timing and Control Instruction Cycle Memory Reference.
Functions of Processor Operation Addressing modes Registers i/o module interface Memory module interface Interrupts.
UNIT 2 REGISTER TRANSFER AND MICROOPERATIONS
PROGRAMMING THE BASIC COMPUTER
COMPUTER ARCHITECTURE
Symbol Hex Code Description I=0 I=1
Micro-Operations A computer executes a program Fetch/execute cycle
William Stallings Computer Organization and Architecture
ADVANCED PROCESSOR ARCHITECTURE
William Stallings Computer Organization and Architecture 7th Edition
Computer Organization and Design
BASIC COMPUTER ORGANIZATION AND DESIGN
Overview Instruction Codes Computer Registers Computer Instructions
Chapter 15 Control Unit Operation
MICROPROGRAMMED CONTROL
INDEX UNIT-III PPT SLIDES
BASIC COMPUTER ORGANIZATION AND DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGN
By: A. H. Abdul Hafez CAO, by Dr. A.H. Abdul Hafez, CE Dept. HKU
سازمان و طراحي کامپيوتر پايه.
Assembler CASE Tool.
Computer Architecture and Organization: L11: Design Control Lines
William Stallings Computer Organization and Architecture 7th Edition
MICROPROGRAMMED CONTROL
Chapter 14 Control Unit Operation
William Stallings Computer Organization and Architecture 8th Edition
By: A. H. Abdul Hafez Computer Architecture and Organization: L06: Stored program and Instruction code.
Computer Architecture and Organization: L07: Control Sequence
MICROPROGRAMMED CONTROL
MICROPROGRAMMED CONTROL
A Top-Level View Of Computer Function And Interconnection
Computer Architecture
Computer Architecture
Presentation transcript:

Instruction and Control II Computer Architecture and Design Lecture 8

HW #7 Design a bus system with 16-bit registers AR, IR, PC, DR, AC, 1-bit register E and a Synchronous SRAM with size 128*16. Design and simulate the CPU. AC ← 0 AC ← ~AC E ← 0 AC ← shr AC AC ← AC + 1 Once the simulation is done, dump the first four words from the SRAM into a file “sram.dat” and six registers contents into a file “reg.dat”. Control Unit Select AR NR x 1 MUX IR SRAM Common Bus Load

Flowchart for instruction cycle Start : SC <- 0 T0 AR <- PC T1 IR <- M[AR], PC <- PC +1 T2 Decode operation code in IR(12 - 14) AR <- IR(0 - 11), I <- IR(15) (Register or I/O) = 1 = 0 (Memory-reference) D7 (indirect) = 1 = 0 (direct) (I/O) = 1 = 0 (register) I I T3 T3 AR <- M[AR] T3 Nothing Execute memory-reference Instruction SC <- 0 Execute input-output instruction SC <- 0 Execute register-reference instruction SC <- 0

Memory-Reference Instructions TABLE 5-4 Memory-Reference Instructions Operation decoder Symbol Symbolic description AND D0 AC <- AC M[AR] ADD D1 AC <- AC + M[AR], E <- Cout LDA D2 AC <- M[AR] STA D3 M[AR] <- AC BUN D4 PC <- AR BSA D5 M[AR] <- PC, PC <- AR + 1 ISZ D6 M[AR] <- M[AR] + 1, If M[AR] + 1 = 0 then PC <- PC + 1

AND to AC D0T4: DR <- M[AR] D0T5: AC <- AC ^ DR, SC <- 0 ADD to AC D1T4: DR <- M[AR] D1T5: AC <- AC + DR, E <- Cout, SC <- 0 LDA: Load to AC D2T4: DR <- M[AR] D2T5: AC <- DR, SC <- 0 STA: Store AC D3T4: M[AR] <- AC, SC <- 0 BUN: Branch Unconditionally D4T4: PC <- AR, SC <- 0 BSA: Branch and Save Return Address D5T4: M[AR] <- PC, AR <- AR +1 D5T5: PC <- AR, SC <- 0 ISZ: Increment and Skip if Zero D6T4: DR <- M[AR] D6T5: DR <- DR +1 D6T6: M[AR] <- DR, if (DR = 0) Then PC <- PC +1, SC <- 0

Flowchart for instruction cycle Start : SC <- 0 T0 AR <- PC T1 IR <- M[AR], PC <- PC +1 T2 Decode operation code in IR(12 - 14) AR <- IR(0 - 11), I <- IR(15) (Register or I/O) = 1 = 0 (Memory-reference) D7 (indirect) = 1 = 0 (direct) (I/O) = 1 = 0 (register) I I T3 T3 AR <- M[AR] T3 Nothing Execute memory-reference Instruction SC <- 0 Execute input-output instruction SC <- 0 Execute register-reference instruction SC <- 0

AND 0xxx 8xxx AND memory word to AC BUN 4xxx Cxxx Branch unconditionally BSA 5xxx Dxxx Branch and save return address ISZ 6xxx Exxx Increment and skip if zero Symbol I = 0 I = 1 Description BSA: Branch & Save Return Address D5T4: M[AR] <- PC, AR <- AR +1 D5T5: PC <- AR, SC <- 0 Memory Memory 20 BSA 135 20 BSA 135 PC = 21 T2 Next instruction 21 Next instruction . . . AR <- IR(0 - 11), . . (indirect) = 1 = 0 (direct) I T2 T4 AR = 136 AR = 135 135 21 T5 T3 T3 136 Subroutine PC = 136 Subroutine AR <- M[AR] Nothing Execute memory-reference Instruction SC <- 0 1 BUN 135 1 BUN 135 Set before BSA is called T4

Flowchart for memory-reference instructions AND ADD LDA STA D0T4 D1T4 D2T4 D3T4 DR <- M[AR] DR <- M[MAR] DR <- M[AR] M[AR] <- AC SC <- 0 D0T5 D1T5 D2T5 AC <- AC DR SC <- 0 AC <- AC + DR E <- Cout SC <- 0 AC <- DR SC <- 0 BUN BSA ISZ D4T4 D5T4 D6T4 PC <- AR SC <- 0 M[AR] <- PC AR <- AR + 1 DR <- M[AR] D6T5 DR <- DR + 1 D5T5 D6T6 PC <- AR SC <- 0 M[AR] <- DR If (DR = 0) then (PC <- PC +1) SC <- 0