Altera_Forum
Honored Contributor
12 years agoAddress comparator
Hello,
1)I have written a verilog module which compares 4 addresses to check if any of them are equal. - I have used xnor to compare the address. So a value of 1 indicates that the addresses are equal. (The simulation is correct till this point) 2)Next according to which addresses are equal I want to output a particular value. (I am not getting the output for this). I have used if-else statements to compare if the values are equal to 1 and accordingly I am setting a particular value to the output. (So if all the 4 addresses conflict the op is 0, if address 0,1 and 2 conflict op = 4 ..etc) But I am not getting the output when I simulate. (None of the if else condition is getting evaluated to 1 even though in that clock cycle there the signal has a value of 1. I am not very well versed in verilog. I tried my best to debug the code. ( there is some logical error which I am not able to figure out) . If anyone could give some inputs on this it will be of great help. I have attached the code and its test bench. Thanks.