Forum Discussion
Altera_Forum
Honored Contributor
14 years agoI think I made a mistake when I suggested a solution to you. There are actually 4 byteenable bits in the byteenable bus. One for each byte within the word. You probably need to do the following.
input [3:0] byteenable; wire [2:0] address_int; always (*) begin case(byteenable) 4'b0001: address_int = {address[2], 2'b00}; 4'b0010: address_int = {address[2], 2'b01}; 4'b0100: address_int = {address[2], 2'b10}; 4'b1000: address_int = {address[2], 2'b11}; default: address_int = {address[2], 2'b00}; endcase end Please check out the avalon specification for more information on how byteenables work. /Boris