Processor Design. ELEC 418 Advanced Digital Systems Dr. Ron Hayne

Similar documents
CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

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

Lecture 12: Single-Cycle Control Unit. Spring 2018 Jason Tang

COMP303 - Computer Architecture Lecture 8. Designing a Single Cycle Datapath

RISC Processor Design

LECTURE 5. Single-Cycle Datapath and Control

Design of the MIPS Processor

Array vs. Linked list Slowly changing size, order More often dynamically y( (rarely statically)

MIPS-Lite Single-Cycle Control

Lecture 4: Review of MIPS. Instruction formats, impl. of control and datapath, pipelined impl.

Processor (I) - datapath & control. Hwansoo Han

Unpipelined Multicycle Datapath Implementation

Single Cycle CPU Design. Mehran Rezaei

CPU Organization (Design)

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

Major CPU Design Steps

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

The Big Picture: Where are We Now? EEM 486: Computer Architecture. Lecture 3. Designing a Single Cycle Datapath

Processor: Multi- Cycle Datapath & Control

Part V Memory System Design. Feb Computer Architecture, Memory System Design Slide 1

ECE 313 Computer Organization FINAL EXAM December 14, This exam is open book and open notes. You have 2 hours.

COMP303 Computer Architecture Lecture 9. Single Cycle Control

Part III The Arithmetic/Logic Unit. Oct Computer Architecture, The Arithmetic/Logic Unit Slide 1

What is an Addressing Mode?

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

CPE 335. Basic MIPS Architecture Part II

361 datapath.1. Computer Architecture EECS 361 Lecture 8: Designing a Single Cycle Datapath

CC 311- Computer Architecture. The Processor - Control

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

Mark II Aiken Relay Calculator

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

CS61C : Machine Structures

Exam I Review February 2017

Introduction to Programming

Microcomputer Architecture and Programming

Design of the MIPS Processor (contd)

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

CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath

The Processor: Datapath & Control

EECS150 - Digital Design Lecture 10- CPU Microarchitecture. Processor Microarchitecture Introduction

Part II Instruction-Set Architecture. Jan Computer Architecture, Instruction-Set Architecture Slide 1

CPU Design Steps. EECC550 - Shaaban

Math 230 Assembly Programming (AKA Computer Organization) Spring 2008

CS359: Computer Architecture. The Processor (A) Yanyan Shen Department of Computer Science and Engineering

Introduction to CPU architecture using the M6800 microprocessor

Systems Architecture

Designing a Multicycle Processor

CSEN 601: Computer System Architecture Summer 2014

361 control.1. EECS 361 Computer Architecture Lecture 9: Designing Single Cycle Control

LECTURE 6. Multi-Cycle Datapath and Control

Computer Architecture, IFE CS and T&CS, 4 th sem. Single-Cycle Architecture

Design of Digital Circuits 2017 Srdjan Capkun Onur Mutlu (Guest starring: Frank K. Gürkaynak and Aanjhan Ranganathan)

ECE232: Hardware Organization and Design

Final Project: MIPS-like Microprocessor

Initial Representation Finite State Diagram. Logic Representation Logic Equations

Lecture 5 and 6. ICS 152 Computer Systems Architecture. Prof. Juan Luis Aragón

Topic #6. Processor Design

CISC Processor Design

ENE 334 Microprocessors

Lecture #3 Microcontroller Instruction Set Embedded System Engineering Philip Koopman Wednesday, 20-Jan-2015

The Processor: Datapath & Control

CS3350B Computer Architecture Winter Lecture 5.7: Single-Cycle CPU: Datapath Control (Part 2)

EECS150 - Digital Design Lecture 9- CPU Microarchitecture. Watson: Jeopardy-playing Computer

Lecture 11: Control Unit and Instruction Encoding

Full Datapath. CSCI 402: Computer Architectures. The Processor (2) 3/21/19. Fengguang Song Department of Computer & Information Science IUPUI

Control Unit for Multiple Cycle Implementation

CPE 335 Computer Organization. Basic MIPS Architecture Part I

THE MICROPROCESSOR Von Neumann s Architecture Model

ECS 154B Computer Architecture II Spring 2009

ECE 313 Computer Organization FINAL EXAM December 11, Multicycle Processor Design 30 Points

RISC Design: Multi-Cycle Implementation

CS 61C: Great Ideas in Computer Architecture Datapath. Instructors: John Wawrzynek & Vladimir Stojanovic

Initial Representation Finite State Diagram Microprogram. Sequencing Control Explicit Next State Microprogram counter

Working on the Pipeline

Lecture 8: Control COS / ELE 375. Computer Architecture and Organization. Princeton University Fall Prof. David August

Chapter 5: The Processor: Datapath and Control

OSIAC Read OSIAC 5362 posted on the course website

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

CS3350B Computer Architecture Quiz 3 March 15, 2018

Project Description EEC 483 Computer Organization, Spring 2019

Laboratory 5 Processor Datapath

Data paths for MIPS instructions

ﻪﺘﻓﺮﺸﻴﭘ ﺮﺗﻮﻴﭙﻣﺎﻛ يرﺎﻤﻌﻣ MIPS يرﺎﻤﻌﻣ data path and ontrol control

are Softw Instruction Set Architecture Microarchitecture are rdw

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

CS 110 Computer Architecture Single-Cycle CPU Datapath & Control

CS 152 Computer Architecture and Engineering. Lecture 10: Designing a Multicycle Processor

N bit is set if result of operation in negative (MSB = 1) Z bit is set if result of operation is zero (All bits = 0)

0b) [2] Can you name 2 people form technical support services (stockroom)?

Chapter 5 Solutions: For More Practice

Lecture #17: CPU Design II Control

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

3. (2 pts) Clock rates have grown by a factor of 1000 while power consumed has only grown by a factor of 30. How was this accomplished?

The MIPS Processor Datapath

The Single Cycle Processor

Systems Architecture I

CPE 323 MSP430 INSTRUCTION SET ARCHITECTURE (ISA)

Lecture 6 Datapath and Controller

Block diagram view. Datapath = functional units + registers

Transcription:

Processor Design ELEC 418 Advanced Digital Systems Dr. Ron Hayne

68HC11 Programming Model Motorola 68HC11 Microcomputer (CISC) 7 A 0 7 B 0 8-bit Accumulators A & B 15 D 0 16-bit Double Accumulator D 15 X 0 Index Register X 15 Y 0 Index Register Y 15 SP 0 Stack Pointer 15 PC 0 Program Counter S X H I N Z V C Condition Code Register 418_09a

68HC11 Instruction Set Table Source Form Operation Boolean Expression Addr. Mode Machine Code Op Code Operand 418_09a 3 Cycles Bytes ABX Add B to X X + 00:B X INH 3A 1 3 ADDA (opr) Add Memory to A A + M A A IMM A DIR A EXT A IND,X A IND,Y 8B 9B BB AB 18 AB ii dd hh ll ff ff CLC Clear Carry Bit 0 C INH 0C 1 LDX (opr) Load Index Register X M:(M + 1) X X IMM X DIR CE DE jj kk dd 3 3 3 3 4 4 5 3 4

MIPS R000 Instruction Set Architecture (RISC) 3 General-Purpose Registers (3-bits) 3 Instruction Formats R-format (register) I-format (immediate) J-format (jump) 3 Addressing Modes Immediate Register Base register and signed offset 418_09a 4

MicroMIPS Incr PC Next PC PC Next addr (PC) Instr cache inst jta rd 31 imm rs rt 0 1 Reg file / 16 (rs) (rt) 3 SE / 0 1 ALUOvfl Ovfl ALU Func ALU out Data addr Data in Data cache Register writeback Data out 0 1 op fn Register input Br&Jump RegDst RegWrite ALUSrc ALUFunc DataRead DataWrite Instruction fetch Reg access / decode ALU operation Data access RegInSrc Fig. 13.3 Key elements of the single-cycle MicroMIPS data path. Parhami, Computer Architecture: From Microprocessors to Supercomputers, Oxford University Press, 005 5

PIC18F45 Programming Model 418_09a 6

Instructional Processor Design 3 Bus Organization 16 bit Data Path 4 Word Register File 4K Word Memory 8 Function ALU Condition Code Flags 6 Data Instructions 4 Addressing Modes 7 Branch Instructions 418_09a 7

Data Path & Memory Map BUS A BUS B STACK BUS C 1 A1 IR PC A REGS 1 000 007 008 MEMORY I/O Data MUX A ALU R 07F 080 MUX B STATUS N Z Program MDR MAR 1 FFF MEMORY 8

Data Path Registers & Memory Program Counter (PC) Memory Data Register (MDR) 1-bit Program Address 16-bits to/from Memory Subroutine Stack (STACK) Memory Address Reg (MAR) 16 x 1-bit Addresses 1-bit Memory Address Instruction Register (IR) MEMORY 16-bit Instructions 4K x 16-bit Memory Register File (REGS) 4 x 16-bit Registers Arithmetic Logic Unit (ALU) 8 Functions (ALU_OP) Flag Register (STATUS) Negative Flag (N) Zero Flag (Z) 418_09a 9

Addressing Modes Method of specifying of an operand Immediate (Literal) addressing The operand is a number that follows the opcode Direct (Absolute) addressing The address of the operand is a part of the instruction Indirect addressing An address is specified in a register (pointer) and the MPU looks up the address in that register 418_09a 10

Data Instruction Format 15 14 13 1 11 10 9 8 7 6 5 4 3 1 0 OP SRC DST VALUE IR MODE REG # Name Syntax Effective Address SRC or DST 00 00-11 Register Direct Rn EA = Rn 01 00-11 Register Indirect [Rn] EA = (Rn) 10 VV Absolute [Value] EA = Value 11* VV Immediate Value Operand = Value EA = Effective Address VV = Upper bits of VALUE * = SRC only 418_09a 11

Data Instructions OP Inst Assembly Language Register Transfer Notation 000 MOVE MOVE SRC,DST DST <= SRC 001 ADD ADD SRC,DST DST <= SRC + DST 010 INV INV SRC,DST DST <= not SRC 011 AND AND SRC,DST DST <= SRC and DST 100 SHL SHL SRC,DST DST <= SRC(14 downto 0) & 0 101 ASHR ASHR SRC,DST DST <= SRC(15) & SRC(15 downto 1) 110... 418_09a 1

Branch Instruction Format 15 14 13 1 11 10 9 8 7 6 5 4 3 1 0 OP FN OFFSET IR OP FN Inst Assembly Language Register Transfer Notation 000 BRA BRA Offset PC <= PC + Offset 001 BZ BZ Offset if Z = 1 then PC <= PC + Offset 010 BNZ BNZ Offset if Z = 0 then PC <= PC + Offset 111 011 BN BN Offset if N = 1 then PC <= PC + Offset 100 BNN BNN Offset if N = 0 then PC <= PC + Offset 101... 110 BSR BSR Offset STACK <= PC; PC <= PC + Offset 111 RTN RTN PC <= STACK 418_09a 13

Control Unit Organization Step Counter 3 3 OP DCD 8 Step DCD 8 IR 3 FN DCD SRC DCD 8 4 Encoder N Z STATUS DST DCD 3 Control Signals Clear 418_09a 14

Control Signals BUS_A BUS_B REGS_Read1 REGS_Read Extend Address ALU_Op MEM_Read MEM_Write Inc_PC Load_PC Load_IR REGS_Write Load_STATUS Load_MDR Load_MAR Clear 418_09a 15

Control Unit Design Instruction Fetch Cycle Step Register Transfer Notation Control Signals T0 MAR <= PC PC <= PC + 1 BUS_B <= PC; ALU_OP <= Pass_B; Load_MAR <= 1 ; Inc_PC <= 1 ; T1 MDR <= MEMORY(MAR) MEM_Read <= 1 ; Load_MDR <= 1 ; T IR <= MDR BUS_B <= MDR; ALU_OP <= Pass_B; Load_IR <= 1 ; 418_09a 16

Control Unit Design Instruction Execution Cycles MOVE Value,Rd Immediate (M3), Register Direct (M0) Step Register Transfer Notation Control Signals T3 Rd <= Value BUS_A <= IR; Extend <= 1 ; ALU_OP <= OP; Load_STATUS <= 1 ; REGS_Write <= 1 ; Clear <= 1 ; 418_09a 17

Control Unit Design MOVE Rs,[Value] Register Direct (M0), Absolute (M) Step Register Transfer Notation Control Signals T3 MDR <= Rs REGS_Read1 <= 1 ; ALU_OP <= OP; Load_STATUS <= 1 ; Load_MDR <= 1 ; T4 MAR <= Value BUS_B <= IR; Address <= 1 ; ALU_OP <= Pass_B; Load_MAR <= 1 ; T5 MEMORY(MAR) <= MDR MEM_Write <= 1 ; Clear <= 1 ; 418_09a 18

VHDL Model BUS A BUS B MUX MUX 1 A1 STACK REGS A B IR PC A ALU R 1 STATUS N Z BUS C Processor_Components.vhd 000 007 REG4 MEMORY ALU16 MEM4K I/O 008 Processor.vhd 07F 080 Data Data Path Control Unit Processor_Test.vhd Program MDR MAR 1 FFF MEMORY 418_09a 19

Assembly Language Program.data SUM N 3 X 7, -8, 10.program START: MOVE [N],R1 MOVE X,R MOVE 0,R0 LOOP: ADD [R],R0 ADD 1,R ADD -1,R1 BNZ LOOP MOVE R0,[SUM] STOP: BRA STOP program.asm program.bin MEMORY... 008 SUM 009 3 N 00A 7 X(0) 00B -8 X(1) 00C 10 X() 418_09a 0

VHDL Simulation (Part 1) 418_09a 1

Microcontroller Extension 4K (4096) RAM 8 Memory-mapped I/O Ports 0x000 SWITCH (Input) 8-bit 0x001 LED (Output) 8-bit 0x00 ANODE (Output) 4-bit 0x003 CATHODE (Output) 8-bit 0x004 JA (Output) 4-bit 0x005 JB (Input) 4-bit 10 Data Memory Locations 0x008-0x07F 418_09a

FPGA Implementation JA JB Clock Processor LED Reset SWITCH ANODE/CATHODE 418_09a 3

Pulse Width Modulation Main Get Delay Initialize Read: Init Pointer Init Count Loop: Speed Add Offset Dec Count Get Read = 0? N Next: N Display = 0? Y Off: Return Y Return On Delay Off Delay program_pwm.asm Dec Duty Delay 418_09a 4

Summary Example Microprocessors Registers and Memory Instructions and Addressing Modes Instructional Processor Design Instruction Set Architecture Data Path Control Unit VHDL Model isim Simulation FPGA Implementation 418_09a 5