Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

VHDL types and subtypes

Status
Not open for further replies.

shaiko

Advanced Member level 5
Joined
Aug 20, 2011
Messages
2,644
Helped
303
Reputation
608
Reaction score
297
Trophy points
1,363
Activity points
18,302
In VHDl, Is it possible to do arithmetic operations between a subtype and it's father type ?

For example:
If signals A and C are definded as integers and signal B is defined as a natural.
Is it legal to write:
C <= A + B;
 

Yes you can. A subtype is still of the same type of the base type.

Note, that because the in built functions have no knowledge of subtypes, the returned value (like C in this case) will be the base type. You will have to write your own function for it to return the subtype.
 
  • Like
Reactions: shaiko

    shaiko

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top