std_logic_vector to unsigned conversion throwing incompatible error
Problem here is that abus(i) is of type std_logic and no vector. Inserting a '0' helps to create a vector that can be casted to unsigned:

sum := sum + unsigned( '0' &amp; abus(i) );


Here's a helpful numeric_std cheat sheet:
http://www.lothar-miller.de/s9y/categories/16-Numeric_Std