Forum Discussion
Altera_Forum
Honored Contributor
14 years agovhdl coding
hi am new to vhdl programming. I need help in wirting the code for inserting variable data into a register. the length of the register should be based on the number of bits of data am giving to the r...
Altera_Forum
Honored Contributor
14 years agoya thanks for your quick response
actually i have taken if statements to insert the data into the register. ex: if (numofbits = "0011") then data <= "111"; elsif(numofbits = "0100") then data <= "1111"; end if; so on i have to write code for variable numofbits for ex: 3 to 16 bits. is there any other way of writing the code instead of using so many if and elsif statements.