MICRO-SEQUENCER BASED CONTROL UNIT DESIGN FOR A CENTRAL PROCESSING UNIT TAN CHANG HAI

Similar documents
HARDWARE AND SOFTWARE CO-SIMULATION PLATFORM FOR CONVOLUTION OR CORRELATION BASED IMAGE PROCESSING ALGORITHMS SAYED OMID AYAT

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

SUPERVISED MACHINE LEARNING APPROACH FOR DETECTION OF MALICIOUS EXECUTABLES YAHYE ABUKAR AHMED

IMPROVED IMAGE COMPRESSION SCHEME USING HYBRID OF DISCRETE FOURIER, WAVELETS AND COSINE TRANSFORMATION MOH DALI MOUSTAFA ALSAYYH

BLOCK-BASED NEURAL NETWORK MAPPING ON GRAPHICS PROCESSOR UNIT ONG CHIN TONG UNIVERSITI TEKNOLOGI MALAYSIA

HIGH SPEED SIX OPERANDS 16-BITS CARRY SAVE ADDER AWATIF BINTI HASHIM

DESIGN AND IMPLEMENTATION OF A MUSIC BOX USING FPGA TAN KIAN YIAK

Microprocessors/Microcontrollers

ENHANCING TIME-STAMPING TECHNIQUE BY IMPLEMENTING MEDIA ACCESS CONTROL ADDRESS PACU PUTRA SUARLI

SOFTWARE-BASED SELF-TESTING FOR A RISC PROCESSOR TEH WEE MENG UNIVERSITI TEKNOLOGI MALAYSIA

DEVELOPMENT OF PESONA RISC MICROPROCESSOR ARCHITECTURE IN FPGA MOHD FAHMIR ADZRAN BIN RAMLEE

ENHANCING SRAM PERFORMANCE OF COMMON GATE FINFET BY USING CONTROLLABLE INDEPENDENT DOUBLE GATES CHONG CHUNG KEONG UNIVERSITI TEKNOLOGI MALAYSIA

HARDWARE-ACCELERATED LOCALIZATION FOR AUTOMATED LICENSE PLATE RECOGNITION SYSTEM CHIN TECK LOONG UNIVERSITI TEKNOLOGI MALAYSIA

William Stallings Computer Organization and Architecture

AMBA AXI BUS TO NETWORK-ON-CHIP BRIDGE NG KENG YOKE UNIVERSITI TEKNOLOGI MALAYSIA

IMPLEMENTATION OF UNMANNED AERIAL VEHICLE MOVING OBJECT DETECTION ALGORITHM ON INTEL ATOM EMBEDDED SYSTEM

A TRUST MODEL FOR BUSINESS TO CUSTOMER CLOUD E-COMMERCE HOSSEIN POURTAHERI

Microcomputer Architecture and Programming

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

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

Chapter 16. Control Unit Operation. Yonsei University

RECOGNITION OF PARTIALLY OCCLUDED OBJECTS IN 2D IMAGES ALMUASHI MOHAMMED ALI UNIVERSITI TEKNOLOGI MALAYSIA

CPU Structure and Function

Digital System Design Using Verilog. - Processing Unit Design


Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

THE COMPARISON OF IMAGE MANIFOLD METHOD AND VOLUME ESTIMATION METHOD IN CONSTRUCTING 3D BRAIN TUMOR IMAGE

Digital IP Cell 8-bit Microcontroller PE80

The Itanium Bit Microprocessor Report

HARDWARE/SOFTWARE SYSTEM-ON-CHIP CO-VERIFICATION PLATFORM BASED ON LOGIC-BASED ENVIRONMENT FOR APPLICATION PROGRAMMING INTERFACING TEO HONG YAP

OPTIMIZE PERCEPTUALITY OF DIGITAL IMAGE FROM ENCRYPTION BASED ON QUADTREE HUSSEIN A. HUSSEIN

DETECTION OF WORMHOLE ATTACK IN MOBILE AD-HOC NETWORKS MOJTABA GHANAATPISHEH SANAEI

Multi Cycle Implementation Scheme for 8 bit Microprocessor by VHDL

Basics of Microprocessor

Novel Design of Dual Core RISC Architecture Implementation

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

1. Fundamental Concepts

SECURE-SPIN WITH HASHING TO SUPPORT MOBILITY AND SECURITY IN WIRELESS SENSOR NETWORK MOHAMMAD HOSSEIN AMRI UNIVERSITI TEKNOLOGI MALAYSIA

ENHANCEMENT OF UML-BASED WEB ENGINEERING FOR METAMODELS: HOMEPAGE DEVELOPMENT CASESTUDY KARZAN WAKIL SAID

Lab #12: ArithmeticLogic Unit

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

AN IMPROVED PACKET FORWARDING APPROACH FOR SOURCE LOCATION PRIVACY IN WIRELESS SENSORS NETWORK MOHAMMAD ALI NASSIRI ABRISHAMCHI

THREE BIT SUBTRACTION CIRCUIT VIA FIELD PROGRAMMABLE GATE ARRAY (FPGA) NOORAISYAH BINTI ARASID B

MICROPROGRAMMED CONTROL

Blog -

AUTOMATIC APPLICATION PROGRAMMING INTERFACE FOR MULTI HOP WIRELESS FIDELITY WIRELESS SENSOR NETWORK

Register-Level Design

Module 5 - CPU Design

UNIVERSITI MALAYSIA PAHANG

BORANG PENGESAHAN STATUS TESIS

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

SEMANTICS ORIENTED APPROACH FOR IMAGE RETRIEVAL IN LOW COMPLEX SCENES WANG HUI HUI

Computer Architecture

A LEVY FLIGHT PARTICLE SWARM OPTIMIZER FOR MACHINING PERFORMANCES OPTIMIZATION ANIS FARHAN BINTI KAMARUZAMAN UNIVERSITI TEKNOLOGI MALAYSIA

APPENDIX A. Sample of a report front cover TITLE OF PROJECT IN CAPITAL LETTERS. (Centered within prescribed margin) STUDENT S FULL NAME

Chapter 3 : Control Unit

Introduction to Computers - Chapter 4

William Stallings Computer Organization and Architecture. Chapter 11 CPU Structure and Function

The von Neumann Architecture. IT 3123 Hardware and Software Concepts. The Instruction Cycle. Registers. LMC Executes a Store.

ADAPTIVE LOOK-AHEAD ROUTING FOR LOW LATENCY NETWORK ON-CHIP NADERA NAJIB QAID AL AREQI UNIVERSITI TEKNOLOGI MALAYSIA

Design and Implementation of I2C BUS Protocol on Xilinx FPGA. Meenal Pradeep Kumar

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

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud.

Architecture of 8085 microprocessor

CHAPTER - 2 : DESIGN OF ARITHMETIC CIRCUITS

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


CPU Structure and Function

ADAPTIVE VIDEO STREAMING FOR BANDWIDTH VARIATION WITH OPTIMUM QUALITY

Processing Unit CS206T

ISOGEOMETRIC ANALYSIS OF PLANE STRESS STRUCTURE CHUM ZHI XIAN

Computer Architecture 2/26/01 Lecture #

BASIC INTERFACING CONCEPTS

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

ONTOLOGY-BASED SEMANTIC HETEROGENEOUS DATA INTEGRATION FRAMEWORK FOR LEARNING ENVIRONMENT

ELEC 2200 Digital Logic Circuits

THE 8051 MICROCONTROLLER

INTEGRATION OF CUBIC MOTION AND VEHICLE DYNAMIC FOR YAW TRAJECTORY MOHD FIRDAUS BIN MAT GHANI

LINK QUALITY AWARE ROUTING ALGORITHM IN MOBILE WIRELESS SENSOR NETWORKS RIBWAR BAKHTYAR IBRAHIM UNIVERSITI TEKNOLOGI MALAYSIA

COMPUTER ORGANIZATION AND ARCHITECTURE

Computer Organization and Microprocessors SYLLABUS CHAPTER - 1 : BASIC STRUCTURE OF COMPUTERS CHAPTER - 3 : THE MEMORY SYSTEM

Computer Architecture

DEVELOPMENT OF VENDING MACHINE WITH PREPAID PAYMENT METHOD AMAR SAFUAN BIN ALYUSI

Advanced Computer Architecture

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

Computer Logic II CCE 2010

Dual Port SRAM Based Microcontroller Chip Test Report

CPU Structure and Function. Chapter 12, William Stallings Computer Organization and Architecture 7 th Edition

Chapter 4. MARIE: An Introduction to a Simple Computer. Chapter 4 Objectives. 4.1 Introduction. 4.2 CPU Basics

Chapter 4. The Processor

TABLE OF CONTENTS CHAPTER TITLE PAGE

Implementation of Low Power High Speed 32 bit ALU using FPGA

Computer Organization (Autonomous)

History and Basic Processor Architecture

Micro computer Organization

SMART AQUARJUM (A UTOMATIC FEEDING MACHINE) SY AFINAZ ZURJATI BINTI BAHARUDDIN

The adaptive serializable snapshot isolation protocol for managing database transactions

EXPERIMENT NO. 1 THE MKT 8085 MICROPROCESSOR TRAINER

A NEW STEGANOGRAPHY TECHNIQUE USING MAGIC SQUARE MATRIX AND AFFINE CIPHER WALEED S. HASAN AL-HASAN UNIVERSITI TEKNOLOGI MALAYSIA

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

Transcription:

MICRO-SEQUENCER BASED CONTROL UNIT DESIGN FOR A CENTRAL PROCESSING UNIT TAN CHANG HAI A project report submitted in partial fulfillment of the requirement for the award of the degree of Master of Engineering (Computer & Microelectronic Systems) Faculty of Electrical Engineering Universiti Teknologi Malaysia APRIL 2007

iii DEDICATION To my beloved wife, parents and family members

iv ACKNOLEDGEMENT In preparing this thesis, I was in contact with many people, researchers and academicians. They have contributed towards my understanding and thoughts. In particular, I wish to express my sincere appreciation to my thesis supervisor, Professor Dr. Mohamed Khalil Hani, for encouragement, guidance and friendships. I am also very thankful to my friends and family members for their great support, advices and motivation. Without their continued support and interest, this thesis would not have been as presented here.

v ABSTRACT Central Processing Unit (CPU) is a processing unit that controls the computer operations. The current in house CPU design was not complete therefore the purpose of this research was to enhance the current CPU design in such a way that it can handle hardware interrupt operation, stack operations and subroutine call. Register transfer logic (RTL) level design methodology namely top level RTL architecture, RTL control algorithm, data path unit design, RTL control sequence table, microsequencer control unit design, integration of control unit and data path unit, and the functional simulation for the design verification are included in this research.

vi ABSTRAK Unit pusat pemprosesan (CPU) merupakan sebuah mesin yang berfungsi untuk menjana fungsi komputer. Buat masa kini, rekaan CPU masih belum sempurna. Malah tujuan utama penyelidikan ini adalah meningkatkan prestasi CPU dari segi operasi seperti gangguan, timbunan dan panggilan para fungsi. Rekaan metalogy logic pendaftaran berpindah (RTL) terdiri daripada rekaan RTL, kawalan algoritma RTL, rekaan unit data, rekaan unit micro-peringkat kawalan dan fungsi penyerupaan.

vii TABLE OF CONTENTS CHAPTER TITLE PAGE DECLARATION DEDICATION ACKNOLEDGEMENT ABSTRACT ABSTRAK TABLE OF CONTENTS LIST OF TABLES LIST OF FIGURES LIST OF ABBREVIATIONS LIST OF APPENDICES ii iii iv v vi vii xi xii xiii xiv 1 INTRODUCTION 1 1.1 General CPU Organization 1 1.2 Objectives 3 1.3 Scope of Work 3 1.4 Design Methodology 3 2 VHDL DESIGN OF A CPU 5 2.1 CPU Specification 5 2.2 Basic Concepts Of Microsequencer Design 6 2.3 Design and Implementation of a Microsequencer 7 2.4 Instruction Sets 8 2.5 Instruction Sets Format 9 2.6 Functional Block Diagram 10 2.7 Microsequencer Branch Control 13 2.8 Control Unit Flow Chart 14

viii 2.9 RTL Control Sequence Table 19 3 CPU MODULE VERIFICATION AND SIMULATION 41 3.1 Accumulator 42 3.1.1 Functional Block Diagram 42 3.1.2 Specification 42 3.1.3 VHDL Code 42 3.1.4 Functional Simulation 43 3.2 Program Counter 44 3.2.1 Functional Block Diagram 44 3.2.2 Specification 44 3.2.3 VHDL Code 44 3.2.4 Functional Simulation 45 3.3 Stack Pointer 45 3.3.1 Functional Block Diagram 45 3.3.2 Specification 45 3.3.3 VHDL Code 46 3.3.4 Functional Simulation 46 3.4 RAM 47 3.4.1 Functional Block Diagram 47 3.4.2 Specification 47 3.4.3 VHDL Code 48 3.4.4 Functional Simulation 48 3.5 ALU 49 3.5.1 Functional Block Diagram 49 3.5.2 Specification 49 3.5.3 VHDL Code 49 3.5.4 Functional Simulation 50 3.6 JMAP LOGIC 51 3.6.1 Functional Block Diagram 51 3.6.2 Specification 51 3.6.3 VHDL Code 51 3.6.4 Functional Simulation 52 3.7 BRANCH CONTROL LOGIC 53 3.7.1 Functional Block Diagram 53

ix 3.7.2 Specification 53 3.7.3 VHDL Code 53 3.7.4 Functional Simulation 54 3.8 NEXT ADDRESS MUX 55 3.8.1 Functional Block Diagram 55 3.8.2 Specification 55 3.8.3 VHDL Code 55 3.8.4 Functional Simulation 56 3.9 ROM 57 3.9.1 Functional Block Diagram 57 3.9.2 Specification 57 3.9.3 VHDL Code 57 3.9.4 Functional Simulation 58 3.10 CPU 60 3.10.1 Functional Block Diagram 60 3.10.2 Specification 60 3.10.3 VHDL Code 61 3.10.4 Functional Simulation 62 3.10.4.1 Testing program listing 1.1 62 3.10.4.2 Testing program listing 1.2 65 3.10.4.3 Testing program listing 1.3 68 3.10.4.4 Testing program listing 1.4 71 4 ANALYSIS, DISCUSSION & FUTURE WORK 75 4.1 Analysis and Discussion 75 4.2 Problem Statements 76 4.2.1 Problem 1: myram compile error 76 4.2.2 Problem 2: Testing program do not get executed 78 4.2.3 Problem 3: Typo in the testing program 78 4.2.4 Problem 4: Incorrect output data from ROM 78 4.2.5 Problem 5: Invalid value in control sequence table 79 4.2.6 Problem 6: Stack operation instruction 79 4.3 Design Performance 80 4.4 Future Work 80

x 5 SUMMARY AND CONCLUSION 81 5.1 Summary 81 5.2 Conclusion 82 REFERENCES 83 APPENDICES 84

xi LIST OF TABLES TABLE NO. TITLE PAGE 2.1 List of instruction sets 8 3.1 List of ALU functions 49

xii LIST OF FIGURES FIGURE NO. TITLE PAGE 1.1 CPU internal organization 2 2.1 Generic micro-sequencer organization 6 2.2 Top level RTL architecture 10 2.3 Data path unit 11 2.4 Control unit (micro-sequencer control unit) 12 4.1 Compilation error message from Quartus tool 76 4.2 Change the property of LPM_OUTDATA to REGISTERED 77

xiii LIST OF ABBREVIATIONS ALU - Arithmetic Logic Unit CPU - Central Processing Unit CU - Control Unit FPGA - Field-Programmable Gate Array ISA - Instruction Set Architecture JMAP - Jump Map PC - Program Counter RAM - Random Access Memory ROM - Read Only Memory RTL - Register Transfer Logic VHDL - Very High Speed Integrated Circuit Hardware Description Language

xiv LIST OF APPENDICES APPENDIX TITLE PAGE A VHDL Code for Accumulator 84 B VHDL Code for Program Counter 85 C VHDL Code for Stack Pointer 86 D VHDL Code for RAM 87 E VHDL Code for ALU 89 F VHDL Code for JMAP Logic 90 G VHDL Code for Branch Control Logic 93 H VHDL Code for Next Address Mux 94 I VHDL Code for ROM 95 J VHDL Code for CPU 97

CHAPTER 1 INTRODUCTION This project is to describe a Central Processing Unit (CPU) can be implemented with a micro-programmed control unit. This chapter will cover, general CPU organization, objective of this project, scope of the project and the design methodology that are use in this project. 1.1 General CPU Organization In general, a CPU controls the computer operations. It fetches instructions from memory, supplying the address and the control signals needed by the memory to access its data. The CPU decodes the instruction and controls the execution procedure. It performs some operations internally and supplies the address, data and control signals needed by memory and input/output (I/O) devices to execute the instruction. Generally, a CPU has three sections as show in Figure 1.1. The register section includes a set of registers and bus or other communication mechanism. The registers in a processor s instructions set architecture are found in this section of the

2 CPU. The system address and data buses interact with this section of the CPU. The CPU includes registers to latch the address being accessed in memory and a temporary storage register. Figure 1.1: CPU internal organization During the fetch portion of the instruction cycle, the processor first outputs the address of the instruction onto the address bus. The processor has a register called program counter to keeps the address of the next instruction to be fetched in this register. Before the CPU outputs the address onto the system address bus, it retrieves the address from the program counter register. At the end of the instruction fetch, the CPU reads the instruction code from the system data bus. It stores this value in an internal register called instruction register. The Arithmetic Logic Unit (ALU) performs most of the arithmetic and logical operations such as adding, ORing values, XORing values and so on. It receives its operand from register section of the CPU and stores its results back to the register section. The control unit controls the CPU, it generates the internal control signals that cause registers to load data, increment or clear their contents and output their contents

3 as well as cause the ALU to perform the correct function. These signals are shown as control signals as shown in Figure 1.1. The control unit receives some data values from the register unit which it uses to generate the control signals. This data includes the instruction code and the values of some flag registers. A microprocessor typically performs a sequence of operations to fetch, decode and execute an instruction. By asserting these internal and external control signals in the proper sequence, the control unit causes the CPU and the rest of the computer to perform the operations needed to correctly process the instructions. 1.2 Objectives The main objective of this project is to enhance and upgrade the in house CPU design. The work can be divided into sub-objectives i. To enhance the in house developed CPU with additional subroutine instructions, hardware interrupts and stacks operations. ii. To upgrade the hard-wired control unit to micro-sequencer based control unit. 1.3 Scope Of Work The scope of work can be divided into the following: i. This project is not to design a CPU but enhance the in house CPU design ii. New instruction sets will be added to CPU.my to handle hardware interrupt, subroutine call and stack operations. iii. Hardwired control unit will be upgrade to micro-sequencer base control unit. 1.4 Design Methodology

4 In this project, a CPU with the scope and objective that mention in previous section will be develop by applying hierarchical modular design concept. VHDLmg from UTM will be used as design entry tool to model the CPU at RTL level. Altera Quartus II design software tool will be used to synthesize the HDL for equivalent logic and targeted implementation platform at FPGA development board. The design will be verified with software functional waveform simulation. A set of testing program will be use to test all the instruction execution.