Page 1 of 1

#5 Procedural Logic [Post Homework Here]

Posted: Fri Jul 25, 2014 12:49 am
by ThePyroElectro
A new lesson was posted today:
http://www.pyroelectro.com/edu/fpga/procedural_logic/

Post your homework answers here to compare with everyone else!

Re: #5 Procedural Logic [Post Homework Here]

Posted: Sun Jul 27, 2014 2:25 pm
by Bingo600
Hi Chris

Here is my homework

HOMEWORK QUESTION 1
What is the difference between combinatorial logic and procedural logic?

Combinatorial logic always runs.
Procedural logic runs when a signal on the sensitivity list changes.

HOMEWORK QUESTION 2
What is the purpose of using a ‘sensitivity list’ in a procedural logic process?

To "trigger" the procedure.
Meaning that the procedural statements are only executed when one of the signals in the sensitivity list changes.

HOMEWORK QUESTION 3
Using VHDL make a logic element with one clock input and one output. Then use procedural
logic to divide the clock input frequency by 4 and send it to the output.


Code: Select all

library ieee;
use ieee.std_logic_1164.all;

entity lesson5a is
port(
   clk:         in   std_logic; --
   clk_out:      out std_logic --
   );
end lesson5a;

architecture rtl of lesson5a is
signal f2: std_logic;
signal f4: std_logic;

begin
   DIV2: process(clk)
   begin
   if rising_edge(clk) then
      f2 <= not f2;
   end if;
   end process DIV2;
   
   DIV4: process(f2)
   begin
   if rising_edge(f2) then
      f4 <= not f4;
   end if;
   end process DIV4;   
   clk_out <= f4;
end rtl;   


Screenshot-RTL Viewer - -home-cfo-x-altera-pyro-course-lesson5a-lesson5a - lesson5a.png
Screenshot-RTL Viewer - -home-cfo-x-altera-pyro-course-lesson5a-lesson5a - lesson5a.png (44.7 KiB) Viewed 5383 times


/Bingo

Re: #5 Procedural Logic [Post Homework Here]

Posted: Mon Jul 28, 2014 1:38 am
by ThePyroElectro
Bingo600 wrote:Hi Chris

Here is my homework

HOMEWORK QUESTION 1
What is the difference between combinatorial logic and procedural logic?

Combinatorial logic always runs.
Procedural logic runs when a signal on the sensitivity list changes.

HOMEWORK QUESTION 2
What is the purpose of using a ‘sensitivity list’ in a procedural logic process?

To "trigger" the procedure.
Meaning that the procedural statements are only executed when one of the signals in the sensitivity list changes.

...
...
...

/Bingo


Correct answers!

Thanks for showing the RTL viewer image as well. That thing really slams it in your face how two d-flip-flops is all you need.