So following on from my other thread I am essentially going to try to target a EPM7064STC44 and develop in Verilog using Quartus II 13.x...
All is going well for my first design... so moving to my second...
I have 2 values (both 8-bit unsigned) that I have to add together and then add 1... I need to produce the output.
Now simplistically...
adj_value = value1+value2+1
This works but produces some interesting output...
Info (278001): Inferred 1 megafunctions from design logic
Info (278002): Inferred adder/subtractor megafunction ("lpm_add_sub") from the following logic: "Add0"
Info (12130): Elaborated megafunction instantiation "lpm_add_sub:Add0"
OK... well if it wants to I suppose it can...
but this one is a bit more worrying...
Warning (10230): Verilog HDL assignment warning at Thing.sv(25): truncated value with size 32 to match size of target (
I have...
reg [7:0] adjusted_value;
always @(posedge s1_i) begin
adjusted_value = value1+value2+1;
end
So really I just want an 8 bit full adder (where I can use the lowest carry to incorporate my +1)
These warnings made me wonder... Should I be using something that is more knowledgeable about the underlying device? Can I force the arithmetic to 8bit? Should I bite the bullet and use a megafunction (and lock myself into the IP) or is there some more portable middle-ground?
Apologies for the newbie question!