Designing a CPU –Reading a programs instruction from memory –Decoding the instruction –Executing the instruction –Transferring Data to/From memory / IO.

Slides:



Advertisements
Similar presentations
Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
Advertisements

PART 5: (2/2) Processor Internals CHAPTER 15: CONTROL UNIT OPERATION 1.
ARITHMETIC LOGIC SHIFT UNIT
Chapter 16 Control Unit Operation No HW problems on this chapter. It is important to understand this material on the architecture of computer control units,
Chapter 16 Control Unit Implemntation. A Basic Computer Model.
Chapter 15 IA 64 Architecture Review Predication Predication Registers Speculation Control Data Software Pipelining Prolog, Kernel, & Epilog phases Automatic.
The Computer Processor
Computer Organization and Architecture
Lecture 13 - Introduction to the Central Processing Unit (CPU)
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
Group 1 Michael Bouizza Rolando Abreu Carlos De Cossio Ricardo Urena Michael Hernandez Robert Romano Sun Li Yang.
Micro-operations Are the functional, or atomic, operations of a processor. A single micro-operation generally involves a transfer between registers, transfer.
SAP1 (Simple-As-Possible) Computer
Lecture 16 Today’s topics: –MARIE Instruction Decoding and Control –Hardwired control –Micro-programmed control 1.
The CPU Central Processing Unit. 2 Reminder - how it fits together processor (CPU) memory I/O devices bus.
Chapter 4 MARIE: An Introduction to a Simple Computer.
CONTROL UNIT OPERATION MICROPROGRAMMED CONTROL. 2.
Chapter 8: The Very Simple Computer
Model Computer CPU Arithmetic Logic Unit Control Unit Memory Unit
Lecture 14 Today’s topics MARIE Architecture Registers Buses
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.
Lec 5 Basic Computer Organization
Computer Science 101 Computer Systems Organization ALU, Control Unit, Instruction Set.
Fetch-execute cycle.
Computer architecture
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Machine Instructions.
CSE 241 Computer Organization Lecture # 8 Ch. 7 Control Unit Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering.
September 26, 2001Systems Architecture I1 Systems Architecture I (CS ) Lecture 2: Implementation of a Simplified Computer Jeremy R. Johnson Wednesday,
Lecture 15 Microarchitecture Level: Level 1. Microarchitecture Level The level above digital logic level. Job: to implement the ISA level above it. The.
Dale & Lewis Chapter 5 Computing components
Basic Elements of Processor ALU Registers Internal data pahs External data paths Control Unit.
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
GROUP 2 CHAPTER 16 CONTROL UNIT Group Members ๏ Evelio L. Hernandez ๏ Ashwin Soerdien ๏ Andrew Keiper ๏ Hermes Andino.
Control Unit Operations Chapter10:. What is Control Unit (CU)?(1)  Part of a CPU or other device that directs its operation.  Tells the rest of the.
Processor Organization and Architecture Module III.
The Processor & its components. The CPU The brain. Performs all major calculations. Controls and manages the operations of other components of the computer.
Jeremy R. Johnson William M. Mongan
Lec 4-2 Five operations of the machine cycle Fetch- fetch the next program instruction from memory. (PC+1); instruction to IR Decode- decode the instruction.
Types of Micro-operation  Transfer data between registers  Transfer data from register to external  Transfer data from external to register  Perform.
Functions of Processor Operation Addressing modes Registers i/o module interface Memory module interface Interrupts.
Basic Computer Organization and Design
Today’s Agenda Exam 2 Part 2 (11:15am-12:30pm)
CS 270: Mathematical Foundations of Computer Science
Computer Organization and Architecture + Networks
SAP1 (Simple-As-Possible) Computer
Lecture 13 - Introduction to the Central Processing Unit (CPU)
Micro-Operations A computer executes a program Fetch/execute cycle
William Stallings Computer Organization and Architecture
William Stallings Computer Organization and Architecture 7th Edition
Chapter 15 Control Unit Operation
BASIC COMPUTER ORGANIZATION AND DESIGN
The Processor and Machine Language
Control Unit Introduction Types Comparison Control Memory
MARIE: An Introduction to a Simple Computer
Systems Architecture I (CS ) Lecture 2: A Simplified Computer
William Stallings Computer Organization and Architecture 7th Edition
Chapter 14 Control Unit Operation
Computer Architecture
William Stallings Computer Organization and Architecture 8th Edition
Chapter 14 Control Unit Operation
A Discussion on Assemblers
Information Representation: Machine Instructions
Objectives Describe common CPU components and their function: ALU Arithmetic Logic Unit), CU (Control Unit), Cache Explain the function of the CPU as.
Instruction execution and ALU
Computer Architecture
COMPUTER ARCHITECTURE
Presentation transcript:

Designing a CPU –Reading a programs instruction from memory –Decoding the instruction –Executing the instruction –Transferring Data to/From memory / IO CPU lies at the heart of all digital computers and is responsible for:

A CPU is required to perform tasks by READ/WRITE operations from and to memory. For example, Area of a triangle program

Register transfer Language RTL RTL is not a programming language, it is a notation that describes how information is accessed from memories and registers and how it is operated on Rules: Direction is RIGHT to LEFT Square brackets [ ] indicate location For example: [D0] =MONDAY; D0 contains the value MONDAY [MAR] [PC];Copy contents of PC to MAR [3] [5];Copy contents of Location 5 to Location 3 [PC] [PC]+1;Increment PC [M(5)] [PC];Copy PC to memory address 5 [M(20)] = 6;States that memory (20) is equal to 6 [M(20)] 6 ;Number 6 is placed in M(20) [M(20)] [M(6)];Contents of location (6) are copied into location (20) [M(20)] [M(6)]+3;Read location (6) add 3 and store result in location (20)

An address path represents highways along which addresses flow from one part of the CPU to another D0 is data register storing temporary results ALU performs arithmetic and logic operations

The FETCH phase in RTL [MAR] [PC];Copy contents of PC to MAR [PC] [PC]+1;Increment PC [MBR] [M9[MAR])] ;Read the instruction from memory [IR] [MBR] ;Move instructions to IR CU [IR(opcode)];Transmit Opcode to Control Unit The Control Unit enables the CPU to carry out the instruction currently in the instruction register (IR). In other words translating the bit pattern into a sequence of actions taking place during the execution of the instruction

INTERNAL STRUCTURE OF A PRIMITIVE CPU USING FLIP FLOPS G4 MODEL THE ADD, D0 1. [MAR]  [PC]; ENABLE G1, clock MAR 1a. INC  [PC] 2. [PC]  INC; Enable G2, clock PC 3. [MBR]  [M([MAR])] Enable Memory (E), R/W = 1, enable G6, G11, clock MBR 4. [IR]  [MBR]; enable G7, clock IR 4a CU  [IR(OPCODE)] 5. [MAR]  [IR(address)] enable G3, clock MAR 6. [MBR]  [M(MAR)]; enable memory, R/W = 1 enable G6, G11, clock MBR (as 3 above) 7. ALU  [MBR] enable G7 7a ALU  [D0] enable G10 8. [DQ]  [ALU] enable G12 clock D0 CLK

GATE CONTROL SIGNALMEMORYREGISTERS The Microprogram: When the clock pulses the FF register’s D input is transferred to its output Q where it remains until the next clock pulse. Output from each register can be gated into the bus by enabling the appropriate tri- state buffer. (G1 – G12) If the output of the control unit is seen as signals G1-G12, Memory signals E, R/W/, and 5 clocks going into PC, MAR, MBR, IR and D0, then these can be modelled as a sequence of binary values generated at every new step. We call this the Microprogram and it is shown below.

Components of a Microprogrammed Control Unit Address Mapper: Lookup table containing starting address of the microprogram for each of the possible Opcodes. Ie it translates the binary Opcode into a Microprogram to execute Microprogram Counter: Clocked to step through the microprogram memory in sequence Microprogram Memory: Stores basic microinstructions sequences for execution Microinstruction register: This is divided into 4 fields: 1.Next microinstruction address 2.Microprogram counter load control field 3.Condition select field 4.CPU control field

Components of a Microprogrammed Control Unit - continued Most of the bits in the microinstruction register belong to the CPU control field. This field controls the flow of information within the CPU by enabling the 3-state gates and clocking signals Microinstruction sequence control is determined by the 3 Left-Hand fields of the microinstruction register NEXT ADDRESS, LOAD CONTTORL CONDITION SELECT By loading the address into the next address field a branch can be made anywhere in the microprogram memory Load control tells the microprogram counter how to get the next address Condition select field, implements the conditonal branches at microinstruction level (through a multiplexer)

Designing a CPU Designing a CPU involves a number of stages: Stage 1: Select the CPU size in Bits and Define an instruction set that would be used by the CPU. For the selected number of Bits, consider Add 8 to accumulator how the instruction field would be broken up into its constituent parts to make the Opcode, Addressing Mode, Operand. An example format is as follows: 3 Bits for OPCODE 1 Bit for Addressing Mode Four Bits for OPERAND

Define the instruction set Having three bit for the OPCODE allows seven different instructions to be used along with two different addressing modes. The table shown below outlines the sixteen different combinations of OPCODE and addressing mode that make the upper four bits of the instruction. The lower four bits are left to be assigned to either a direct value or memory location.

Instruction set - Continued

Instruction set - continued

Example execution of a simple program: LDA 7; Load accumulator with value 7 7 Store this in memory address 7 LDA 5 Load accumulator with value 5 ADD 8 Add 8 to the value in the accumulator STOP Note that initially ALL registers are 0 Every time that we execute an instruction we increment the program counter PC

FETCH CYCLE: MODEL THE ADD, D0 1. [MAR]  [PC] 2. [PC]  INC 3. [MBR]  [M([MAR])] Enable Memory ; (E), R/W = 1, clock MBR 4. [IR]  [MBR] clock IR 4a CU  [IR(OPCODE)]

5. [MAR]  [IR(address)] clock MAR 6. [MBR]  [M(MAR)]; enable memory, clock MBR

7. ALU  [MBR] 7a ALU  [D0] 8. [D0]  [ALU] clock D0

FETCH CYCLE: REPEATED 7) 9.[MAR]  [PC] 10. [PC]  INC 11. [MBR]  [M([MAR])] Enable Memory ; (E), R/W = 1, clock MBR 12. [IR]  [MBR] 12a CU  [IR(OPCODE)]

13. [MAR]  [MBR] ; Value available so prepare MAR for Store

14. [MBR]  [D0] ; Put value to use in addition into MBR

FETCH CYCLE: REPEATED (LDA 5) 15.[MAR]  [PC] 16. [PC]  INC 17. [MBR]  [M([MAR])] Enable Memory ; (E), R/W = 1, clock MBR 18. [IR]  [MBR] 18a CU  [IR(OPCODE)]

19. [MAR]  [IR(address)] clock MAR

20.[MBR]  [M(MAR)]; enable memory, clock MBR 21. [MBR]  [D0] ; Put value to use in addition into MBR

FETCH CYCLE: REPEATED (ADD) 22.[MAR]  [PC] 23. [PC]  INC 24. [MBR]  [M([MAR])] Enable Memory ; (E), R/W = 1, clock MBR 25. [IR]  [MBR] 25a CU  [IR(OPCODE)]

26. [MAR]  [IR(address)] clock MAR

27. [MBR]  [M(MAR)]; enable memory, clock MBR 28. ALU  [MBR] 29. [D0]  [ALU]

FETCH CYCLE: REPEATED (STOP) 30.[MAR]  [PC] 31. [PC]  INC 32. [MBR]  [M([MAR])] Enable Memory ; (E), R/W = 1, clock MBR 33. [IR]  [MBR] 33a CU  [IR(OPCODE)]

34. [MAR]  [MBR] ; Prepare for new cycle