-
Notifications
You must be signed in to change notification settings - Fork 0
/
S_Machine.v
53 lines (44 loc) · 1002 Bytes
/
S_Machine.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//Top Level Implementation for S-Machine CPU
//By Duncan Cameron B00819540 and Jasper Grant B00829263
//2023-11-07
`timescale 1ns / 1ns
module SMachine(
input enable,
input clk,
input switch0,
input switch1,
output led0,
output led1
);
wire read_write_memory;
wire [15:0] data_in_memory;
wire [8:0] addr;
wire [15:0] data_out_memory;
wire [15:0] inst;
wire [7:0] PC;
CPU cpu(
.clk(clk),
.inst(inst),
.enable(enable),
.data_in_memory(data_in_memory),
.read_write_memory(read_write_memory),
.data_out_memory(data_out_memory),
.addr(addr),
.PC(PC)
);
InstMemory inst_memory(
.inst(inst),
.PC(PC)
);
DataMemory data_memory(
.clk(clk),
.read_write(read_write_memory),
.data_in_memory(data_out_memory),
.data_out_memory(data_in_memory),
.addr(addr),
.led0(led0),
.led1(led1),
.switch0(switch0),
.switch1(switch1)
);
endmodule