Forum Discussion
Altera_Forum
Honored Contributor
10 years agoHi Tricky,
That's really helpful, thanks. I'd understood that the width of the "built-in" integer was architecture dependent, it just hadn't clicked that it was always a signed type. Now I think of it, of course that's completely equivalent to C (which I'm more familiar with) where int a ; is a signed type (of architecture-dependent width) and unsigned int a ; is the unsigned of the same width. My textbook ("The students' guide to...") hasn't mentioned the "unsigned" type yet - the only integer type that's listed is called "integer". As I said, I'm very new to all this. I notice that your definition syntax is different to that used in the book, too. The form unsigned(3 downto 0) looks like a type conversion - it it related? Regarding my two example definitions: type uint32 is range 0 to 10 ; subtype uint32 is integer range 0 to 10 ; Do these produce two types which are functionally equivalent (with the same range and operators) but which are incompatible due to being different types? Thanks for the help!