hardware_guy
Newbie level 6
Hi.
I will explain my problem simply.
I'm trying to get summary of 4-bit vectors in one, 8-bit vector.
I'm expecting to get "00010000" on "count", but I get "00000000"
When I tried this:
I got "00011111"
Yes, I have read recomendations, to use differnt library or use "integer", but I still fail to understand.
I add this:
Is it not enough, or is it too much? How to get "00010000" in this example? How to use "integer" in this example?
In my project, each of the counters cnt1-cnt5 will have own reset signal, but I want to join them in to one vector, to make future processing. :-?
I will explain my problem simply.
I'm trying to get summary of 4-bit vectors in one, 8-bit vector.
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 signal cnt1,cnt2,cnt3,cnt4,cnt5 : STD_LOGIC_VECTOR (3 downto 0); signal count : STD_LOGIC_VECTOR (7 downto 0); cnt1 <= "0000"; cnt2 <= "0000"; cnt3 <= "0000"; cnt4 <= "0001"; cnt5 <= "1111"; count <= cnt1 + cnt2 + cnt3 + cnt4 + cnt5;
I'm expecting to get "00010000" on "count", but I get "00000000"
When I tried this:
Code VHDL - [expand] 1 count <= "0000"&cnt1 + "0000"&cnt2 + "0000"&cnt3 + "0000"&cnt4 + "0000"&cnt5;
I got "00011111"
Yes, I have read recomendations, to use differnt library or use "integer", but I still fail to understand.
I add this:
Code VHDL - [expand] 1 2 3 4 5 library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; use ieee.numeric_std.all;
Is it not enough, or is it too much? How to get "00010000" in this example? How to use "integer" in this example?
In my project, each of the counters cnt1-cnt5 will have own reset signal, but I want to join them in to one vector, to make future processing. :-?