mr_l
Newbie level 5
Hello!
I need some help with following code.
What types of digital circuits, are these:
I guess it's some type of encoder in the first case and counter in the second one. I try to find more information on the web but I can't.
Any information or clue is welcome.
1. architecture rtl of D2a is
begin
process (X0, X1, X2)
begin
case (X0 & X1 & X2) is
when "100" => z <= '1';
when "010" => z <= '1';
when "001" => z <= '1';
when "101" => z <= '1';
when others => z <= '0';
end case;
end process;
end D2a;
2.entity asc is
generic (CS : integer := 8)
port (k, ars, srs, e, u: in std_logic;
r: buffer std_logic_vector(Cs-1 downto 0));
end asc;
architecture arch of asc is
begin
p1: process (ars, k) begin
if ars = ‘1’ then
r <= (others => ‘0’);
elsif (k’event and k=’1’) then
if srs=’1’ then
r <= (others) => ‘0’);
elsif (e = ‘1’ and u = ‘1’) then
r <= r + 1;
elsif (e = ‘1’ and u = ‘0’) then
r <= r - 1;
else
r <= r;
end if;
end if;
end process;
end arch;
I need some help with following code.
What types of digital circuits, are these:
I guess it's some type of encoder in the first case and counter in the second one. I try to find more information on the web but I can't.
Any information or clue is welcome.
1. architecture rtl of D2a is
begin
process (X0, X1, X2)
begin
case (X0 & X1 & X2) is
when "100" => z <= '1';
when "010" => z <= '1';
when "001" => z <= '1';
when "101" => z <= '1';
when others => z <= '0';
end case;
end process;
end D2a;
2.entity asc is
generic (CS : integer := 8)
port (k, ars, srs, e, u: in std_logic;
r: buffer std_logic_vector(Cs-1 downto 0));
end asc;
architecture arch of asc is
begin
p1: process (ars, k) begin
if ars = ‘1’ then
r <= (others => ‘0’);
elsif (k’event and k=’1’) then
if srs=’1’ then
r <= (others) => ‘0’);
elsif (e = ‘1’ and u = ‘1’) then
r <= r + 1;
elsif (e = ‘1’ and u = ‘0’) then
r <= r - 1;
else
r <= r;
end if;
end if;
end process;
end arch;