Oct 26, 2006 #1 O 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.
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.
Oct 26, 2006 #2 N nand_gates Advanced Member level 3 Joined Jul 19, 2004 Messages 899 Helped 175 Reputation 350 Reaction score 53 Trophy points 1,308 Activity points 7,037 Yes It will work! Checkout yourself!
Oct 26, 2006 #3 V vs21 Junior Member level 3 Joined Jun 8, 2006 Messages 27 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,450 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
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