convert boolean to std_logic

M

manolis kaliorakis

Guest
Hello to all,

I am a beginner in using vhdl. I want to convert a signal boolean to
std_logic. How could I achieve this?
I am using these libraries:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

Thanks in advance
 
On Dec 17, 8:56 am, manolis kaliorakis <kaliorakis.d...@gmail.com>
wrote:
Hello to all,

I am a beginner in using vhdl. I want to convert a signal boolean to
std_logic. How could I achieve this?
I am using these libraries:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
KJ note: Do not use the following libraries, use ieee.numeric_std
instead
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
You have to create your own function...here it is

function To_Std_Logic(L: BOOLEAN) return std_ulogic is
begin
if L then
return('1');
else
return('0');
end if;
end function To_Std_Logic;

Kevin Jennings
 
On Dec 17, 5:56 pm, KJ <kkjenni...@sbcglobal.net> wrote:
On Dec 17, 8:56 am, manolis kaliorakis <kaliorakis.d...@gmail.com
wrote:

Hello to all,

I am a beginner in using vhdl. I want to convert a signal boolean to
std_logic. How could I achieve this?
I am using these libraries:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

KJ note:  Do not use the following libraries, use ieee.numeric_std
instead

use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
k
You have to create your own function...here it is

    function To_Std_Logic(L: BOOLEAN) return std_ulogic is
    begin
        if L then
            return('1');
        else
            return('0');
        end if;
    end function To_Std_Logic;

Kevin Jennings
Thanks for your response.It was very helpfull
 

Welcome to EDABoard.com

Sponsor

Back
Top