home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / vhdl / 620 < prev    next >
Encoding:
Text File  |  1993-01-02  |  1.2 KB  |  42 lines

  1. Newsgroups: comp.lang.vhdl
  2. Path: sparky!uunet!think.com!sdd.hp.com!news.cs.indiana.edu!babbage.ece.uc.edu!ucunix.san.uc.edu!mandayrv
  3. From: mandayrv@ucunix.san.uc.edu (Prince of Wales)
  4. Subject: data types, vhdl
  5. Message-ID: <C08p03.Htv@ucunix.san.uc.edu>
  6. Followup-To: poster
  7. Keywords: union, vhdl
  8. Organization: University of Cincinnati
  9. Distribution: usa
  10. Date: Sat, 2 Jan 1993 18:36:02 GMT
  11. Lines: 29
  12.  
  13. Hi folks,
  14.  
  15. Is there any options in the vhdl language that lets me declare types
  16. equivalent to the "union" in C. The brute force method that I can think of
  17. is to declare a record with all the possible choices in the original union
  18. as a strictly present field; and have integer tags to access the types: 
  19.  
  20.     e.g.    -- pseudo vhdl code;
  21.  
  22.     type union is record
  23.         -- the tag to determine what field to use;
  24.         access_type : integer;
  25.         -- this is where the union starts
  26.         -- list is declared earlier as an access type to a list;
  27.         u1 : real;
  28.         u2 : integer;
  29.         u3 : list
  30.         end record;
  31.  
  32. Is there any alternative to this lengthy  way of designing a data structure.
  33.  
  34.  
  35. thanks for any replies and comments.
  36.  
  37. ramanand
  38. -- 
  39. ramanand@pumpkin.ece.uc.edu          home:   513 281 9870
  40. rmandaya@uceng.uc.edu                office: 513 556 3025
  41. mandayrv@ucunix.san.uc.edu           ham:    KB8GKL
  42.