Computer Logic II CCE 2010

Similar documents
Basic Processing Unit: Some Fundamental Concepts, Execution of a. Complete Instruction, Multiple Bus Organization, Hard-wired Control,

Module 5 - CPU Design


Lecture1: introduction. Outline: History overview Central processing unite Register set Special purpose address registers Datapath Control unit

Digital System Design Using Verilog. - Processing Unit Design

Introduction to CPU Design

Processing Unit. Unit II

DC57 COMPUTER ORGANIZATION JUNE 2013

Chapter 05: Basic Processing Units Control Unit Design. Lesson 15: Microinstructions

MC9211Computer Organization. Unit 4 Lesson 1 Processor Design

MICROPROGRAMMED CONTROL

1. Fundamental Concepts

Unit 8 - Week 7: Organization and Optimization of Micro-programmed Controlled Control Unit

SISTEMI EMBEDDED. Computer Organization Central Processing Unit (CPU) Federico Baronti Last version:

Chapter 3 : Control Unit

Blog -

Micro-Operations. execution of a sequence of steps, i.e., cycles

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

UNIT 3 - Basic Processing Unit

Chapter 16. Control Unit Operation. Yonsei University

2 MARKS Q&A 1 KNREDDY UNIT-I

The Processing Unit. TU-Delft. in1210/01-pds 1

Basic Processing Unit (Chapter 7)

Computer Architecture

Chapter 20 - Microprogrammed Control (9 th edition)

PROBLEMS. 7.1 Why is the Wait-for-Memory-Function-Completed step needed when reading from or writing to the main memory?

Lecture 11: Control Unit and Instruction Encoding

The register set differs from one computer architecture to another. It is usually a combination of general-purpose and special purpose registers

Processing Unit CS206T

William Stallings Computer Organization and Architecture 8 th Edition. Chapter 16 Micro-programmed Control

PESIT Bangalore South Campus

Class Notes. Dr.C.N.Zhang. Department of Computer Science. University of Regina. Regina, SK, Canada, S4S 0A2

Computer Architecture Lecture No.10,11

Computer Architecture Programming the Basic Computer

UNIT I DATA REPRESENTATION, MICRO-OPERATIONS, ORGANIZATION AND DESIGN

Micro-programmed Control Ch 15

Machine Instructions vs. Micro-instructions. Micro-programmed Control Ch 15. Machine Instructions vs. Micro-instructions (2) Hardwired Control (4)

Micro-programmed Control Ch 15

SCRAM Introduction. Philipp Koehn. 19 February 2018

William Stallings Computer Organization and Architecture

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Advanced Computer Architecture

MICROPROGRAMMED CONTROL:-

Generating the Control Unit

Micro-programmed Control Ch 17

Chapter 4 The Von Neumann Model

Hardwired Control (4) Micro-programmed Control Ch 17. Micro-programmed Control (3) Machine Instructions vs. Micro-instructions

Chapter 5. Computer Architecture Organization and Design. Computer System Architecture Database Lab, SANGJI University

Week 4: Assignment Solutions

Unit 1. Chapter 3 Top Level View of Computer Function and Interconnection

William Stallings Computer Organization and Architecture 8 th Edition. Micro-programmed Control

THE MICROPROCESSOR Von Neumann s Architecture Model

JNTUWORLD. 1. Discuss in detail inter processor arbitration logics and procedures with necessary diagrams? [15]

ADVANCED COMPUTER ARCHITECTURE TWO MARKS WITH ANSWERS

CPU Organization. Hardware design. Vs. Microprogramming

There are four registers involved in the fetch cycle: MAR, MBR, PC, and IR.

Microprogrammed Control

CC 311- Computer Architecture. The Processor - Control

csitnepal Unit 3 Basic Computer Organization and Design

Course Description: This course includes concepts of instruction set architecture,


MARTHANDAM COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF INFORMATION TECHNOLOGY TWO MARK QUESTIONS AND ANSWERS

ASSEMBLY LANGUAGE MACHINE ORGANIZATION

CONTROL UNIT CONTROL UNIT. CONTROL vs DATA PATH. Instruction Sequencing. Two main operations of Control Unit can be identified:

CISC Processor Design

CHAPTER 5 Basic Organization and Design Outline Instruction Codes Computer Registers Computer Instructions Timing and Control Instruction Cycle

Register-Level Design

CPU Structure and Function

Chapter 3 - Top Level View of Computer Function

5-1 Instruction Codes

4. MICROPROGRAMMED COMPUTERS

CPE 335. Basic MIPS Architecture Part II

Fig: Computer memory with Program, data, and Stack. Blog - NEC (Autonomous) 1

Outcomes. Lecture 13 - Introduction to the Central Processing Unit (CPU) Central Processing UNIT (CPU) or Processor

Chapter 4 The Von Neumann Model

Introduction to Computer Engineering. CS/ECE 252 Prof. Mark D. Hill Computer Sciences Department University of Wisconsin Madison

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

Chapter 17. Microprogrammed Control. Yonsei University

Basic Computer Organization - Designing your first computer. Acknowledgment: Most of the slides are adapted from Prof. Hyunsoo Yoon s slides.

101. The memory blocks are mapped on to the cache with the help of a) Hash functions b) Vectors c) Mapping functions d) None of the mentioned

Top-Level View of Computer Organization

AC58/AT58 COMPUTER ORGANIZATION DECEMBER Q2 (a) With the help of diagram explain the different functional units of a Computer?

Memory General R0 Registers R1 R2. Input Register 1. Input Register 2. Program Counter. Instruction Register

Implementing the Control. Simple Questions

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Computing Layers

CPU ARCHITECTURE. QUESTION 1 Explain how the width of the data bus and system clock speed affect the performance of a computer system.

2. (a) Compare the characteristics of a floppy disk and a hard disk. (b) Discuss in detail memory interleaving. [8+7]

BASIC COMPUTER ORGANIZATION AND DESIGN

MaanavaN.Com CS1202 COMPUTER ARCHITECHTURE

Chapter 4 The Von Neumann Model

Introduction to CPU architecture using the M6800 microprocessor

ENGG3380: Computer Organization and Design Lab5: Microprogrammed Control

Practice Problems (Con t) The ALU performs operation x and puts the result in the RR The ALU operand Register B is loaded with the contents of Rx

Q.2 a. What are basic operational concepts? Explain. (6)

UNIT- 5. Chapter 12 Processor Structure and Function

Unit II Basic Computer Organization

The Itanium Bit Microprocessor Report

C86 80C88 DS-186

C Functions and Pointers. C Pointers. CS270 - Fall Colorado State University. CS270 - Fall Colorado State University

Initial Representation Finite State Diagram. Logic Representation Logic Equations

Transcription:

Computer Logic II CCE 2010 Dr. Owen Casha Computer Logic II 1

The Processing Unit Computer Logic II 2

The Processing Unit In its simplest form, a computer has one unit that executes program instructions. Because of its central role, this unit is known as the central processing unit (CPU). The solution algorithm for any problem consists of a series of steps that must be carried out in a specific sequence. These steps, each of which represent one machine instruction. Each of these instructions is executed by carrying out a sequence of more rudimentary operations, known as micro instructions. Computer Logic II 3

Program Execution The instructions constituting a program to be executed by a computer are loaded in sequential locations in memory. To execute this program, the CPU fetches instructions, one at a time and performs the functions specified. Instructions are fetched from successive memory locations until a branch or jump instruction is executed. Computer Logic II 4

Program Counter The CPU keeps track of the address of the memory location containing the next instruction by using a dedicated CPU register called the program counter (PC) or instruction pointer (IP). After fetching an instruction, the contents of the PC are updated to point to the next instructions to be executed. Computer Logic II 5

Data Paths Computer Logic II 6

Processor Operations With a few exceptions, most of the operations needed to execute an instruction can be carried out by performing one or more of the following functions: Fetch the contents of a given memory location and load it into a CPU register. Store a word of data from a CPU register into a given memory location. Transfer a word of data from one CPU register to another or to the ALU. Perform an arithmetic or logic operation and store the result in a CPU register. Computer Logic II 7

Fetch a word from Memory Assuming, as an example, that the address of the memory location to be accessed is in register R1 and that the memory contents are to be loaded in R2: [ ] contains of Asynchronous memory (needs a reply) Computer Logic II 8

Synchronous and Asynchronous Transfers A data transfer in which one device initiates the transfer and waits until the other device responds is referred to as an asynchronous transfer. For example the CPU issues a Read request and waits for the MFC signal. In synchronous transfer, one of the control lines carries common timing signals from a central clock. The synchronous transfer scheme leads to simpler implementation, but however it cannot accommodate devices of widely varying speed, except by reducing the speed of all devices to that of the slowest one. Computer Logic II 9

Storing a word in Memory Assuming, as an example, that the address of the memory location to be accessed is in register R1 and that the contents of R2 is to be written to memory: Computer Logic II 10

Input and Output Gating CPU Bus Computer Logic II 11

Register Transfer For example let us consider the transfer of contents of register R1 to register R4: Enable the output of register R1 by setting R1 out to 1. This places the contents of R1 on the CPU bus. Enable the input of register R4 by setting R4 in to 1. This loads the data from the CPU bus into register R4. Computer Logic II 12

An ALU Operation Computer Logic II 13

A Complete Instruction As an example let us consider the instruction: Add (R3), R1 Add the contents of the memory location addressed by R3 (R3 contains the address of the memory location) to the contents of the register R1, storing the result in R1. Execution of this instruction the following actions: Fetch the instructions Fetch the memory operand Perform the addition to R1 Store the results into R1 Micro instructions 1. PC out, MAR in, Read, Clear Y, Set Carry-in, Add, Z in 2. Z out, PC in, WMFC 3. MDR out,ir in 4. R3 out, MAR in, Read 5. Clear Carry-in, R1 out, Y in, WMFC 6. MDR out, Add, Z in 7. Z out, R1 in, End Computer Logic II 14

Instruction fetch (Step 1) Computer Logic II 15

Instruction fetch (Step 2) Computer Logic II 16

Instruction fetch (Step 3) Computer Logic II 17

Operand 1 fetch (Step 4) Computer Logic II 18

Operand 2 load (Step 5) Computer Logic II 19

Perform addition (Step 6) Computer Logic II 20

Store Result (Step 7) Computer Logic II 21

Instruction Parallelism From the previous slides, it is to note that the instructions could be performed in parallel as long and they don t use the CPU bus simultaneously. Thus the CPU bus is used in mutual exclusion. Whilst waiting for memory to reply to request by the CPU, using the WMFC, other operations, which do not need the data from memory could be performed. The two factors decide the division of the instructions into steps. Computer Logic II 22

Branching (Jumps) Branching is accomplished by replacing the current contents of the PC with the branch address, i.e. the address of the instruction to which the program must branch. In relative addressing, the branch address is usually obtained by adding an offset X which is given in the branch instruction, to the current value of the PC. Computer Logic II 23

Get PC contents (Step 4a) Computer Logic II 24

Conditional? (Step 4b) Computer Logic II 25

Add Offset (Step 5) Computer Logic II 26

Restore PC (Step 6) Z in Computer Logic II 27

Hardwired Control One technique for the generating the control signal to perform the required operation steps is the Hardwired Control technique. Consider the sequence of operations needed for the ADD operation seven non-overlapping time slots are required for the execution of this instruction, each of which long enough to enable the CPU to perform all the required actions in the given step. If we assume a constant time is allotted to each step, the required control signals can be based on a counter driven by a clock signal. Computer Logic II 28

Control Unit Organization Computer Logic II 29

Encoder / Decoder * Macro-instructions Micro-instructions * Johnson Counter 100,010,001,100, Computer Logic II 30

Encoder Signal Example Considering the timing of Z in in the various operations considered: Occurs in T 1 of every operation since it makes part of the instruction fetch cycle. Occurs in T 6 of the ADD command. Occurs in T 5 of the JMP command. Z in = T1 + T6 ADD+ T5 JMP+... + Computer Logic II 31

Encoder Logic Computer Logic II 32

The End Case Computer Logic II 33

PLA Circuit Implementation PLA Computer Logic II 34

Micro-programmed Control In microprogrammed control, control signals are generated by a program similar to a machine language program. A control word CW is a word whose individual bits represent the various control signals. Each of the control steps in the control sequence of an instruction defines a unique combination of 1 s and 0 s in the CW. A sequence of CWs corresponding to the control sequence of a machine instruction constitutes the micro-routine for that instruction, and the individual control words in this micro-routine are referred to as micro-instructions. Computer Logic II 35

Micro-instruction Example (Add) Computer Logic II 36

Basic Microprogrammed Control Unit Computer Logic II 37

Conditional Execution Conditional branching cannot be implemented using this simple system. In this case, the microinstruction set is expanded to include some conditional branch microinstructions: In addition to the branch address, these microinstructions specify which of the status flags, condition codes, or, possibly, bits of the instruction register, should be checked as a condition for branching to take place. To support micro-program branching, the organization of the control unit should be modified in a such a way that the address generator could be modified during the execution of an instruction. Computer Logic II 38

JPN Microroutine Computer Logic II 39

Modified Control Unit Computer Logic II 40

Micro PC loading In this control unit, the micro-program-counter is incremented every time a new microinstruction is fetched from the micro-program memory, except: When the end microinstruction is encountered, the Micro- PC is loaded with the address of the first CW in the microroutine for the instruction fetch cycle (address 0). When a new instruction is loaded into IR, the micro-pc is loaded with the starting address of the micro-routine for that instruction. When a branch microinstruction is encountered and the branch condition is satisfied, the micro-pc is loaded with the branch address. Computer Logic II 41

Microinstruction Format In this basic scheme we require a bit for every control signal. Thus in the basic control unit described we need: Computer Logic II 42

Reduced Encoding Scheme Reduction of the scheme is possible by considering the following factors: Most signals are not needed simultaneously, and many signals are mutually exclusive. For example: Only one function of the ALU can be active at one time The source for data transfer is unique Read and write memory signals are mutually exclusive. Thus all mutually exclusive signals are placed in the same group. It is then possible to use a binary coding scheme to represent signals within a group by introducing additional decoding circuits. Most fields must include a non-active code if none of the members are needed to be active. Computer Logic II 43

Field-encoded Microinstructions Computer Logic II 44

Encoding Example ADD EXAMPLE Computer Logic II 45

Step 1 ADD Example Computer Logic II 46

Further Reading Computer System Architecture: M. Morris Mano, Prentice Hall. Computer Organization: V. Carl Hamacher, Zvonko G. Vranesic, Safwat G. Zaky, McGraw-Hill International Editions Chapter 3. Computer Logic II 47