f



convert boolean to std_logic

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
0
12/17/2011 1:56:21 PM
comp.lang.vhdl 6430 articles. 2 followers. Post Follow

2 Replies
5950 Views

Similar Articles

[PageSpeed] 47

On Dec 17, 8:56=A0am, 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
0
kkjennings (126)
12/17/2011 3:56:16 PM
On Dec 17, 5:56=A0pm, KJ <kkjenni...@sbcglobal.net> wrote:
> On Dec 17, 8:56=A0am, 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: =A0Do 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
>
> =A0 =A0 function To_Std_Logic(L: BOOLEAN) return std_ulogic is
> =A0 =A0 begin
> =A0 =A0 =A0 =A0 if L then
> =A0 =A0 =A0 =A0 =A0 =A0 return('1');
> =A0 =A0 =A0 =A0 else
> =A0 =A0 =A0 =A0 =A0 =A0 return('0');
> =A0 =A0 =A0 =A0 end if;
> =A0 =A0 end function To_Std_Logic;
>
> Kevin Jennings

Thanks for your response.It was very helpfull
0
12/17/2011 5:58:39 PM
Reply:

Similar Artilces:

When is a boolean not a boolean?
I have a strange one that's making me scratch my head. The app is written in AccessXP. The table is a FoxPro 2.6 table. I link to it via ODBC. There is a field called Active, type Logical (boolean) in FoxPro. I have a query where I select OrderID and Active. It presents the records fine. If I enter False or True for the criteria of Active, no records are returned. If I create an expression like Expr1:[Active] = 0 or Expr1:[Active] = -1 the results in that column are 0 or -1 depending on whether or not Active is true or false as I would expect. Yet if I put in True or Fals...

boolean to std_logic
Is there any standard package that can convert TRUE to '1' and FALSE to '0'? Should I write my function? Why there isn't implicit sythax of that? Please ignore this message it was sent to appropriate comp.lang.vhdl group. "valentin tihomirov" <valentinNOSPAM@abelectron.com> wrote: :Is there any standard package that can convert TRUE to '1' and FALSE to '0'? :Should I write my function? Why there isn't implicit sythax of that? : There are a number of standard functions for this, in the various libraries. Example: ieee.numeric_extra...

difference between 'boolean' and 'java.lang.Boolean'
What is the difference between 'boolean' the built-in type and'java.lang.Boolean' the class?When would you use one and not the other? I have a multi-dimensionalarray representing the possibilities inside of cells in a Sudokupuzzle and I am representing each of them as boolean values.At the moment I'm using the built-in boolean. I'd like to know thedifference between these 2 forms.J Leonard J Leonard <John.Richard.Leonard@gmail.com> writes:>What is the difference between 'boolean' the built-in type and>'java.lang.Boolean' the class? The diffe...

CheckBox in Column of JTable: Exception: java.lang.String cannot be cast to java.lang.Boolean
Hello, I have discovered a hidden error. My project was working for awhile, but then I started to get the below error. My error comes from the fact that I'm using a checkbox in a jtable, and I'm using the below "getColumnClass". Thank you, compile: run: Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean at javax.swing.JTable$BooleanRenderer.getTableCellRendererComponent(JTable.java:5412) at javax.swing.JTable.prepareRenderer(JTable.java:5735) at javax.swing.plaf.basic.BasicTableU...

converting verilog to vhdl
Hello I am trying to convert the following code to vhdl assign Q = (rst==0)?Q_int:1'do; How do i convert this to vhdl? I have to use a concurrent statement as this statement is not in the always block hence concurrent. I cannot use an if then else statement as it is sequential. Please help Anuja wrote: > assign Q = (rst==0)?Q_int:1'do; > > How do i convert this to vhdl? I have to use a concurrent statement as Q <= Q_int when rst = '0' else '0'; For future reference this is called conditional assignment. Next time you can just google "VHDL cond...

Converting boolean expressions
Hi, I have an expression like: &and(&and(a,&not(b)),&not(c)) I need an algorithm to convert the expression in : a &and &not(b) &and &not(c). Did anyone have an idea, where I could find an algorithm for my problem? thanks Mit freundlichen Gr��en - best regards Frank Diegm�ller ________________________________________________________________ Universit�t Kassel Fahrzeugsysteme und Grundlagen der Elektrotechnik Wilhelmsh�her Allee ...

how to convert .m into .vhdl
hello all, any idea how can i convert matlab file into vhdl file without using hdl coder?? if hdl coder is the only way.. could you plz me help me how can i use it... thanks, Niveen. "Niveen Morsi" <niveen_morsi@hotmail.com> wrote in message news:khn52v$4qv$1@newscl01ah.mathworks.com... > hello all, > > any idea how can i convert matlab file into vhdl file without using hdl > coder?? Manual conversion? > if hdl coder is the only way.. could you plz me help me how can i use > it... The Getting Started section of the documentati...

How to convert Verilog to VHDL?
Hi, Does anyone know how I can convert my verilog code to VHDL? Stanley liying.chang@verizon.net wrote: > Hi, > Does anyone know how I can convert my verilog code to VHDL? Have a look at http://www.eda.org/comp.lang.vhdl/FAQ3.html#verilog2vhdl Paul. ...

convert from verilog to vhdl
Hello everyone. I had a code for fixed point division by Verilog. I tried to rewrite it with VHDL but not successfull. Can somebody help me? Thanks so much. module division #( //Parameterized values parameter Q = 4, // number of fraction bits parameter N = 8 ) ( input [N-1:0] i_dividend, input [N-1:0] i_divisor, input i_start, input i_clk, output [N-1:0] o_quotient_out, output o_complete, output o_overflow ); reg [2*N+Q-3:0] reg_working_quotient;// Our working copy of the quotient reg [N-1:0] reg_quotient; // Final quotient reg [N-2+Q:0] reg_w...

VHDL to Verilog converter
Hi all, do you know any good program that converts VHDL to Verilog ?! thanks in advance -Amir "Amir" <sting.t2@gmail.com> wrote in message news:1188975738.872743.148600@w3g2000hsg.googlegroups.com... > Hi all, > > do you know any good program that converts VHDL to Verilog ?! > Personally I wouldn't go down this route but you can try XHDL (http://www.ids4eda.com/xhdl.htm), you might have to do some manual editing before converting. Why are you trying to do this? Hans www.ht-lab.com > thanks in advance > -Amir > ...

convert scalar to boolean
Hi.<br>I have created an array which contains 13 elements. These elements are scalars (double, 64 bit real) with the values 0 and 1. The array is initialised with 0s and the number of 1s is defined by user input. The VI is attached.<br>I want to extract each single scalar from the array and afterwards convert them to boolean variables. How can I achive this?<br>Thanks for help. test.vi: http://forums.ni.com/attachments/ni/170/101278/1/test.vi To extract elements from an array, you can use the Index Array function or an auto-indexed for loop. To convert 0 or 1 to a boolean ...

Converting VHDL to XML
Hi all, I'm looking for a tool for converting VHDL entity information (ports, generics) into XML, so I can integrate it in A Docbook document easily. It seem that Quartus and Modelsim can do this (though undocumented in Quartus), but I'm looking for a hardware design tool independent way for doing this, most prefferably open source. If anyone knows about a tool for automatic documentation (like Doxygen for C) I would love to hear about. I know vhdldoc, but it only makes HTML, and I really need XML. Thanks, Avishay "avishay" <avishorp@yahoo.com> writes: > I'm ...

Convert verilog to VHDL??
Hi, Does anyone know how I can convert my verilog code to VHDL? Stanley <sc01@hotmail.com> wrote in message news:5vFob.60444$1C5.41226@nwrdny02.gnilink.net... > Hi, > Does anyone know how I can convert my verilog code to VHDL? I would ask in comp.lang.verilog or comp.lang.vhdl -- glen Do not forget to mention level of description (RTL or structural). The latter should be simpler. X-HDL: http://www.x-tekcorp.com/xhdl3.htm The demo doesn't allow you to save it, though. <sc01@hotmail.com> wrote: :Hi, :Does anyone know how I can convert my verilog code to VHDL?...

Converting C to VHDL
Hi all, Can any one inform me the various steps needed to convert a C coding in to VHDL. Please tell the list of Websites that gives information regarding this topic. Thanks in Advance, Sarath sarath1111@gmail.com wrote: > Can any one inform me the various steps needed to convert a C coding > in to VHDL. Please tell the list of Websites that gives information > regarding this topic. IMHO... 1. Understand what the C code is trying to achieve, and what algorithms are used to achieve that. 2. Think about how that same problem might be solved in hardware consisting of memories...

Web resources about - convert boolean to std_logic - comp.lang.vhdl

VHDL - Wikipedia, the free encyclopedia
VHDL was originally developed at the behest of the U.S Department of Defense in order to document the behavior of the ASICs that supplier companies ...

Reference Pages
... pages I've put together for various reasons: Content Negotiation Commonly Confused Characters CSIL 9840 info (old) CSIL lab info VHDL std_logic ...

FPGA + RGB LED Matrix - Burnt Traces
I was just recently aquired an 8×8 RGB LED matrix, similar to this one. I though it would be good practice to wire up the Papilio board to it ...

Why should I care about latches?
How to find transparent latches, and what to do about them.

基于赛灵思FPGA的频率计设计 (1)
... 文件: fenpin.vhd 作者: 日期: 2012/04/09 修改: 软件: Altera QuartusII 9.0 芯片: Altera Cyclone FPGA (EP1C3T144C8) - LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; ...

Spartan-6 Microboard: FM All-Band CQ Transmitter
rock on completely with some brand new components (by insapio)

Maszynka spartan - Pastebin.com
library IEEE;use IEEE.STD_LOGIC_1164.ALL;entity masz_stan_sp is Port ( WE : in STD_LOGIC_VECTOR (7 downto 0); RDY : in STD_LOGIC; CLK : in STD_LOGIC; ...

Basic std_logic_1164 functions
The image above shows a thumbnail of theinteractive Java applet embedded into this page.Unfortunately, your browser is not Java-aware or Java ...

Spartan-6 FPGA Hello World
... lending me a programmer (although I could also have used Arduino for this) and one of his hand-populated boards. library IEEE;use IEEE.STD_LOGIC_1164.ALL;use ...

LED - Burnt Traces
I was just recently aquired an 8×8 RGB LED matrix, similar to this one. I though it would be good practice to wire up the Papilio board to it ...

Resources last updated: 2/9/2016 3:36:12 PM