- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
for example
temp : std_logic_vector[31 downto 0] just want to get starting from 3th bit to 5th bit and store to another variable of type std_logic_vector[2 downto 0] like offset how to write in vhdl?Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
variable temp2 : std_logic_vector(2 downto 0);
.... temp2 := temp(5 downto 3);- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i mean temp2 : std_logic_vector(6 downto 0) := "011011"
if want to get from bit 3 to bit 5 which is 101 does it need to write a substring function or is there a function that can do this?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I dont quite understand what you mean. You can slice an array like I showed you.
temp3 := temp2(5 downto 3);
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page