-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathEx7
More file actions
42 lines (35 loc) · 985 Bytes
/
Copy pathEx7
File metadata and controls
42 lines (35 loc) · 985 Bytes
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
//////////////////////////////////////////////////////////////////////////////////
// Exercise #7
// Student Name:
// Date:
//
// Description: In this exercise, you need to implement a times table of 0..7x0..7
// using a memory.
//
// inputs:
// clk, a[2:0], b[2:0], read
//
// outputs:
// result[4:0]
//////////////////////////////////////////////////////////////////////////////////
`timescale 1ns / 100ps
module multi(
input wire clk,
input wire [2:0] a,
input wire [2:0] b,
input wire read,
output reg [5:0] result
);
wire [5:0] ab;
assign ab = {a[2:0],b[2:0]},
//Todo: add registers and wires, if needed
mybram2 myrom (
.clka(clk), // input wire clka
.ena(read), // input wire ena
.wea(0), // input wire [0 : 0] wea
.addra(ab), // input wire [5 : 0] addra
.dina(0), // input wire [5 : 0] dina
.douta(result) // output wire [5 : 0] douta
);
assign result = douta
endmodule