Multi Cycle Implementation Scheme for 8 bit Microprocessor by VHDL

Similar documents
COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor.

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

Single cycle MIPS data path without Forwarding, Control, or Hazard Unit

Systems Architecture

Chapter 4. The Processor

Chapter 4. The Processor

The Processor: Datapath and Control. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Design and Implementation of 5 Stages Pipelined Architecture in 32 Bit RISC Processor

Processor (I) - datapath & control. Hwansoo Han

Chapter 4. The Processor. Instruction count Determined by ISA and compiler. We will examine two MIPS implementations

EECE 417 Computer Systems Architecture

The Processor (1) Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

COMPUTER ORGANIZATION AND DESIGN. The Hardware/Software Interface. Chapter 4. The Processor: A Based on P&H

Lecture Topics. Announcements. Today: The MIPS ISA (P&H ) Next: continued. Milestone #1 (due 1/26) Milestone #2 (due 2/2)

Introduction. Datapath Basics

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 4: Datapath and Control

Processor: Multi- Cycle Datapath & Control

Systems Architecture I

PREFACE. Changes to the SOPC Edition

ECE260: Fundamentals of Computer Engineering

Chapter 4. The Processor Designing the datapath

TDT4255 Computer Design. Lecture 4. Magnus Jahre. TDT4255 Computer Design

CS3350B Computer Architecture Winter 2015

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

Lecture Topics. Announcements. Today: Single-Cycle Processors (P&H ) Next: continued. Milestone #3 (due 2/9) Milestone #4 (due 2/23)

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA MIPS ISA. In a CPU. (vonneumann) Processor Organization

5.7. Microprogramming: Simplifying Control Design 5.7

CPE 335 Computer Organization. Basic MIPS Architecture Part I

Block diagram view. Datapath = functional units + registers

Laboratory Single-Cycle MIPS CPU Design (3): 16-bits version One clock cycle per instruction

COMP 303 MIPS Processor Design Project 3: Simple Execution Loop

Design of a Pipelined 32 Bit MIPS Processor with Floating Point Unit

Chapter 4. The Processor

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

Embedded Soc using High Performance Arm Core Processor D.sridhar raja Assistant professor, Dept. of E&I, Bharath university, Chennai

The Processor. Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut. CSE3666: Introduction to Computer Architecture

CO Computer Architecture and Programming Languages CAPL. Lecture 18 & 19

Introduction. Chapter 4. Instruction Execution. CPU Overview. University of the District of Columbia 30 September, Chapter 4 The Processor 1

Computer Organization. Structure of a Computer. Registers. Register Transfer. Register Files. Memories

Programmable Machines

Microprogrammed Control Approach

Programmable Machines

ECE232: Hardware Organization and Design

Laboratory Single-Cycle MIPS CPU Design (4): 16-bits version One clock cycle per instruction

bits 5..0 the sub-function of opcode 0, 32 for the add instruction

CC 311- Computer Architecture. The Processor - Control

Hardware Design Environments. Dr. Mahdi Abbasi Computer Engineering Department Bu-Ali Sina University

Chapter 4 The Processor 1. Chapter 4A. The Processor

CSE140: Components and Design Techniques for Digital Systems

Topic #6. Processor Design

Novel Design of Dual Core RISC Architecture Implementation

Mark Redekopp and Gandhi Puvvada, All rights reserved. EE 357 Unit 15. Single-Cycle CPU Datapath and Control

Design of 16-bit RISC Processor Supraj Gaonkar 1, Anitha M. 2

Chapter 4. The Processor. Computer Architecture and IC Design Lab

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

Introduction to CMOS VLSI Design (E158) Lab 4: Controller Design

FPGA Based Implementation of Pipelined 32-bit RISC Processor with Floating Point Unit

Data paths for MIPS instructions

Chapter 4 The Von Neumann Model

VHDL Implementation of a MIPS-32 Pipeline Processor

EECS 151/251A Fall 2017 Digital Design and Integrated Circuits. Instructor: John Wawrzynek and Nicholas Weaver. Lecture 13 EE141

The MIPS Processor Datapath

COMPUTER ORGANIZATION AND DESIGN

Processor Implementation in VHDL. University of Ulster at Jordanstown University of Applied Sciences, Augsburg

Final Project: MIPS-like Microprocessor

Processor design - MIPS

Review: Abstract Implementation View

Chapter 5: The Processor: Datapath and Control

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


Computer Science 141 Computing Hardware

ENE 334 Microprocessors

Implementing the Control. Simple Questions

IMPLEMENTATION OF SOC CORE FOR IOT ENGINE

These actions may use different parts of the CPU. Pipelining is when the parts run simultaneously on different instructions.

COSC 122 Computer Fluency. Computer Organization. Dr. Ramon Lawrence University of British Columbia Okanagan

Inf2C - Computer Systems Lecture Processor Design Single Cycle

CPE300: Digital System Architecture and Design

ECE 250 / CPS 250 Computer Architecture. Processor Design Datapath and Control

CSEE 3827: Fundamentals of Computer Systems

Hardware Design I Chap. 10 Design of microprocessor

Chapter 4. The Processor

Microcomputer Architecture and Programming

TEACHING COMPUTER ARCHITECTURE THROUGH DESIGN PRACTICE. Guoping Wang 1. INTRODUCTION

comp 180 Lecture 25 Outline of Lecture The ALU Control Operation & Design The Datapath Control Operation & Design HKUST 1 Computer Science

1. Fundamental Concepts

An FPGA Implementation of 8-bit RISC Microcontroller

CS 61C: Great Ideas in Computer Architecture. MIPS CPU Datapath, Control Introduction

Dual Port SRAM Based Microcontroller Chip Test Report

Design and Implementation of a FPGA-based Pipelined Microcontroller

Laboratory Pipeline MIPS CPU Design (2): 16-bits version

Processing Unit CS206T

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Data Paths and Microprogramming

Computer Organization

The CPU and Memory. How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram:

Computer Architecture

ECE 486/586. Computer Architecture. Lecture # 7

ECE232: Hardware Organization and Design. Computer Organization - Previously covered

CS222: Processor Design

Transcription:

Multi Cycle Implementation Scheme for 8 bit Microprocessor by VHDL Sharmin Abdullah, Nusrat Sharmin, Nafisha Alam Department of Electrical & Electronic Engineering Ahsanullah University of Science & Technology Dhaka, Bangladesh Abstract Computers and computer systems play a significant role in the modern world. The central component of these computers and computer systems is the microprocessor. The applications of digital designs are present in designing microprocessors. This paper presents the implementation of the design of a Multi Cycle Central Processing Unit (CPU) in Very High Speed Integrated Circuits (VHSIC) Hardware Description Language or commonly known as VHDL. The implementation was carried out to understand the development of processor hardware as the design and customization of the processors which has become a mainstream task in the development of complex Systems-on-Chip. Keywords, Instruction fetch, Instruction decode, Execution, Control, controller, Data memory, VHDL implementation. I. INTRODUCTION A microprocessor is an integrated circuit on a tiny silicon chip that contains thousands or millions of tiny on/off switches, known as transistors. It is designed to perform arithmetic and logic operations that make use of data on the chip and data in RAM (Random Access Memory) [1]. It computes instructions depending on how fast the processor is designed and if the processor's clock crystal (think of the clock crystal as a metronome). The faster (in MHz or GHz) the processor and its clock crystal are the better. Processors currently come in 8, 16, 32 and 64 bit versions. This paper presents the design of an eight bit multi cycle microprocessor by VHDL which can describe the behavior and structure of electronic systems, but is particularly suited as a language to describe the structure and behavior of digital electronic hardware designs, such as ASICs and FPGAs as well as conventional digital circuits. Processor s speed can be improved by using multi cycle implementations. In the first section starting from a simple implementation scheme of a MIPS (Million Instruction Per Second) subset the basic hardware of the microcontroller s data path and its control is developed step by step and implemented in VHDL. Test benches will verify the correct implementation of the arithmetic logical instructions (add, sub, and, or and slt), the memory-reference instructions (load word and store word) and the branch instructions (beq and jump). Processor speed can be improved by using multi cycle implementation. Then, instructions are allowed to take different numbers of clock cycles and functional units can be shared within the execution of single instructions. Multi cycle implementation also called multi clock cycle implementation [2]. Fig. 1. High level view of multi cycle Data path [3]. In order to enhance the performance and to get very fast processors another implementation technique called pipelining is introduced. Multiple instructions are overlapped in execution so that some stages are working in parallel. Fig. 2. Pipelined Version of the Data path [4]. 1783

II. DESIGN TASK A. Data path A data path is a collection of functional units, such as arithmetic logic units or multipliers that perform data processing operations. It is a central part of many central processing units (CPUs) along with the control unit, which largely regulates interaction between the data path and the data itself, usually stored in registers or main memory. B. Register transfer level models implemented in pure vhdl The key advantage of VHDL, when used for systems design, is that it allows the behavior of the required system to be described (modeled) and verified (simulated) before synthesis tools translate the design into real hardware (gates and wires). A VHDL project is portable. Being created once, a calculation block can be used in many other projects. Fig. 5. Block Diagram of INSTRUCTION DECODE C. Synthesis tool: ALTERA QUARTUSII The Quartus II development software provides a comprehensive environment for system-on-a-programmablechip (SOPC) design. It provides a complete design environment for FPGA designs. Design entry uses schematics, block and Verylog HDL. Design analysis and synthesis, fitting, assembling, timing analysis, simulation. D. Block diagram of first hierarchy levels A Quartus II Block Diagram File can be used as part of a hierarchical design. That is, it can be represented as a component in a higher-level design. Fig. 6. Block diagram of EECUTION UNIT Fig. 7. Block diagram of CONTROL UNIT Fig. 3. Block diagram of. Fig. 4. Block diagram of INSTRUCTION FETCH. Fig. 8. Block diagram of DATA MEMORY. 1784

III. Fig. 9. Block diagram of CONTROLLER MULTI CYCLE IMPLEMENTATION The Multi cycle implementation uses several registers to temporarily hold the output of the previous clock cycle. These include an Instruction register, Memory data register, Output register, etc. The Multi cycle machine breaks simple instructions down into a series of steps. These steps are: A. Instruction fetch step During the instruction fetch step the Multi cycle processor fetches instructions from the memory and computes the address of the next instruction by incrementing the program counter (PC). B. Instruction decode and Register fetch step During the second step, the Instruction decode and register fetch step, we decode the instruction to figure out what type it is: memory access, R-type, I-type, branch. C. Execution, memory address computation, or branch completion step During the third step, the Execution, memory address computation, or branch completion step functions in different ways depending on what type of instruction the processor is executing. This third step is the last step for branch and jump instructions. It is the step where the next PC address is computed and stored. D. Memory access or R-type instruction completion step The fourth step only takes place in load word, store word, R-type, and I-type instructions. This step is when the load and store word instructions access the memory and use an arithmetic-logical instruction to write its result. Values are either loaded from memory and stored into the memory data register, or loaded from a register and stored back into the memory. This fourth step is the last step for R- type and I-type instructions. For R and I type instructions this is the step where the result from the computation is stored back into the destination register [5]. E. Memory read completion step Only load instructions need the fifth step to finish up. This is the memory read completion step. In a load instruction the value of the memory data register is stored back into the register file. TABLE I. How Control bits are set and different function codes for the R type Instruction. Instruction Opcode Op Instruct ion operati on LW 000 Load word SW 000 Store Branch equal word 001 Branch equal Function Field Desired action control Input add 010 add 010 subtract 110 R-type 010 Add 1000000 add 010 R-type 010 subtract 100010 subtract 110 R-type 010 AND 100100 and 000 R-type 010 OR 100101 or 001 These different steps are all controlled by the controller of the multi cycle CPU. The controller is a finite state machine that works with the Opcode to walk the rest of the components through all the different steps, or states. The controller controls when each register is allowed to write and controls which operation the is performing. The multi cycle data path requires some additional requirements to support branches and jumps. With the jump and branch instructions there are three possible sources for the value to be written into the PC.The output of which has the value PC+4 during instruction fetch would be stored directly into the PC. The address of the branch target after computation is stored in the Out register. The lower 26 bits of the IR shifted left by two and concatenated with the upper four bits of the incremented PC which is the source when the instruction is jump. Two separate control signals are used in this implementation: PC Write which causes an unconditional write of the PC and PC Write Cond which causes a write of the PC if the branch condition is true. The control lines are attached to the control unit and the control and data path elements needed to effect changes to the PC. To select the source of new PC value, multiplexer is used. Gates are used to combine the PC Write signals and control signals from PC Source, PC Write and PC Write Cond. The PC Write Cond signal is used to decide whether a conditional branch should be taken. This supports for jumps also. The complete multi cycle data path and control unit 1785

including the additional control signals and multiplexor for implementing the PC updating are shown. Fig. 10. The complete data path for the multi cycle implementation together with the necessary control lines [6]. The first method we use to specify the multi cycle control is a finite state machine. A finite state machine is a sequential logic function consisting of a set of inputs and outputs, a next state function that maps the current state and the inputs to a new state and an output function that maps the current state and possibly the inputs to a set of asserted outputs. The figure which is shown below represents a complete specification of the control for MIPS subset with two types of exception. The labels on the arcs are conditions that are tested to determine which state is the next state. When the next state is unconditional, no label is given Here states 10 and 11 are the states that generate the appropriate control for exceptions. The branch out of state is labeled 1 indicates the next state when the input does not match the output of any of lw, sw, zero(r-type), j or beq. The branch out of state labeled 7 over flow indicates the action to be taken when the signals are overflow. Fig. 11. The finite state machine with the addition to handle exception detection [7]. 1786

IV. CONCLUSION The design was tested and simulated, no error was encountered. The project is ready to implement further. The idea of this project was to create a microprocessor as a building block in VHDL that later easily can be included in a larger design. It will be useful in systems where a problem is easy to solve in software but hard to solve with control logic. A state machine dedicated to the function can of course replace the microprocessor and associated software. However, at a high level of complexity it is easier to implement the function in software. After going through all the hard work and facing problems, this project managed to complete its objectives that are to study different Multiplier and learn the Power and Time trade off among them so that we can design. ACKNOWLEDGMENT The authors thank the respective supervisor Prof. Dr. Satyen Biswas of Ahsanullah University of Science & Technology for the continuous support of the study and research and especially they dedicate their acknowledgment of gratitude toward their beloved and respective parents. Fig. 12. Complete RISC Microprocessor using Blocks. REFERENCES [1] http://www.belarus.net/intel/museum/micropr.htm [2] https://www.cs.duke.edu/courses/spring01/cps104/lectures/2uplecture15.pdf [3] https://www.cs.drexel.edu/~jjohnson/2012-13/fall/cs281/lectures/pdf/cs281_lec16.pdf [4] Computer Organization and Design - The Hardware/Software Interface, Third Edition, David A. Patterson, John L. Hennessy [5] https://www.cs.duke.edu/courses/spring01/cps104/lectures/2uplecture15.pdf [6] Computer Organization and Design - The Hardware/Software Interface, Third Edition, David A. Patterson, John L. Hennessy [7] http://faculty.washington.edu/lcrum/archives/tcss372af08/mips_a rch2.ppt [8] Altera Corporation www.altera.com [9] The VHDL Cookbook-Peter J. Ashenden [10] http://www.eecg.toronto.edu/~moshovos/ece243-07/l20- multicycle.html [11] http://www.pitt.edu/~kmram/coe0147/lectures/multicycle1.pdf 1787