Vhdl operations

Joined
Apr 27, 2011
Messages
2
Reaction score
0
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
 
Joined
Jan 30, 2009
Messages
42
Reaction score
0
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.
 
Joined
Jan 29, 2009
Messages
152
Reaction score
0
You have A and B in scope, so they must be declared somewhere: as signals or variables, or inputs to the entity.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top