Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Unsigned operations on vectors

Status
Not open for further replies.

Opel_Corsa

Member level 1
Joined
Nov 13, 2005
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,614
I have 3 8-bit std_logic_vectors A, B, C. If I include the unsigned.all library, would the code correctly perform the following?:
Code:
C <= A + B;
C <= A - B;
C <= A and B; -- bitwise addition
Also for multiplication, lets say I have a 16-bit vector called D. Would the following do what I want?:
Code:
D <= A * B;
C <= D(7 downto 0); -- only interested in the lower 8-bits since C can't hold anything larger
Thanks for any help.
 

Yes It will work! Checkout yourself!
 

Hi,

For C <= A and B, it is always better you use the following syntax,

for i in 0 to 7 loop

C(i) <= A(i) and B(i);

end loop;


Rest all seems to be okay.

Regards
vs21
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top