-
Notifications
You must be signed in to change notification settings - Fork 3
/
ID.v
32 lines (28 loc) · 1.25 KB
/
ID.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
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// //
// CMPEN 331 Spring 2017 //
// Code by John Huddleston (Section 2) //
// ID secondary level module //
// //
//////////////////////////////////////////////////////////////////////////////////
module ID(
input [31:0] instruction, tempWData,
input clk, tempWReg,
input [4:0] tempWAddr,
output wreg,
output m2reg,
output wmem,
output [3:0] aluc,
output aluimm,
output [4:0] RdRt,
output [31:0] regOutA,
output [31:0] regOutB,
output [31:0] extended
);
wire regRt;
ControlUnit ControlUnit(instruction[31:26], instruction[5:0], regRt, wreg, m2reg, wmem, aluimm, aluc);
RegMux RegMux(instruction[15:11], instruction[20:16], regRt, RdRt);
SignExtender SignExtender(instruction[15:0], extended);
RegFile RegFile(clk, tempWReg, instruction[25:21], instruction[20:16], tempWAddr, tempWData, regOutA, regOutB);
endmodule