Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I frequent other newsgroups, too, and am MOST IMPRESSED with the lack of smart a-- and presence of genuine desire to help anyone of any skill level..."

Geography

Where in the world do Tek-Tips members come from?

ghdl: no definition for "and" and "or" operator

Melchoire (Programmer)
14 Jun 11 16:12
Hi all,

I'm using ghdl to compile some vhdl code and I can't get the "and" and "or" operators to work. Here's the file where I'm using it:

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_unsigned.all;

entity question3 is
Port (D :in std_logic_vector(3 downto 0);
Y :out std_logic_vector(3 downto 0));
end entity question3;

architecture dataflow of question3 is
signal row0, row2, row3, row8, row9, rowD, rowE : std_logic_vector(3 downto 0) := "0000";

begin
row0 <= (not D(3)) and (not D(2)) and (not D(1)) and (not D(0));
row2 <= (not D(3)) and (not D(2)) and D(1) and (not D(0));
row3 <= (not D(3)) and (not D(2)) and D(1) and D(0);
row8 <= D(3) and (not D(2)) and (not D(1)) and (not D(0));
row9 <= D(3) and (not D(2)) and (not D(1)) and D(0);
rowD <= D(3) and D(2) and (not D(1)) and D(0);
rowE <= D(3) and D(2) and D(1) and (not D(0));

Y(3) <= '0' or row8 or rowD or row3;
Y(2) <= row2 or row9 or row3 or rowD;
Y(1) <= row9 or row2 or row0 or rowE;
Y(0) <= '0' or row0 or row8 or rowE;
end architecture dataflow;

I get an error invoked on each line that uses "and" or "or" that says:
no function declarations for operator "and"/"or"

I tried passing in "--ieee=synopsys" as my library and including "ieee.std_logic_unsigned" but to no avail.
fjodorr (Programmer)
22 Oct 11 11:14
You making the wrong use of "and" and "or" and confuse the use of vectors and bits.

For row0 that is a vector u must use "&" like (not D(3) & not D(2) ) and so on.

For your output you use vectors where there should be bits.

Y(3) <= '0' or row8(somebit) or rowD(somebit) or row3(somebit);


Do you understand me?  

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close