Search for question
Question

Summer.2023

me

labus

nouncements

dules

signments

ades

scussions

om Pro 1.3

40

Use the following module interface (which you can find in the provided file):

module NextPCLogic(NextPC, CurrentPC, SignExtImm64, Branch, ALUZero, Uncondbranch);

input [63:0] CurrentPC, SignExtImm64;

input Branch, ALUZero, Uncondbranch;

output [63:0] NextPC;

reg [63:0] tmp;

/* write your code here */

endmodule

Branch (CBZ) is true if the current instruction is a conditional branch instruction, Uncondbranch is

true if the current instruction is an Unconditional Branch (B), and ALUZero is the Zero output of the

ALU.

A template and testbench are provided (If you work on Vivado, comment out the include

command at the very top). Complete the next pc logic; add a few test cases to the testbench to

improve it.

Demonstrate your program to the TA.

Attach a zip/tar file containing your completed module, testbench and a screenshot of the

waveform.

NextPClogic.v↓↓

NextPClogicTest.v

Upload Choose a File/ny

mer.2023

IS

ncements

es

ments

S

Electrical and Co...

sions

Pro 1.3

40

Home | Howdy

Question 2

Outlook

PC

Add

WebAssign-LOG... C Get Homework He...

Write a behavior model to calculate the next PC for an instruction. It will use information from the

processor control module and the ALU to determine the destination for the next PC. It will contain

two adders for calculating the two possible NextPC and choose between the two possibilities using

the logic depicted below.

memory

Regi:00

studion Dif

[Parucion H

-

Uncondbranch

Branch

""!!

data Reg

Netflix ▸YouTube M Gmail.

Shift

left 2

Add ALU

result

20 pts

Zero

2 Maps

Fig: 1

Fig: 2