Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
It depends on whether you have access to the stream's data clock. If so then you can get away with something simple such as the solution hinted at by maksya.bansalr said:I want to detect a second one '1' in a serial bit stream. Can some one suggest me optimal logic implementation.
library ieee;
use ieee.std_logic_1164.all;
entity parser is
port(clk : in std_logic;
rst : in std_logic;
din : in std_logic;
dout: out std_logic);
end parser;
architecture parser of parser is
begin
process(clk, rst)
variable count : integer range 0 to 2;
begin
if(rst = '1') then
dout <= '0';
count := 0;
elsif (clk'event and clk = '1') then
if(din = '1') then
if(count = 1) then
dout <= '1';
count := 0;
else
dout <= '0';
count := 1;
end if;
else
count := 0;
dout <= '0';
end if;
end if;
end process;
end parser;
Is it critical in your case to use only combinational logic?bansalr said:Actually i wanted to know if we have say 32 bit of data. what is combinational logic
to search for a second one.