Processor Design ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.

Slides:



Advertisements
Similar presentations
Microprocessors.
Advertisements

Chapter 5 The LC-3 Instruction Set Architecture l ISA Overview l Operate instructions l Data Movement instructions l Control Instructions l LC-3 data path.
ELEN 468 Advanced Logic Design
Processor Function Topic 3.
Execution of an instruction
Slides to Accompany a Video Tutorial on Harry Porter’s Relay Computer Harry Porter, Ph.D. Portland State University November 7, 2007.
Savio Chau Single Cycle Controller Design Last Time: Discussed the Designing of a Single Cycle Datapath Control Datapath Memory Processor (CPU) Input Output.
Inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 25 CPU design (of a single-cycle CPU) Intel is prototyping circuits that.
1 The Design of a Relay Computer Harry Porter, Ph.D. Portland State University April 24, 2006.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 4: IT Students.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 4:
Computer Science 210 Computer Organization The Instruction Execution Cycle.
SAP1 (Simple-As-Possible) Computer
Processor Design ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
Chapter 4 The Von Neumann Model
Processor: Datapath and Control
Introduction to Computer Engineering CS/ECE 252, Fall 2009 Prof. Mark D. Hill Computer Sciences Department University of Wisconsin – Madison.
A Simple Computer Architecture Digital Logic Design Instructor: Kasım Sinan YILDIRIM.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 5:
Execution of an instruction
Computer Organization CS224 Fall 2012 Lesson 22. The Big Picture  The Five Classic Components of a Computer  Chapter 4 Topic: Processor Design Control.
CDA 3101 Fall 2013 Introduction to Computer Organization
Computer Architecture Lecture 03 Fasih ur Rehman.
Design of a 8-bit RISC Micro controller Core By Ayush Mittal( ) Rakesh Kumar Sahoo( ) Under Guidance of Dr. M.B.Srinivas.
Our programmer needs to do this !
Von Neumann Model Computer Organization I 1 September 2009 © McQuain, Feng & Ribbens The Stored Program Computer 1945: John von Neumann –
Computer Architecture Lecture 4 by Engineer A. Lecturer Aymen Hasan AlAwady 17/11/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
CS61C L20 Datapath © UC Regents 1 Microprocessor James Tan Adapted from D. Patterson’s CS61C Copyright 2000.
Computer Organization Instructions Language of The Computer (MIPS) 2.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Single Cycle Controller Design
EE345 Chapter 2 Lecture 3 April 4. Quiz every Wednesday 1 quiz = 1% extra credit five quizzes before midterm  5% for midterm. five quizzes before final.
8 085Microprocessor Temp Reg (8) Accumulator (A reg) Flag flip flops(8) Instruction Register (8) Arithmetic Logic Unit ALU Instruction Decoder and Machine.
EE345 Chapter 2 Lecture 3 April Instruction and addressing modes 1.Extended Addressing 2.Direct Addressing 3.Inherent Addressing 4.Immediate Addressing.
Access the Instruction from Memory
Electrical and Computer Engineering University of Cyprus
ELEC 418 Advanced Digital Systems Dr. Ron Hayne
ELEC 418 Advanced Digital Systems Dr. Ron Hayne
Single Cycle CPU.
CS 230: Computer Organization and Assembly Language
Chapter 4 The Von Neumann Model
IT 251 Computer Organization and Architecture
ELEN 468 Advanced Logic Design
Chapter 4 The Von Neumann Model
Instruction Format MIPS Instruction Set.
Chapter 4 The Von Neumann Model
Processor (I).
Computer Science 210 Computer Organization
CS/COE0447 Computer Organization & Assembly Language
ECE 445 CS1251 Computer Organization Carl Hamacher
CS/COE0447 Computer Organization & Assembly Language
Computer Science 210 Computer Organization
Single-Cycle CPU DataPath.
CS/COE0447 Computer Organization & Assembly Language
Computer Structure S.Abinash 11/29/ _02.
Topic 6 LC-3.
Vishwani D. Agrawal James J. Danaher Professor
Fundamental Concepts Processor fetches one instruction at a time and perform the operation specified. Instructions are fetched from successive memory locations.
COMS 361 Computer Organization
Instruction Format MIPS Instruction Set.
Single Cycle Datapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili.
The Stored Program Computer
Review Fig 4.15 page 320 / Fig page 322
CS/COE0447 Computer Organization & Assembly Language
Basic components Instruction processing
COMS 361 Computer Organization
What You Will Learn In Next Few Sets of Lectures
Processor: Datapath and Control
Chapter 4 The Von Neumann Model
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

Processor Design ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering

418_092 68HC11 Programming Model  Motorola 68HC11 Microcomputer 7 A 07 B 08-bit Accumulators A & B 15 D 016-bit Double Accumulator D 15 X 0Index Register X 15 Y 0Index Register Y 15 SP 0Stack Pointer 15 PC 0Program Counter SXHINZVCCondition Code Register

418_093 68HC11 Instruction Set Table Source Form Operation Boolean Expression Addr. Mode Machine Code Bytes Cycles Op Code Op- erand ABXAdd B to X X + 00:B  X INH3A13  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  CLCClear Carry Bit 0  C INH0C12  LDX (opr)Load Index Register X M:(M + 1)  X X IMM X DIR CE DE jj kk dd

PIC18F452 Programming Model 418_094

5 MIPS ISA  Instruction Set Architecture 32 General-Purpose Registers (32-bits) 3 Instruction Formats R-format (register) I-format (immediate) J-format (jump) 3 Addressing Modes Immediate Register Base register and signed offset

6418_09

7 Data Path Design  MIPS Subset  Sequence of Operations Fetch an Instruction Decode the Instruction Execute the Instruction

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

Data Path & Memory 9 IR REGS MDR MAR MEM 12 A B R A1A2 PC ALU NZ BUS A BUS BBUS C MUX STATUS MUX STACK Memory 000 I/O Data 07F 080 Program FFF

ALU Multiplexers 10418_09 10 S 10 S Address SRC or DST ALU B 15-5 BUS B 15-5 BUS B 's,B 's,B 6-5 ALU B S 10 S Extend Sign ALU A 15-5 BUS A 15-5 BUS A 's,A 's,A 10-9 ALU A S 10 S Branch 0's,A 9-5 1's,A 9-5

Data Path Registers & Memory  Program Counter (PC) 12-bit Program Address  Subroutine Stack (STACK) 16 x 12-bit Addresses  Instruction Register (IR) 16-bit Instructions  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)  Memory Data Register (MDR) 16-bits to/from Memory  Memory Address Reg (MAR) 12-bit Memory Address  Memory (MEM) 4K x 16-bit Memory 418_0911

Memory Map  4K (4096) RAM 8 Memory-mapped I/O Ports 0x000Switch(Input) 0x001LED(Output) 120 Data Memory Locations 0x x07F 3968 Program Memory Locations 0x xFFF 418_0912

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 13418_09

Data Instruction Format 418_ IROPSRCDSTVALUE ModeREG #NameSyntaxEffective Address SRC or DST Register DirectRnEA = Rn Register Indirect[Rn]EA = (Rn) 10vvAbsolute[Value]EA = Value 11*vvImmediateValueOperand = Value EA = Effective Address vv = Upper 2 bits of Value * = SRC only

Data Instructions 418_0915 OPFnAssembly LanguageRegister Transfer Notation 000MOVE MOVE SRC,DST DST  SRC 001ADD ADD SRC,DST DST  SRC + DST 010INV INV SRC,DST DST  not SRC 011AND AND SRC,DST DST  SRC and DST 100SHL SHL SRC,DST DST  SRC(14 dt 0) & 0 101ASHR ASHR SRC,DST DST  SRC(15) & SRC(15 dt 1)

Branch Instruction Format 418_ IROPMDOFFSET OPMDFnAssembly LanguageRegister Transfer Notation BRA BRA Offset PC  PC + Offset 001BZ BZ Offset PC  PC + Offset (Z = 1) 010BNZ BNZ Offset PC  PC + Offset (Z = 0) 011BN BN Offset PC  PC + Offset (N = 1) 100BNN BNN Offset PC  PC + Offset (N = 0) BSR BSR Offset STACK  PC; PC  PC + Offset 111RTN PC  STACK

Assembly Language Program 418_ SUM 009 n N 00AX(0) 00BX(1) 00C X(n-1) START: MOVE [9],R1 MOVE 0xA,R2 MOVE 0,R0 LOOP: ADD [R2],R0 ADD 1,R2 ADD -1,R1 BNZ LOOP MOVE R0,[8] STOP: BRA STOP

Control Unit Organization 418_0918 SRC_MODE DCD Control Step Counter T0T0 T7T7... STATUS N Instruction DCD I0I0 I7I7... M0M0 M3M3 M0M0 M3M3 DST_MODE DCD Encoder Control Signals Clear CLK Step DCD IR Z...

Control Signals  BUS_A  BUS_B  REGS_Read1  REGS_Read2  Extend  Address  ALU_Op  MEM_Read  MEM_Write  Inc_PC  Load_PC  Push_PC  Pop_PC  Load_IR  REGS_Write  Load_STATUS  Load_MDR  Load_MAR  Clear 418_0919

Control Unit Design  Instruction Fetch 418_0920 StepRegister 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  MEM(MAR) MEM_Read <= ‘1’ Load_MDR <= ‘1’ T2 IR  MDR BUS_B <= MDR ALU_OP <= Pass_B Load_IR <= ‘1’

Control Unit Design  Instruction Execute MOVE Rs,Rd Register Direct (M0), Register Direct (M0) 418_0921 StepRegister Transfer Notation Control Signals T3 R(D)  R(S) REGS_Read1 <= ‘1’ ALU_OP <= OP Load_STATUS <= ‘1’ REGS_Write <= ‘1’ Clear <= ‘1’

Control Unit Design  Instruction Execute MOVE Value,Rd Immediate (M3), Register Direct (M0) 418_0922 StepRegister Transfer Notation Control Signals T3 R(D)  Value BUS_A <= IR Extend <= ‘1’ ALU_OP <= OP Load_STATUS <= ‘1’ REGS_Write <= ‘1’ Clear <= ‘1’

Control Unit Design  Instruction Execute BRA Offset Branch Always OP (111), Mode (000) 418_0923 StepRegister Transfer Notation Control Signals T3 PC  PC + Offset BUS_A <= IR BUS_B <= PC Extend <= '1' ALU_OP <= ADD Load_PC <= '1' Clear <= '1'

VHDL Model (Phase 1)  Data Path Components  Control Unit Instruction Fetch Instruction Execute  First Test Program program1.asm program1.bin MOVE 3,R1 MOVE R1,R2 STOP: BRA STOP 418_0924

VHDL Model (Phase 1)  processor.vhd  processor_components.vhd 418_0925 REGS MEM A B R A1A ALU IR REGS MDR MAR MEM 12 A B R A1A2 PC ALU NZ BUS A BUS BBUS C MUX STATUS MUX

VHDL Testbench constant CLK_period : time := 20 ns; stim_proc : process begin RESET <= '1'; wait for CLK_period*1.25; RESET <= '0'; wait for CLK_period*80; end process; 418_0926

VHDL Simulation (Phase 1) 418_0927

Control Unit Design (Phase 2) MOVE Rs,[Addr] Register Direct (M0), Absolute (M2) 418_0928 StepRegister Transfer Notation Control Signals T3 MDR  R(S) 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 MEM(MAR)  MDR MEM_Write <= ‘1’ Clear <= ‘1’

Control Unit Design (Phase 2) MOVE [Addr],Rd Absolute (M2), Register Direct (M0) 418_0929 StepRegister Transfer Notation Control Signals T3 MAR  Value BUS_B <= IR Address <= ‘1’ ALU_OP <= Pass_B Load_MAR <= ‘1’ T4 MDR  MEM(MAR) MEM_Read <= ‘1’ Load_MDR <= ‘1’ T5 R(D)  MDR BUS_A <= MDR ALU_OP <= OP Load_STATUS <= ‘1’ REGS_Write <= ‘1’ Clear <= ‘1’

Control Unit Design (Phase 2) ADD [Rs],Rd Register Indirect (M1), Register Direct (M0) 418_0930 StepRegister Transfer Notation Control Signals T3 MAR  R(S) REGS_Read1 <= ‘1’ ALU_OP <= Pass_A Load_MAR <= ‘1’ T4 MDR  MEM(MAR) MEM_Read <= ‘1’ Load_MDR <= ‘1’ T5 R(D)  MDR + R(D) BUS_A <= MDR REGS_Read2 <= ‘1’ ALU_OP <= OP Load_STATUS <= ‘1’ REGS_Write <= ‘1’ Clear <= ‘1’

Control Unit Design (Phase 2) ADD Value,Rd Immediate (M3), Register Direct (M0) 418_0931 StepRegister Transfer Notation Control Signals T3 R(D)  Value + R(D) BUS_A <= IR Extend <= ‘1’ REGS_Read2 <= ‘1’ ALU_OP <= OP Load_STATUS <= ‘1’ REGS_Write <= ‘1’ Clear <= ‘1’

Control Unit Design (Phase 2) BNZ Offset Branch if greater than zero OP (111), Mode (010) 418_0932 StepRegister Transfer Notation Control Signals T3if Z = 0 then PC  PC + Offset BUS_A <= IR BUS_B <= PC Extend <= ‘1’ ALU_OP <= ADD Load_PC <= ‘1’ Clear <= ‘1’

Assembly Language Program 418_ SUM N 00A 7 X(0) 00B -8 X(1) 00C 10 X(2).data SUM N 3 X 7, -8, 10.code START: MOVE [N],R1 MOVE X,R2 MOVE 0,R0 LOOP: ADD [R2],R0 ADD 1,R2 ADD -1,R1 BNZ LOOP MOVE R0,[SUM] STOP: BRA STOP  program2.asm  program2.bin

IP Assembler  Requires Java (jre8) Run from Command Line 418_0934

VHDL Control Unit (Phase 2)  processor.vhd 418_0935 SRC_MODE DCD Control Step Counter T0T0 T7T7... STATUS N Instruction DCD I0I0 I7I7... M0M0 M3M3 M0M0 M3M3 DST_MODE DCD Encoder Control Signals Clear CLK Step DCD IR C

VHDL Simulation (Phase 2) 418_0936

Microcontroller (Phase 3)  4K (4096) RAM 8 Memory-mapped I/O Ports 0x000SWITCH(Input)8-bit 0x001LED(Output)8-bit 0x002ANODE(Output)4-bit 0x003CATHODE(Output)8-bit 0x004JA(Output)4-bit 0x005JB(Input)4-bit 120 Data Memory Locations 0x x07F 418_0937

FPGA Implementation LED SWITCH Reset Clock Processor ANODE/CATHODE JAJB

MEM4K entity MEM4K is port(CLK: in std_logic; MEM_Read: in std_logic; MEM_Write: in std_logic; Addr: in std_logic_vector(11 downto 0); Data_In: in std_logic_vector(15 downto 0); Data_Out: out std_logic_vector(15 downto 0); SWITCH: in std_logic_vector(7 downto 0); LED: out std_logic_vector(7 downto 0); ANODE: out std_logic_vector(3 downto 0); CATHODE: out std_logic_vector(7 downto 0); JA: out std_logic_vector(4 downto 1); JB: in std_logic_vector(4 downto 1)); end MEM4K; 418_0939

Data Instruction Format 418_ IROPSRCDSTVALUE ModeREG #NameSyntaxEffective Address SRC or DST Register DirectRnEA = Rn Register Indirect[Rn]EA = (Rn) 10vvAbsolute[Value]EA = Value 11*vvImmediateValueOperand = Value EA = Effective Address vv = Upper 2 bits of Value * = SRC only

Data Instructions 418_0941 OPFnAssembly LanguageRegister Transfer Notation 000MOVE MOVE SRC,DST DST  SRC 001ADD ADD SRC,DST DST  SRC + DST 010INV INV SRC,DST DST  not SRC 011AND AND SRC,DST DST  SRC and DST 100SHL SHL SRC,DST DST  SRC(14 dt 0) & 0 101ASHR ASHR SRC,DST DST  SRC(15) & SRC(15 dt 1)

Branch Instruction Format 418_ IROPMDOFFSET OPMDFnAssembly LanguageRegister Transfer Notation BRA BRA Offset PC  PC + Offset 001BZ BZ Offset PC  PC + Offset (Z = 1) 010BNZ BNZ Offset PC  PC + Offset (Z = 0) 011BN BN Offset PC  PC + Offset (N = 1) 100BNN BNN Offset PC  PC + Offset (N = 0) BSR BSR Offset STACK  PC; PC  PC + Offset 111RTN PC  STACK

418_0943 Summary  Example Microprocessors Instruction Set Architecture  Instructional Processor Design Data Path Memory Instruction Processing  VHDL Model ISim Simulation FPGA Implementation