- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ai guys...
i'm new here... n i have a problem n need ur helps... i already write my vhdl binary code but i don't know how to convert it to hex code... my supervisor wants me to change my certain binary value into hex value...but i dont know what to add so that i can use hex value in my coding.. i really need ur help... thanks....Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There's a few ways you can do this.
1) If your signal is a multiple of 4-bits, then you can use X to indicate hex. signal d : std_logic_vector(15 downto 0) := X"1234"; 2) If your signal is a mixture, you can use a concatenate operator, eg., to set 18-bits to 12345h, you could use signal d : std_logic_vector(17 downto 0) := "01" & X"2345"; 3) Using VHDL-2008 you can use a width specifier signal d : std_logic_vector(17 downto 0) := 18X"12345"; You can also use conversion functions, eg., to convert an integer value in hex format 16#12345# to std_logic_vector. Cheers, Daveedit - fixed the bus widths for you...

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