Lecture18 - Lecture 18: Spring 2010 1 ECE 2300 Introduction...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Lecture 18: Spring 2010 1 ECE 2300 Introduction to Digital Logic Design Single Cycle Microprocessor Lecture 18: 2 Announcements HW 8 is on Blackboard Prelim 2 Thursday, April 15, 7:30pm, Phillips 101 Covers Lectures 10-20 Closed book and notes Let me know if you need a make-up Lecture 18: 3 Datapath + Control Unit k-bit register addresses register/immediate select function select memory write load register ALU/memory select RF LD SA SB DR D_in ALU RAM DataA DataB V C Z N F m F SE IMM MB M_address Data_in MW MD 1 1 DR SA SB MB FS MD LD MW IMM immediate value Control Word ! V C N Z DR SA SB IMM MB FS MD LD MW CU Lecture 18: 4 Shift and Add Multiplication S1 R0 <= R0-R0 S2 R1 <= M[R0] S3 R2 <= M[R0 + 1] S4 R3 <= R3-R3 S5 R4 <= R2 & 1 S6 R2 <= SRL(R2) S7 R3 <= R3 + R1 S8 R1 <= SLL(R1) S9 R2 <= R0+2 S10 M[R2] <= R3 DR SA SB MB FS MD LD MW 000 000 000 SUB 1 001 000 xxx 1 ADD 1 1 010 000 xxx 1 ADD 1 1 011 011 011 SUB 1 100 010 xxx 1 AND 1 011 011 001 ADD 1 001 001 xxx x SLL 1 010 000 xxx 1 ADD 1 xxx 010 011 1 ADD x 1 010 010 xxx x SRL 1 IMM x 1 x 1 x x 2 x 1 2 3 4 5 6 7 8 9 10 R4=0 R2 " Start Start R4=1 R2=0 Lecture 18: 5 Program Counter (PC) Special register that points to the location (address) in ROM of the next control word Updated every clock cycle Sequential execution Control words read from sequential ROM locations PC is increased by 1 after each control word read Branch operations Special control flow operations Condition codes determine whether to branch or not If so, next ROM address is PC + branch offset Lecture 18: 6 R2 <= R0 + R1 R1 <= M[R2] M[R2] <= R0 R3 <= R0 + 3 PC-Based Control Unit DR SA SB MB FS MD LD MW IMM 010 000 001 ADD 1 x 001 010 xxx 1 ADD 1 1 xxx 010 000 1 ADD x 1 011 000 xxx 1 ADD 1 3 a: a+1: a+2: a+3: Adder 1 PC RF LD SA SB DR D_in ALU RAM DataA DataB V C Z N F m F SE IMM MB M_address Data_in MW MD 1 1 DR SA SB IMM MB FS MD LD MW ROM Lecture 18: Branch Operations Used to jump to a different part of the program Consists of a condition and an offset Condition Perform an operation and check for V: Overflow C: Carry out Z: Zero N: Negative Offset How far ahead, or back, to jump if condition is true 7 Lecture 18: 8 Branch Operations PC RF LD SA SB DR D_in ALU RAM DataA DataB V C Z N F m F SE IMM MB M_address Data_in MW MD 1 1 MP BS 1 Z Z N N C V 1 2 3 4 5 6 7 DR SA SB IMM MB FS MD LD MW BS OFF ROM DR SA SB IMM MB FS MD LD MW ROM SE(OFF) Adder MP 1 +1 Lecture 18: 9 R2 <= SRL(R2) if (R4=0) goto 8 R3 <= R3 + R1 R1 <= SLL(R1) PC RF LD SA SB DR D_in ALU RAM DataA DataB V C Z N F m F SE IMM MB M_address Data_in MW MD 1 1 5: 6: 7: 8: 010 010 xxx x SRL 1 x 000 x x 100 x 1 SUB 010 2 001 001 xxx x SLL 1 x 000 x 011 011 001 ADD 1 x 000 x DR SA SB MB FS MD LD MW IMM BS OFF MP BS 1 Z Z N N C V 1 2 3 4 5 6 7 Branch Operations DR SA SB IMM MB FS MD LD MW BS OFF...
View Full Document

This note was uploaded on 04/10/2010 for the course ECE 2300 taught by Professor Long during the Spring '08 term at Cornell University (Engineering School).

Page1 / 4

Lecture18 - Lecture 18: Spring 2010 1 ECE 2300 Introduction...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online