module register (c,a,b,rst);<br>
output c;<br>
input a,b,rst;<br>
wire [15:0] temp;<br>
reg c;<br>
reg[3:0]count;<br>
assign temp=16'h1234;<br>
always @(posedge a or posedge b or posedge rst) begin<br>
if(rst) begin<br>
count<=0;<br>
c<=0;<br>
end<br>
else<br>
if (a) <br>
count<=count+1;<br>
else<br>
if(b) <br>
c <=temp[count] ; <br>
end <br>
endmodule<br>
<br>
揣摩楼主的用意,写了段代码,请大家指正了~ |