B
bir
Guest
I have a decoding logic which decodes bit 34 - 32 of a shift register.
But the the compiler complains "bit select operator cannot be applied
to scalar"
Can I implement the decoder in this format??
wire [2:0] a;
wire [7:0] addr_dec;
// Address Decode
assign a0 = shift_dr[32];
assign a1 = shift_dr[33];
assign a2 = shift_dr[34];
assign addr_dec[0] = !a2 && !a1 && !a0;
assign addr_dec[1] = !a2 && !a1 && a0;
assign addr_dec[2] = !a2 && a1 && !a0;
assign addr_dec[3] = !a2 && a1 && a0;
assign addr_dec[4] = a2 && !a1 && !a0;
assign addr_dec[5] = a2 && !a1 && a0;
assign addr_dec[6] = a2 && a1 && !a0;
assign addr_dec[7] = a2 && a1 && a0;
Thanks
But the the compiler complains "bit select operator cannot be applied
to scalar"
Can I implement the decoder in this format??
wire [2:0] a;
wire [7:0] addr_dec;
// Address Decode
assign a0 = shift_dr[32];
assign a1 = shift_dr[33];
assign a2 = shift_dr[34];
assign addr_dec[0] = !a2 && !a1 && !a0;
assign addr_dec[1] = !a2 && !a1 && a0;
assign addr_dec[2] = !a2 && a1 && !a0;
assign addr_dec[3] = !a2 && a1 && a0;
assign addr_dec[4] = a2 && !a1 && !a0;
assign addr_dec[5] = a2 && !a1 && a0;
assign addr_dec[6] = a2 && a1 && !a0;
assign addr_dec[7] = a2 && a1 && a0;
Thanks