Computer Architecture Programming the Basic Computer

Similar documents
Blog -

MICROPROGRAMMED CONTROL

Chapter 3 : Control Unit

MICROPROGRAMMED CONTROL:-

MICROPROGRAMMED CONTROL

Control Unit Implementation Hardwired Memory

MICROPROGRAMMED CONTROL

MICROPROGRAMMED CONTROL

Chap. 7 Microprogrammed Control(Control Unit)

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

Nanostorage and Nanoprogram

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

CHAPTER SIX BASIC COMPUTER ORGANIZATION AND DESIGN

Computer Organization and Architecture

UNIT-III REGISTER TRANSFER LANGUAGE AND DESIGN OF CONTROL UNIT

Computer Architecture

COMPUTER ARCHITECTURE AND ORGANIZATION Register Transfer and Micro-operations 1. Introduction A digital system is an interconnection of digital

Unit II Basic Computer Organization

REGISTER TRANSFER LANGUAGE

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

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

Blog -

Computer Architecture

Digital System Design Using Verilog. - Processing Unit Design

Computer Organisation CS303

csitnepal Unit 3 Basic Computer Organization and Design

Faculty of Engineering Systems & Biomedical Dept. First Year Cairo University Sheet 6 Computer I

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

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

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

5-1 Instruction Codes

Computer Organization Control Unit. Department of Computer Science Missouri University of Science & Technology

Register Transfer and Micro-operations

Module 5 - CPU Design

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

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

Chapter 16. Control Unit Operation. Yonsei University

Register-Level Design

Darshan Institute of Engineering & Technology for Diploma Studies Unit - 1

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

REGISTER TRANSFER AND MICROOPERATIONS

Computer Logic II CCE 2010

Combinational and sequential circuits (learned in Chapters 1 and 2) can be used to create simple digital systems.

PART A (22 Marks) 2. a) Briefly write about r's complement and (r-1)'s complement. [8] b) Explain any two ways of adding decimal numbers.

Chapter 4. MARIE: An Introduction to a Simple Computer 4.8 MARIE 4.8 MARIE A Discussion on Decoding

Chapter 17. Microprogrammed Control. Yonsei University

CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY COMPUTER ARCHITECURE- III YEAR EEE-6 TH SEMESTER 16 MARKS QUESTION BANK UNIT-1

COMPUTER ORGANIZATION

CHAPTER 4: Register Transfer Language and Microoperations

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

M. Sc (CS) (II Semester) Examination, Subject: Computer System Architecture Paper Code: M.Sc-CS-203. Time: Three Hours] [Maximum Marks: 60

BASIC COMPUTER ORGANIZATION AND DESIGN

Processing Unit CS206T

TABLE 8-1. Control Signals for Binary Multiplier. Load. MUL0 Q 0 CAQ sr CAQ. Shift_dec. C out. Load LOADQ. CAQ sr CAQ. Shift_dec P P 1.

For Example: P: LOAD 5 R0. The command given here is used to load a data 5 to the register R0.

Page 521 CPSC 5155 Last Revised July 9, 2011 Copyright 2011 by Edward L. Bosworth, Ph.D. All rights reserved.

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

C.P.U Organization. Memory Unit. Central Processing Unit (C.P.U) Input-Output Processor (IOP) Figure (1) Digital Computer Block Diagram

Introduction to CPU Design

Topics. Computer Organization CS Exam 2 Review. Infix Notation. Reverse Polish Notation (RPN)

CPU Design John D. Carpinelli, All Rights Reserved 1

TYPICAL QUESTIONS & ANSWERS

Micro-programmed Control Ch 15

BASIC COMPUTER ORGANIZATION AND DESIGN

Computer architecture Assignment 3

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

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

REGISTER TRANSFER AND MICROOPERATIONS

BASIC COMPUTER ORGANIZATION AND DESIGN

IA Digital Electronics - Supervision I

Micro-programmed Control Ch 15

UNIT - V MEMORY P.VIDYA SAGAR ( ASSOCIATE PROFESSOR) Department of Electronics and Communication Engineering, VBIT

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

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

UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS

Chapter 4 The Von Neumann Model

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

Major and Minor States

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Computer Organization and Design

THE MICROPROCESSOR Von Neumann s Architecture Model

Micro-programmed Control Ch 17

Chapter 14 Design of the Central Processing Unit

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

8-1. Fig. 8-1 ASM Chart Elements 2001 Prentice Hall, Inc. M. Morris Mano & Charles R. Kime LOGIC AND COMPUTER DESIGN FUNDAMENTALS, 2e, Updated.

Computer Architecture and Organization: L09: CPU Organization

Microcomputer Architecture and Programming

Control Unit Implementation

COMPUTER ORGANIZATION AND ARCHITECTURE

8-1. Fig. 8-1 ASM Chart Elements 2001 Prentice Hall, Inc. M. Morris Mano & Charles R. Kime LOGIC AND COMPUTER DESIGN FUNDAMENTALS, 2e, Updated.

STRUCTURE OF DESKTOP COMPUTERS

William Stallings Computer Organization and Architecture

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

omputer Design Concept adao Nakamura

Computer Organization (Autonomous)

CHAPTER 8: Central Processing Unit (CPU)

4. MICROPROGRAMMED COMPUTERS

Controller Implementation--Part II

Computer Architecture: Part III. First Semester 2013 Department of Computer Science Faculty of Science Chiang Mai University

Implementing the Control. Simple Questions

Transcription:

4. The Execution of the EXCHANGE Instruction The EXCHANGE routine reads the operand from the effective address and places it in DR. The contents of DR and AC are interchanged in the third microinstruction. The original content of AC that is now in DR is stored back in memory. Note that Table 8.5 contains a partial list of the microprogram. Only four out of 6 possible computer instructions have been microprogrammed. Also, control memory words at locations 69 to 27 have not been used. Control memory words 69 to 27 can be used for other instructions such as multiply, divide, and others. Binary Microprogram Also the symbolic microprogram is a convenient way for writing microprograms in a way that people can read and understand, but this is not the way that the microprogram is stored in memory. The symbolic microprogram must be translated to binary either by means of an assembler program or by the user if the microprogram is simple enough as in this example. Table 8.6 Micro Routine ADD 2 3 BRANCH 4 5 6 7 STORE 8 9 EXCHANGE 2 3 4 5 FETCH 64 65 66 INDRCT 67 68 Address Binary Microinstruction Decimal Binary F F2 F3 CD BR AD Page 2 of Chapter 8

The equivalent binary form of the microprograms is listed in Table 8.6 above. The addresses for control memory are given in both decimal and binary. The binary content of each microinstruction is derived from the symbols and their equivalent binary values as defined in Tables 8.2, 8.3, and 8.4. Notes:. Address 3 has no equivalent in the symbolic microprogram since the ADD routine has only three microinstructions at addresses,, and 2. The next routine starts at address 4. 2. Even though address 3 is not used, some binary value must be specified for each word in control memory. We could have specified all 's in the word since this location will never be used. However; if some unforeseen error occurs, or if a noise signal sets CAR to the value of 3, it will be wise to jump to address 64, which is the beginning of the fetch routine. 8.4. Design of Control Unit The microinstruction format usually is divided into fields, each field provides control bits to initiate microoperations in the system, special bits to specify the way that the next address is to be evaluated, and an address field for branching. The method of grouping mutually exclusive variables into fields and encoding the k bits in each field to provide 2 k microoperations is used to reduce the number of control bits that initiate microoperations. Each field requires a decoder to produce the corresponding control signals. This method has an advantage of reducing the size of the microinstruction bits with the following drawbacks: -. It requires additional hardware external to the control memory. 2. Increase the delay time of the control signals because they must propagate through the decoding circuits. Page 22 of Chapter 8

The encoding of control bits was demonstrated in the programming example of the preceding section. The nine bits of the microoperation field are divided into three subfields of three bits each. The control memory output of each subfield must be decoded to provide the distinct microoperations. The outputs of the decoders are connected to the appropriate inputs in the processor unit. Figure 8.6 shows the three 3 x 8 decoders. Each decoder is used to decode one field of the microinstruction presently available in the output of control memory to provide eight outputs. Each output of these decoders is connected to the proper circuit of the processor unit to initiate the corresponding microoperation as specified in Tables 8.2, 8.3, and 8.4. Examples Figure 8.6. When Fl = (binary 5), the next clock pulse transition transfers the content of DR (-) to AR (symbolized by DRTAR in Table 8.2). 2. When Fl = (binary 6), the next clock pulse transition transfers the content of PC to AR (symbolized by PCTAR in Table 8.2). Page 23 of Chapter 8

From the examples above, it is clear that the multiplexers select information from DR when output 5 is active and from PC when output 5 is inactive. The other outputs of the decoders that initiate transfers between registers must be connected in a similar manner. The arithmetic logic shift unit can be designed as in figures 6.2 and 6.2 of chapter 6. Instead of using gates to generate the control signals marked by the symbols AND, ADD, and DR in figure 6.2, these inputs will now come from the outputs of the decoders associated with the symbols AND, ADD, and DRTAC, respectively, as shown in figure 8.6. The other outputs of the decoders that are associated with an AC operation must also be connected to the arithmetic logic shift unit in a similar manner. Microprogram Sequencer The basic components of a microprogrammed control unit are: -. The control memory. 2. The circuits that select the next address. The address selection part is called a Microprogram Sequencer. The purpose of the microprogram sequencer is to present an address to the control memory so that a microinstruction may be read and executed. The next-address logic of the sequencer determines the specific address source to be loaded into the control address register (CAR). The choice of the address source is guided by the next-address information bits that the sequencer receives from the present microinstruction. Commercial sequencers include within the unit an internal register stack used for temporary storage of addresses during microprogram looping and subroutine calls. Some sequencers provide an output register which can function as the address register for the control memory. Page 24 of Chapter 8

To illustrate the internal structure of a typical microprogram sequencer, we will show a particular unit that is suitable for use in the microprogram computer example developed in the preceding section. Figure 8.7 shows the block diagram of the microprogram sequencer. The control memory is included in the diagram to show the interaction between the sequencer and the memory attached to it. Figure 8.7. There are two multiplexers in the circuit. a. The first multiplexer symbolized by MUX selects an address from one of four sources and transfer it into a control address register CAR. The output from CAR provides the address for a given word in the control memory. b. The second multiplexer symbolized by MUX2 tests the value of selected status bit and the result of the test is applied to an input logic circuits. Page 25 of Chapter 8

The four inputs to MUX come from: - The incremented content of CAR which is applied to one of the multiplexer inputs and to the subroutine register (SBR). The address field of the present microinstruction. The outputs of SBR. The external source that maps the instruction. 2. The diagram shows a single subroutine register. a typical sequencer will have a register stack about four to eight levels deep. In this way, a number of subroutines can be active at the same time. A push and pop operation, in conjunction with a stack pointer, stores and retrieves the return address during the call and return microinstructions. 3. The input logic circuit. The condition field (CD) of the microinstruction selects one of the status bits in the second multiplexer (MUX). If the bit selected is equal to, the T (test) variable is equal to ; otherwise, it is equal to. The T value together with the two bits from the branch field (BR) goes to an input logic circuit. The input logic in a particular sequencer will determine the type of operations that are available in the unit. Typical sequencer operations are: increment, branch or jump, call and return from subroutine, load an external address, push or pop the stack, and other address sequencing operations. With three inputs, the sequencer can provide up to eight address sequencing operations. Some commercial sequencers have three or four inputs in addition to the T input and thus provide a wider range of operations. The input logic circuit in figure 8.7 has three inputs, I, I, and T, and three outputs, S, S, and L. Variables S and S select one of the source addresses for CAR. Variable L enables the load input in SBR. The binary values of the two selection variables determine the path in the multiplexer. For example, with SS =, multiplexer input number 2 is selected and establishes a transfer path from SBR to CAR. Note that each of the four inputs as well as the output of MUX contains a 7-bit address. Page 26 of Chapter 8

Table 8.7 shows the truth table for the input logic circuit. Inputs I and I are identical to the bit values in the BR field. The function listed in each entry was defined in Table 8.3. The bit values for S and S are determined from the stated function and the path in the multiplexer that establishes the required transfer. The subroutine register is loaded with the incremented value of CAR during a call microinstruction (BR = ) provided that the status bit condition is satisfied (T = ). Table 8.7 BR Field Input I I T S x x MUX Load SBR L S The truth table can be used to obtain the simplified Boolean functions for the input logic circuit: S I S I I I T L I I T The circuit can be constructed with three AND gates, an OR gate, and an inverter. Page 27 of Chapter 8

Note that the incrementer circuit in the sequencer of figure 8.7 is not a counter constructed with flip-flops but rather a combinational circuit constructed with gates. A combinational circuit incrementer can be designed by cascading a series of half-adder circuits as shown in figure 8.8. The output carry from one stage must be applied to the input of the next stage. One input in the first least significant stage must be equal to to provide the increment-by-one operation. Figure 8.8 Page 28 of Chapter 8

8.. Define the following: (a) Microoperation. (b) Microinstruction. (c) Microprogram. (d) Microcode. Problems 8.2. The microprogrammed control organization shown in Figure 8. has the following propagation delay times. 4 ns to generate the next address, ns to transfer the address into the control address register, 4 ns to access the control memory ROM, ns to transfer the microinstruction into the control data register, and 4 ns to perform the required microoperations specified by the control word. What is the maximum clock frequency that the control can use? What would the clock frequency be if the control data register is not used? 8.3. The control memory in figure 8.2 has 496 words of 24 bits each. a. How many bits are there in the control address register? b. How many bits are there in each of the four inputs shown going into the multiplexers? c. What are the number of inputs in each multiplexer and how many multiplexers are needed? 8.4. Using the mapping procedure described in figure 8.3, give the first microinstruction address for the following operation code: (a). (b). (c). 8.5. Formulate a mapping procedure that provides 8 consecutive microinstructions for each routine. The operation code has six bits and the control memory has 248 words. 8.6. Explain how the mapping from an instruction code to a microinstruction address can be done by means of a read-only memory. What is the advantage of this method compared to the one in figure 8.3? Page 29 of Chapter 8

8.7. Using Table 8.2, give the 9-bit microoperation field for the following microoperations: a. AC AC +, DR DR + b. PC PC +, DR M [AR] c. DR AC, AC DR 8.8. Using Table 8.2, convert the following symbolic microoperations to register transfer statements and to binary. a. READ, INCPC b. ACTDR, DRTAC c. ARTPC, DRTAC, WRITE 8.9. Suppose that we change the ADD routine listed in Table 8.5 to the following two microinstructions. ADD: READ I CALL INDR2 ADD U JMP FETCH What should be subroutine INDR2? 8.. The following is a symbolic microprogram for an instruction in the computer defined in section 8.3. ORG 4 NOP S JMP FETCH NOP Z JMP FETCH NOP I CALL INDRCT ARTPC U JMP FETCH a. Specify the operation performed when the instruction is executed. b. Convert the four microinstructions into their equivalent binary form. 8.. Add the following instructions to the computer of Section 8.3 (EA is the effective address). Write the symbolic microprogram for each routine as in Table 8.5. (Note that AC must not change in value unless the instruction specifies a change in AC). Page 3 of Chapter 8

Symbol Opcode Symbolic Function Description AND SUB ADM BTCL BZ SEQ BPNZ AC AC M [EA] AC AC M [EA] M [EA] M [EA] + AC AC AC M [EA] If (AC = ) then (PC EA) If (AC = M [EA] ) then (PC PC + ) If (AC > ) then (PC EA) AND Subtract Add to memory Bit clear Branch if AC zero Skip if equal Branch if positive and nonzero 8.2. Show how outputs 5 and 6 of decoder F3 in figure 8.6 are to be connected to the program counter PC. 8.3. Show how a 9-bit microoperation field in a microinstruction can be divided into subfields to specify 46 microoperations. How many microoperations can be specified in one microinstruction? 8.4. A computer has 6 registers, an ALU (arithmetic logic unit) with 32 operations, and a shifter with eight operations, all connected to a common bus system. a. Formulate a control word for a microoperation. b. Specify the number of bits in each field of the control word and give a general encoding scheme, c. Show the bits of the control word that specify the microoperation. 8.5. Assume that the input logic of the microprogram sequencer of figure 8.7 has four inputs, I2, I, I, T (test), and three outputs, S, S, and L. The operations that are performed in the unit are listed in the following table. Design the input logic circuit using a minimum number of gates. I2 I I Operation Increment CAR if T =, jump to AD if T = x Jump to AD unconditionally Increment CAR unconditionally Jump to AD if T =, increment CAR if T = Call subroutine if T =, increment CAR if T = Return from subroutine unconditionally Map external address unconditionally Page 3 of Chapter 8