Forum Discussion
Altera_Forum
Honored Contributor
11 years agoNeed advice about coding style
Hello I'm Alex and I am novice for VHDL coding. if my english awful pls forgive me. I trying to understand VHDL PROCESS statement. I try with 1bit full adder with carry save function in Quartus2 v...
Altera_Forum
Honored Contributor
11 years agoI've changed as you wish. But I am confused what's wrong with my previous. I agree that no extra bit requried in variable , but the reverse order - i'm confused. I can only suggest that LSB is always at index 0 but I am not sure about it. If your advice is coming from code can be read clearly, i accept it.
ARCHITECTURE b OF full_adder_Nbit IS
BEGIN
p0 : PROCESS(ci, a, b)
VARIABLE
result_v : UNSIGNED (N DOWNTO 0);
BEGIN
result_v := ('0' & a ) + ('0' & b) + ('0' & ci);
co <= result_v(N);
s <= result_v(N-1 DOWNTO 0);
END PROCESS p0;
END b;