how to convert integer to signal value

G

Guffi

Guest
I have integer (in process) which I want to convert to signal
(std_logic_vector) value. How to do this?

WrAddr1<=PENum;
WrAddr1:=PENum;

doesn't work :(

WrAddr1 - std_logic_vector
PENum - integer
 
Guffi wrote:
I have integer (in process) which I want to convert to signal
(std_logic_vector) value. How to do this?

WrAddr1<=PENum;
WrAddr1:=PENum;

doesn't work :(

WrAddr1 - std_logic_vector
PENum - integer
use on top:
LIBRARY ieee;
USE ieee.numeric_std.ALL;

and in your code:
WrAddr1 <= std_logic_vector( to_unsigned( PENum, WrAddr1'LENGTH ) );

Regards,

Pieter
 
Pieter Hulshoff pisze:
Guffi wrote:
I have integer (in process) which I want to convert to signal
(std_logic_vector) value. How to do this?

WrAddr1<=PENum;
WrAddr1:=PENum;

doesn't work :(

WrAddr1 - std_logic_vector
PENum - integer

use on top:
LIBRARY ieee;
USE ieee.numeric_std.ALL;

and in your code:
WrAddr1 <= std_logic_vector( to_unsigned( PENum, WrAddr1'LENGTH ) );

Regards,

Pieter
thanks a lot
 

Welcome to EDABoard.com

Sponsor

Back
Top