- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to set the first bit in a logic vector to 1 so that the number is signed as a negative
- Tags:
- Vhdl
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Rory,
Yes, you can change a single bit in a vector without impacting other bits.
Example:
Data : in STD_LOGIC_VECTOR (15 downto 0);
x: out STD_LOGIC_VECTOR (15 downto 0);
.......
signal signBit : std_logic:='1';
......
signal sig : std_logic_vector(31 downto 0);
.......
sig(31)<=data(15);
signBit <= Data(15);
x(15)<='1';
Regards
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank you so much that's really helped.😁

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