I have the following declarationsVHDL integers are not a collection of 'bits' so in that sense the answer to your question is 'No'. However, if you assign S <= "11111111"; then N will be set to -1 in your example. I assume this is more along the lines of the real question you are getting at. Commonly, VHDL integers are implemented as either 32 or 64 bits.
signal S: SIGNED(7 downto 0);
signal N: INTEGER;
N <= TO_INTEGER(S);
Question: Will the TO_INTEGER functiona sign extend 'S' to 32 bit integer?
Thanks.
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 57:56:24 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
4 files (9,632K bytes) |
| Messages: | 285,955 |