dzafar
Member level 4
Hello there,
I understand the following:
Integer: 32 bit signed value
Natural: 32 bit unsigned value starting at 0
Positive: 32 bit unsigned value starting at 1
My question is, is the following allowed/legal? Or do we have to do type casting?
ENTITY addition IS
PORT (
ARCHITECTURE my_arch OF addition IS
BEGIN
I understand the following:
Integer: 32 bit signed value
Natural: 32 bit unsigned value starting at 0
Positive: 32 bit unsigned value starting at 1
My question is, is the following allowed/legal? Or do we have to do type casting?
ENTITY addition IS
PORT (
A, B: in positive;
C: out natural);
end addition;ARCHITECTURE my_arch OF addition IS
BEGIN
C <= A + B;
end ARCHITECTURE;