































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of various sequential statements in vhdl, including if-statements, case-statements, loops (infinite, while, for), and assertions. It includes examples and explanations of their syntax and usage.
Typology: Slides
1 / 39
This page cannot be seen from the preview
Don't miss anything!
































entity thermostat is port ( desired_temp, actual_temp : in integer; heater_on : out boolean ); end entity thermostat;
architecture example of thermostat is begin
controller : process (desired_temp, actual_temp) is begin if actual_temp < desired_temp - 2 then heater_on <= true; elsif actual_temp > desired_temp + 2 then heater_on <= false; end if; end process controller;
end architecture example; Docsity.com
library ieee; use ieee.std_logic_1164.all;
entity mux4 is
port ( sel : in sel_range; d0, d1, d2, d3 : in std_ulogic; z : out std_ulogic );
end entity mux4;
architecture demo of mux4 is
begin
out_select : process (sel, d0, d1, d2, d3) is begin case sel is when 0 => z <= d0; when 1 => z <= d1; when 2 => z <= d2; when 3 => z <= d3; end case; end process out_select;
end architecture demo; Docsity.com
entity counter is
port ( clk : in bit; count : out natural );
end entity counter;
architecture behavior of counter is
begin
incrementer : process is variable count_value : natural := 0; begin count <= count_value; loop wait until clk = '1'; count_value := (count_value + 1) mod 16; count <= count_value; end loop; end process incrementer;
end architecture behavior; Docsity.com
LoopName: loop … exit LoopName; … end loop;
loop
… exit ; -- jumps out of the inner most loop …
end loop;
…… -- exit causes the execution to start from this statement onwards
exit loop1; -- jumps out of loop
-- with label loop
exit when x = 1; -- jumps out of inner
-- most loop when -- condition is true