Nios/memaddr
From ASMBits
nios/cachehits2Previous
Nextnios/memsize
Consider a memory array of depth D and width of B bits. How many address lines are needed for this memory array?
Write a function that returns the number of address bits for a memory of depth D and width B bits. D and B will be at least 1.
unsigned int addrlines(unsigned int D, unsigned int B);
Expected solution length: Around 10 lines.
Sample Input
addrlines(16, 8)
Sample Output
r2=4
nios/cachehits2Previous
Nextnios/memsize