目的是在CE=0的时候RAM选通,CE=1的时候不选通,我初步编了下,但是好像寄存器类型的不能用来输出时钟,求大神指导~
module KINGSON2(
clock,
nclock,
data_in,
rdaddr,
rd_en,
wraddr,
wr_en,
ce,
data_out);
input clock;
input nclock;
input [15:0] data_in;
input [6:0] rdaddr;
input [6:0] wraddr;
input rd_en;
input wr_en;
input ce;
reg clockmid;
output [15:0]data_out;
RAM1(
.clock(clockmid),
.data(data_in),
.rdaddress(rdaddr),
.rden(rd_en),
.wraddress(wraddr),
.wren(wr_en),
.q(data_out));
always@(posedge clock)
if(ce)
clockmid<=nclock;
else
clockmid<=clock;
endmodule |