Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to translate hex into binary by vhdl

Status
Not open for further replies.

shenql

Junior Member level 2
Joined
Nov 20, 2007
Messages
24
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,419
vhdl binary

hi everyone!
may someone know how to translate hex into binary by vhdl! if you know, pls tell me! thanks!
 

vhdl hex to binary

you better use normal program to do it.
 

vhdl hex

i don't know what's your meaning
 

hex to binary vhdl

do you want to translate hex into binary in VHDL fomat?
such as assembler -> hex file -> binary in VHDL format, and then run the code in FPGA or CPLD use for debuging your microprocessor which is implemented in FPGA or CPLD??

Added after 1 minutes:

I used one c code transfer hex into verilog format, in my opinion, it is the same as VHDL
 

translate hex

why i want to do this! now i have a hex file and i want to operate in bit handling!
for example :0x5A ->0101 1010 maybe, I want to get
the 011010 six bits! do you have another solution except transfering hex into binary!
 

vhdl binary file

Do u mean u want to extract last 6 bits of the converted no?
:?:
 

hread vhdl

a<= x"FE";

same as

a<= "11111110";
 

vhdl read binary

u are right! but i want to get the value of last 5 bits("11110") or 6 bits ("111110")
may do this ?a<=x"FE"&&x"1F"
the result may a<=x"1E" it's get the value of last 5 bits
 

hexadecimal vhdl

in vhdl every thing is in binary, you cannot have a data type which can store hex. so when you will read from a file using something like
Code:
variable l1 : line;
variable var1 : std_logic_vector(7 downto 0);
.
.

readline(f1,l1); --read a line from a file f1 which contains hex words example FE
hread(var1,l1); -- read into var1, a hex value from line l1.
The variable var1 will be a binary value. i.e you wont have to do anything to it to convert it to binary. and if you are interested in last 5 bits, then you can do

Code:
variable l1 : line;
variable var1 : std_logic_vector(7 downto 0);
variable var_five_bits : std_logic(4 downto 0);
.
.

readline(f1,l1); --read a line from a file which contains hex words example FE
hread(var1,l1);
var_five_bits := var1(4 downto 0);

hope it helps,
Kr,
avi
http://www.vlsiip.com
 

hex to binary converter vhdl

signal xx : std_logic_vector (7 downto 0);
signal first5bites: std_logic_vector (4 downto 0);



first5bites <= xx(4 downto 0);

-- or if you want a part of the byte

first5bites <= xx (6 downto 2);

-- the only condition is you assign a signal or a part of it of the same length
 

vhdl binary code

thanks!
 

vhdl hex std_logic_vector

if i want to get the mid 4bits .can i get this
signal xx : std_logic_vector (7 downto 0);
signal mid4bites: std_logic_vector (3 downto 0);
mid4bits<=xx(5 downto 2);

?
 

vhdl binary file read

shenql said:
if i want to get the mid 4bits .can i get this
signal xx : std_logic_vector (7 downto 0);
signal mid4bites: std_logic_vector (3 downto 0);
mid4bits<=xx(5 downto 2);

?

YES,
The position does not matter, only number of bits matter.
 

binary read vhdl

cfriend said:
do you want to translate hex into binary in VHDL fomat?
such as assembler -> hex file -> binary in VHDL format, and then run the code in FPGA or CPLD use for debuging your microprocessor which is implemented in FPGA or CPLD??

Added after 1 minutes:

I used one c code transfer hex into verilog format, in my opinion, it is the same as VHDL



yes,hex file->get the data from the file by vhdl ,and then run the code in FPGA
So I want to know how can I get the data and operate the data by vhdl?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top