Forum Discussion
Altera_Forum
Honored Contributor
21 years ago*NEWBIE* User Logic
Hello, I created a very simple user logic. I takes the input, adds 1 to it and write it to the output. timescale 1ns / 100ps
module mytestmodule (
// inputs:
address,...
Altera_Forum
Honored Contributor
21 years agoWrite data isn't guaranteed to be stable when write is negated.
So you need to latch ... Try this:module mytestmodule (clk, address, write, writedata, readdata);
input clk;
input address;
input write;
input writedata;
output readdata;
wire clk;
wire address;
wire write;
wire writedata;
wire readdata;
reg dreg;
always @(posedge clk)
if (write) dreg <= writedata;
assign readdata = dreg + 1;
endmodule --Scott