Bman900
Newbie level 3
Well I have some code that basically takes 3 buttons and to increase counters and then I add them together and store in a register. This is used to enter amount of a product some one might want for example.
But then I want to use these same 3 buttons to simulate the entering of money into the system. So the way I was thinking is using a switch to actually switch between the 2 occasion I will need.
Now I now you can't simply do this since portmaping can not be used inside a process which is where an if statement lives.
I then tried generate but that did not work either. So any one have any idea?
Here is the code that am talking about, but only works with 1 register and for one thing.
But then I want to use these same 3 buttons to simulate the entering of money into the system. So the way I was thinking is using a switch to actually switch between the 2 occasion I will need.
Now I now you can't simply do this since portmaping can not be used inside a process which is where an if statement lives.
I then tried generate but that did not work either. So any one have any idea?
Here is the code that am talking about, but only works with 1 register and for one thing.
Code:
L1: block1 generic map(8) port map(BUTTON1, BUTTON2, RST, CIN, COUT,SUM1); --adds the 2 values toghter from 2 counters that
--is controled by button 1 and 2
L2: count10 generic map(8) port map(BUTTON3, RST, BUTTON3COUNT); --this will control another counter with button 3
L3: FA generic map(8) port map(SUM1,BUTTON3COUNT,CIN2,SUM2,COUT2); -- now we add the sum from the first 2 counters with
--the value from counter 2