VHDL coding problem :( Hello! I've been working on this problem for awhile. I have a feeling it's a beginning problem that I don't quite understand.
--I'm accessing internal memory, 4 rows of 2 bit numbers each. I've been able to read and write to memory just fine, my problem is incrementing the address at which I will store the next data set.
--My unit is controlled by an FSM with three states. Idle, reed and rite. I have three internal signals, addressin: a pointer to the address to be read next, addressout: a pointer to the address to be written next and addressall, the address which will go into the actual memory stage.
PROCESS (y)
BEGIN
CASE y IS
WHEN I=>
enable<='0';
WHEN reed=>
enable<='0';
IF (addressin="00" OR addressin="01" OR addressin="10") THEN
addressin<=addressin+"01";
ELSE
addressin<="00";
END IF;
addressall<=addressin;
WHEN rite=>
enable<='1';
IF (addressout="00" OR addressout="01" OR addressout="10") THEN
addressout<=addressout+1;
ELSE
addressout<="00";
END IF;
addressall<=addressout;
END CASE;
END PROCESS;
memorystage: memory PORT MAP (clck, NOT reset, NOT enable, addressall, datain, dataout);
The process will activate when y changes (the states changing is in code not seen.) My problem is, the addressin will change, the address out will change, and so will the addressall... But never by one, and never in any sequential logic... (I have this in hex display to see) For example I'll get for addressin : 3 3 1 0 3 0 3 0 2 0 2 1 0.... same with the other two address signals. I have no idea what I'm doing wrong. This is only part of a larger project, so I pulled this out to work on it by itself. :( what am I doing wrong? Thanks. -Jenn