ENGG3380: Computer Organization and Design Lab5: Microprogrammed Control

Similar documents
ENGG3380: Computer Organization and Design Lab4: Buses and Peripheral Devices

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

Introduction to CPU Design

Digital System Design Using Verilog. - Processing Unit Design

Microprogramming is a technique to implement the control system of a CPU using a control store to hold the microoperations.

CS150 Project Final Report

Advanced Computer Architecture

MICROPROGRAMMED CONTROL

Chapter 3 : Control Unit

Materials: 1. Projectable Version of Diagrams 2. MIPS Simulation 3. Code for Lab 5 - part 1 to demonstrate using microprogramming

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

Blog -

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

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

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

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

Materials: 1. Projectable Version of Diagrams 2. MIPS Simulation 3. Code for Lab 5 - part 1 to demonstrate using microprogramming

Computer Architecture Programming the Basic Computer

Register-Level Design

Module 5 - CPU Design

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

Blog -

Implementing the Control. Simple Questions

Chapter 4. MARIE: An Introduction to a Simple Computer

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

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

Chapter 4. Chapter 4 Objectives. MARIE: An Introduction to a Simple Computer

CSE 141L Computer Architecture Lab Fall Lecture 3

MARIE: An Introduction to a Simple Computer

MARIE: An Introduction to a Simple Computer

Generating the Control Unit

Major and Minor States

Control Unit for Multiple Cycle Implementation

Micro-programmed Control Ch 15

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

Computer Logic II CCE 2010

Final Exam Review. b) Using only algebra, prove or disprove the following:

Micro-programmed Control Ch 15

Multicycle Approach. Designing MIPS Processor

Processing Unit CS206T

Chapter 16. Control Unit Operation. Yonsei University

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.

Lab 6 Using PicoBlaze. Fast Sorting.

Control Unit Implementation

The Processor: Datapath & Control

William Stallings Computer Organization and Architecture

CISC Processor Design

1. Fundamental Concepts

Microprogrammed Control Approach

Micro-programmed Control Ch 17

VLIW Digital Signal Processor. Michael Chang. Alison Chen. Candace Hobson. Bill Hodges

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

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.

COMPUTER STRUCTURE AND ORGANIZATION

Control unit. Input/output devices provide a means for us to make use of a computer system. Computer System. Computer.

Topic #6. Processor Design

Chapter 20 - Microprogrammed Control (9 th edition)

EECS150. Implement of Processor FSMs

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

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

Basic Processing Unit (Chapter 7)

structural RTL for mov ra, rb Answer:- (Page 164) Virtualians Social Network Prepared by: Irfan Khan

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 Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Data Paths and Microprogramming

EECE 417 Computer Systems Architecture

ADVANCED COMPUTER ARCHITECTURE TWO MARKS WITH ANSWERS

Introduction. ENG3380 Computer Organization and Architecture MIPS: Data Path Design Part 3. Topics. References. School of Engineering 1

PESIT Bangalore South Campus

What Are The Main Differences Between Program Counter Pc And Instruction Register Ir

Microprogramming. Bởi: Hoang Lan Nguyen. - Controller the data to move from one register to another

1 The ARC processor (data path and control)

Controller Implementation--Part II

BASIC COMPUTER ORGANIZATION AND DESIGN

Chapter 4 The Von Neumann Model

Computer Organization (Autonomous)


CC312: Computer Organization

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

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

CC 311- Computer Architecture. The Processor - Control

ECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University

COMPUTER ORGANIZATION AND ARCHITECTURE

UNIVERSITY OF HONG KONG DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING. Principles of Computer Operation

CPE300: Digital System Architecture and Design

THE MICROPROCESSOR Von Neumann s Architecture Model

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

omputer Design Concept adao Nakamura

ENE 334 Microprocessors

V8-uRISC 8-bit RISC Microprocessor AllianceCORE Facts Core Specifics VAutomation, Inc. Supported Devices/Resources Remaining I/O CLBs

Lecture-15 W-Z: Increment-Decrement Address Latch:

Electronics Engineering, DBACER, Nagpur, Maharashtra, India 5. Electronics Engineering, RGCER, Nagpur, Maharashtra, India.

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

Chapter 4. The Processor

Chapter 14 Design of the Central Processing Unit

CS Computer Architecture


Chapter 6: Datapath and Control. Principles of Computer Architecture. Principles of Computer Architecture by M. Murdocca and V.

ENGR 3410: Lab #1 MIPS 32-bit Register File

Computer Architecture

Processor design - MIPS

Transcription:

ENGG330: Computer Organization and Design Lab5: Microprogrammed Control School of Engineering, University of Guelph Winter 201 1 Objectives: The objectives of this lab are to: Start Date: Week #5 201 Due Date: Week #6 201 Acquaint you with two common methods for CPU control circuit design. Design a microprogrammed control circuit. Implement a mock-up of this circuit using the FPGA board. 2 CPU Control Design The datapath of a CPU is the circuit that contains, transfers and performs operations of program data. It should have at least a register file, an ALU, a method to communicate between the two (internal bus), and a method to allow the CPU to communicate with the outside world to get new data or send back the data after it s been processed (external bus). The datapath has much logic for computation of numbers required in the flow of software, but not the means to control the flow itself. The control unit of a CPU is what makes the datapath tick. It generates all control signals and plugs into the datapath to produce the desired behavior. While there are a plethora of control implementations out there, they are divided into two major categories: Hardwired. Microprogrammed. Hardwired control was historically the first. Instruction sets were designed and hard-coded into CPU circuitry. Combinational logic was used directly to decode an instruction contained in the instruction register (IR) into the control signals required to execute it. The logic combined the bit values in IR and the state of a cycle counter (step generator) to implement multi-cycle instruction operation as shown in Figure 1. As instruction sets grew in size, and instructions became more complicated (ie. entire string operations in a single instruction), creating hardwired controls in combinational logic became more and more complicated. Probability of mistakes also increased with size of the circuit, and errors in hardwired controls discovered following production required throwing the chips away and replacing them with new ones. The increasing cost of design, and the risks involved, led to an introduction of a more flexible circuit - the microprogrammed controller, shown in Figure 2. Each assembly level instruction at the software level is now decomposed internally into the number of required clock cycles to execute it on the datapath, and each clock cycle of an instruction on the datapath is

Figure 1: Hardwired Control CPU controlled by a microinstruction. In other words, a software program is rewritten from a series of multi-cycle instructions into sets of single cycle microinstructions as shown in Figure 3. All microcode instructions are stored like subroutines in a special memory inside the CPU - the microprogram store. A microinstruction is simply a concatenated set of control bits. A upc register is used to address the current ucode instruction in the store, and the uir is used to read off this instruction and connect the control bits it contains to the datapath. As software instructions may need different numbers of clock cycles to execute, there must also be some sort of ucode flow control implemented into the design - branches and jumps are also needed within microinstructions contained in the store. This functionality can easily be achieved by providing some of the bits within the microinstructions as signals for upc control. For example, at the end of each microprogram, representative of completion of one software instruction, upc should jump to ucode that facilitates the fetching of the next software instruction into the IR. In the simplest case, the OP code for an instruction can stand for the most significant bits of the upc jump address, and the flow control bits incorporated into each microinstruction can include signals for increment or reset of the upc register, or have the next address bits concatenated directly in the ucode, thus in some way contributing to a simple next address generator circuit. It is normal for ucode instructions to be very wide, depending on the control requirements of the datapath, especially when the datapath is pipelined very deep. In this case hundreds of control bits may be necessary. The benefit of defining all control functions using a memory block is to have the ability to easily reprogram it, to either add functionality or correct for mistakes.

Figure 2: Microprogrammed Control CPU 3 Microprogrammed Control In this lab, we will design and implement a microprogrammed control circuit. Since we will not have a datapath to plug this circuit into, we will emulate its operation on the FPGA board using our customary 7seg display to see the datapath control bit values presented at each clock cycle, and the switches to enter new software instructions to execute. Figure 4 is a top level diagram of the desired design. For the external signals, the switches are connected to IR. However, IR latches only on an enable signal, which is provided as one of the control signals by the microinstructions executed. The decoder translates the op code presented by IR to an address into the microcode store. For example, if the opcode field in IR is 4 bits wide, and at least 16 microcode instruction slots are reserved for each opcode, which gives an bit address space, the decoder can simply take the 4 opcode bits as an input and output an bit decoded address with the opcode in the 4 most significant bits, and 0 s in the rest of the lower positions. There must be some deterministic way to start the system, so a reset button (any IO board button) will be connected to reset upc at the users request. This effectively starts executing the first microinstruction in the store. This instruction should perform a fetch (present an enable for IR to latch on next clock, with datapath controls idle). As the microcode instructions are executed, control of upc is needed. You will either need to latch a new instruction value from IR to the upc - ie. perform a jump in the microcode to execute the instructions associated with the opcode in IR. Alternatively, upc should be incremented inside a microprogram for a particular opcode. The completion of an opcode microprogram should follow with resetting the upc to execute the fetch again. The clocking of the microprogrammed control unit will be carried using the manual clock button on the main FPGA board. The 50MHz clock will need to be connected only to the 7seg decoder

Figure 3: Assembly micro-instruction to facilitate appropriate digit scan timing. 4 Microprogrammed Control Unit Design and Implementation Connect the appropriate IO pins at your top level design entity to the 7seg digits, switches, 50MHz clock, manual clock, and a reset button. You may use the LEDs as well if you wish, eg. for debugging. The IR is bits wide, the opcode is on the four most significant bits. Enough address locations should be allocated inside the ucode store to support 15 opcodes plus the fetch, and contain all microcode per instruction as below. 16 bits of datapath control are required to be produced by the microinstructions, hence all 4 digits of the 7seg will be used to display them. In addition, you need to have the internal control signals (IR enable and MUX select) into your microinstructions alongside the datapath control. The bit order of those control signals is not important within a microinstruction, as long as they are appropriately connected within the controller and out to the datapath (ie. 7seg display). The sequence of datapath control signals that should appear on the 7seg is listed here with the relevant opcode. The all zero opcode is omitted here so as to allow you to place the fetch code at that address in the store, and make the decoder simple. You will test your controller on the FPGA board by selecting one of the above opcodes on the switches, then manually clocking the circuit to attain an appropriate output until end of sequence, and finally repeat the process as necessary for all opcodes. Do not forget to simulate your circuit thoroughly. If you already have valid simulations for underlying modules, such as the 7seg, a good practice is to copy the benchmarks together with the VHDL into your new design, so that all necessary simulations are available with your design.

CLOCK (Button) RESET SWITCHES Instruction Register En 1 bit "00000000" MUX Sel 4 2 bits Logic Mapping "Decoder" upc Microcode Store 00011010100000111111 11111111000000011100 00011000100110000000 10001000100001000000 11111110111111110000 00101010101010101010 10011001100110011001 11100011100011100011 11110000111100001111 11111000001111110000 00011100011100011100 11010101000111000000 +1 Control Signals Microprogrammed Control Unit 7 Segment Driver Figure 4: Microprogrammed Control with Sequence Generator OpCode (Hex) ucode Sequence to datapath X1111 X2002 X2003 X1 X2004 X2 X2001 X1234 XF XABCD 5 Report When completed, you will hand in the following deliverables: 1. Title Page 2. A Block diagram of each design. 3. Simulation of each design. 4. VHDL code for each circuit designed (with comments). 5. VHDL code for simulation test-bench (with comments). 6. Report the resources used (LUTS, Flip Flops, e.t.c) for each implementation. 7. Justify your steps.