dzafar
Member level 4
- Joined
- Jan 17, 2017
- Messages
- 76
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 8
- Activity points
- 690
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;