#5 Procedural Logic [Post Homework Here]

Talk about the fifth PyroEDU course here.
ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

#5 Procedural Logic [Post Homework Here]

Postby ThePyroElectro » Fri Jul 25, 2014 12:49 am

A new lesson was posted today:
http://www.pyroelectro.com/edu/fpga/procedural_logic/

Post your homework answers here to compare with everyone else!

Bingo600
Newbie Pyro
Posts: 75
Joined: Sat Jun 28, 2014 7:22 am

Re: #5 Procedural Logic [Post Homework Here]

Postby Bingo600 » Sun Jul 27, 2014 2:25 pm

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 5382 times


/Bingo

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Re: #5 Procedural Logic [Post Homework Here]

Postby ThePyroElectro » Mon Jul 28, 2014 1:38 am

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.


Return to “Introduction to CPLD and FPGA”

Who is online

Users browsing this forum: No registered users and 0 guests