-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathromController.v
More file actions
38 lines (31 loc) · 1.72 KB
/
romController.v
File metadata and controls
38 lines (31 loc) · 1.72 KB
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
/*----- Module Overview --------------------------------------------------------*
* *
* ____________________ *
* *
* | | *
* clock -------> | | *
* reset -------> | | -------> outByte *
* highAddrOffset --/03--> | romController | *
* lowAddrOffset --/04--> | | *
* | | *
* ____________________ *
* *
*-------------------------------------------------------------------------------*/
module romController ( clock, reset, enable, highAddrOffset, lowAddrOffset, outByte ) ;
input reset;
input clock;
input enable;
input [2:0] highAddrOffset;
input [3:0] lowAddrOffset;
wire [5:0] reqAdrr;
wire [7:0] reqByte;
output reg [7:0] outByte;
assign readEn = ( ~highAddrOffset[2] ) && enable;
assign reqAdrr = { highAddrOffset[1:0], lowAddrOffset };
charRom charByte ( reqAdrr, reqByte );
always @ ( posedge clock or posedge reset )
if ( reset )
outByte <= 8'h00;
else if ( readEn )
outByte <= reqByte;
endmodule