-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPCAdder.v
35 lines (28 loc) · 958 Bytes
/
PCAdder.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// ECE369A - Computer Architecture
// Laboratory
// Module - PCAdder.v
// Description - 32-Bit program counter (PC) adder.
//
// INPUTS:-
// PCResult: 32-Bit input port.
//
// OUTPUTS:-
// PCAddResult: 32-Bit output port.
//
// FUNCTIONALITY:-
// Design an incrementor (or a hard-wired ADD ALU whose first input is from the
// PC, and whose second input is a hard-wired 4) that computes the current
// PC + 4. The result should always be an increment of the signal 'PCResult' by
// 4 (i.e., PCAddResult = PCResult + 4).
////////////////////////////////////////////////////////////////////////////////
module PCAdder(PCResult, PCAddResult);
input [31:0] PCResult;
output reg [31:0] PCAddResult;
always @(PCResult)
begin
PCAddResult <= PCResult + 4;
end
/* Please fill in the implementation here... */
endmodule