Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Vhdl operations

Reply
Thread Tools

Vhdl operations

 
 
cally_cally cally_cally is offline
Junior Member
Join Date: Apr 2011
Posts: 2
 
      04-27-2011
hello, i'm new here and i'm asking you how can i create an arithmetic unit that operates addition, substraction, multiplication and division. I have numbers on 4 bits and the result will be maximum on 8 bits. I've tried using "+" , "-" and "*" operators but I get the error:
Code:
Operator "+" is not defined for such operands.

I use the following syntax:
Code:
when "00" => y <= A + B;

Thanks in advance!

Cally
 
Reply With Quote
 
 
 
 
eliascm eliascm is offline
Member
Join Date: Jan 2009
Posts: 42
 
      04-27-2011
You do not give the type of your operands. "+" is not defined for standard_logic_vector. There are several ways around this. One is to use Unsigned type from the ieee numeric_std library.
 
Reply With Quote
 
 
 
 
cally_cally cally_cally is offline
Junior Member
Join Date: Apr 2011
Posts: 2
 
      04-27-2011
how should i declare the 2 operands and what library must i use?

Thanks for your quick response.
 
Reply With Quote
 
joris joris is offline
Senior Member
Join Date: Jan 2009
Posts: 153
 
      04-27-2011
You have A and B in scope, so they must be declared somewhere: as signals or variables, or inputs to the entity.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VHDL Packages, Coding Styles for Arithmetic Operations and VHDL-200xAdditions Amal VHDL 1 03-04-2010 04:09 AM
VHDL-2002 vs VHDL-93 vs VHDL-87? afd VHDL 1 03-23-2007 09:33 AM
stand-alone JMS, other JDBC operations, and transactions ( ActiveMQ + JOTM + JDBC operations ) Jesus M. Salvo Jr. Java 2 02-11-2006 06:33 PM
Pipelining Fixed_pkg operations (VHDL 200x-FT) Divyang M VHDL 3 02-04-2005 03:06 AM
Mathematical Operations in VHDL MtnSurf8 VHDL 1 04-25-2004 06:07 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57