Dear guys,
I need some help programming VHDL.
I need to break up a 8bit binary data to 2 4-bit data. Below is a glimpse of the code:
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;
use work.CharLoopController.all;
entity Sub_prog_test is
Port ( en,reset,DisplayData,clk : in STD_LOGIC;
Data: in STD_LOGIC_VECTOR (7 downto 0);
);
end Sub_prog_test;
architecture Behavioral of Sub_prog_test is
begin
process (clk,en,reset)
variable upper_4bit, lower_4bit: std_logic_vector (3 downto 0);
--------------------Some statement-------------------------
.....................
upper_4bit<=Data(7)& Data(6)& Data(5)& Data(4);
lower_4bit<=Data(3)& Data(2)& Data(1)& Data(0);
However, when i do this, i get an error: "Wrong index type for Data."
Please help
Ridwan
I need some help programming VHDL.
I need to break up a 8bit binary data to 2 4-bit data. Below is a glimpse of the code:
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;
use work.CharLoopController.all;
entity Sub_prog_test is
Port ( en,reset,DisplayData,clk : in STD_LOGIC;
Data: in STD_LOGIC_VECTOR (7 downto 0);
);
end Sub_prog_test;
architecture Behavioral of Sub_prog_test is
begin
process (clk,en,reset)
variable upper_4bit, lower_4bit: std_logic_vector (3 downto 0);
--------------------Some statement-------------------------
.....................
upper_4bit<=Data(7)& Data(6)& Data(5)& Data(4);
lower_4bit<=Data(3)& Data(2)& Data(1)& Data(0);
However, when i do this, i get an error: "Wrong index type for Data."
Please help
Ridwan