427-CAD6 - EECS 427 CAD6 Program Counter Assignment To...

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

View Full Document Right Arrow Icon
EECS 427 1 CAD6 Program Counter Assignment To design the program counter (PC) for your microprocessor. Make this circuit scannable for inclusion in a scan chain. Description PC All instructions start by using the contents of the program counter as the address to fetch the next instruc- tion. The program counter stores the current instruction address and calculates the address of the next instruction. Storing the current instruction address requires nothing more than a resetable 16-bit register. However, depending on the current instruction, we must also determine whether the next instruction is the instruction that follows sequentially or the instruction resulting from a jump or a branch. Except on Jumps and Branches, the next instruction follows sequentially from the current instruction (i.e., PC PC + 1). The following table lists the instructions from the baseline architecture which may force an address different from the next sequential address in the PC. To avoid confusion concerning the value of the displacement amount for branches, consider the output list- ing below from the assembler. Note that the displacement for the ble at 0x141 is 0x0F (e.g. 0x142 + 0xF = 0x151), not 0x10! Defining the displacement in this manner makes the design of your program counter sim- pler since the pc has been incremented to 0x142 by the time you’re ready to calculate the new branch ad- dress. 0140 / 0020; #0000000000100000 ( 99) test5 or r0 r0 0141 / C70F; #1100011100001111 (100) ble j1 0142 / 0434; #0000010000110100 (101) xor r4 r4 #0000000101010001 (103) .orig 0x0151 0151 / 0020; #0000000000100000 (104) j1 or r0 r0 0152 / CC0F; #1100110000001111 (105) blt j2 0153 / 0434; #0000010000110100 (106) xor r4 r4 A complication is presented by the fact that the processor is pipelined. One must decide how to handle changes in program flow in general, as the change in program flow happens, in our case, in the second stage. Meanwhile, unless we design the control to do differently, the processor would continue to fetch and
Background image of page 1

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

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

This note was uploaded on 04/01/2012 for the course EECS 427 taught by Professor Prof during the Spring '12 term at University of Michigan-Dearborn.

Page1 / 3

427-CAD6 - EECS 427 CAD6 Program Counter Assignment To...

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