Professional Documents
Culture Documents
M2:Pattern recognizer
Interconnect M1 and M2
1, 0 / 0
0,1 / 0
01/ 0
1 / 0
s1
01/ 0 01/ 0
0 / 0 11/1
s2
01/1
00/ 0
s3
when 3=> if (y='1' and x='1') then state<=0; z<='1'; elsif (y='1' and x='0') or (y='0' and x='0') then state<=0; z<='0'; else state<=1; z<='1'; end if; when others=>null; end case; end if; end process; end behavioral;
Y1 M1 M2
Clock
begin a1:count port map (clk=>clk,reset=>reset,y=>p); a2:detect port map (clk=>clk,reset=>reset,y=>p,x=>x,z=>z); end behavioral;
In a bit stream, count the number of @ character [ASCII code is 40H] in blocks of 256 characters. Each character is represented by a 8 bit ASCII code. Write HDL code and simulate.