whats wrong with this code???

V

Vineeth V

library IEEE;
use IEEE.std_logic_1164.all;
entity test is
port (
a: inout STD_LOGIC_VECTOR(19 downto 0):="00000000000000000000";
clk:in STD_LOGIC
);
end test;
architecture test of test is
signal si:STD_LOGIC;
begin
process(clk)
begin
if(rising_edge(clk))then
si <= a(19);
a(19 downto 1)<= a(18 downto 0); --gave a=AB480h
end if;
end process;
end test;



I EXPECTED TO GET THE BITS IN 'a' IN 'si' ONE BY ONE DURING EACH
CLOCK ..BUT WHAT I GOT WAS A '1' ALL THE TIME....PLS HELP ME OUT
 
R

R Quijano

Hi

It's that u haven't declared the si as and output signal, also you can
put your declaration but it's better to put a value to the last
signal.


library ieee;
use ieee.std_logic_1164.all;
entity test is
port (
a: inout std_logic_vector(19 downto
0):="00000000000000000000";
si: out std_logic; --declaration of the serial input
clk:in std_logic
);
end test;
architecture test of test is
begin
process(clk)
begin
if(rising_edge(clk))then
si <= a(19);
a<= a(18 downto 0)&'0';
end if;
end process;
end test;
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top