Professional Documents
Culture Documents
Logic Design - VHDL Behavioral, Dataflow and Structural Models - Steemit PDF
Logic Design - VHDL Behavioral, Dataflow and Structural Models - Steemit PDF
com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search.html) (/submit.html)
Hello my friends! Today we will get into the differences between the
Different Descriptions/Models that we can write a Circuit. I will rst
explain what Behavioral, Data ow and Structural need to be implemented
in VHDL Code and then we will get into some Example Circuits that we will
write inTrending New
all 3 ways for you Login
Hot(/login.html)
to see the difference! Promoted
So, let's Sign
get up
started!
(/) (/trending/vhdl) (/created/vhdl) (https://signup.steemit.com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search html) (/submit html)
(/) (/trending/vhdl) (/created/vhdl) (https://signup.steemit.com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search.html) (/submit.html)
We actually already talked about Behavioral and Data ow before, but for
sake of coverage I will write all 3 so that you can have all in one place!
Also, this time you will understand the difference a little better inside of
the Examples Section.
library ieee;
use ieee.std_logic_1164.all;
entity nand2 is
port(
a, b: in std_logic;
c: out std_logic
Trending New Login
Hot(/login.html)
Promoted
Sign up
(/) (/trending/vhdl) (/created/vhdl) (https://signup.steemit.com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search html) (/submit html)
(/) (/trending/vhdl) (/created/vhdl) (https://signup.steemit.com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search.html) (/submit.html)
);
end nand2;
begin
process(a, b)
begin
c <= '0';
else
c <= '1';
end if;
end process;
end arch;
So, a AND-3 Gate for example looks like this in Data ow:
library ieee;
use ieee.std_logic_1164.all;
entity and3_gate is
port(
a, b, c: in std_logic;
d: out std_logic
begin
end arch;
You can see that we simply assign the Output to the corresponding
Expression that contains the Inputs! Off course this Expression can get
complicated (we will have such a Example in the Example Section) and we
can also have more than one Outputs!
You can see that we use a label, the Component Name and a er that the
Attributes (Input/Output Mapping).
Examples:
To understand the differences a little better, let's write some Circuits in
all 3 Models! I will use 2 Examples. The rst one will contain simple Gating
and 1 Output, and the second will contain even simpler Gating but more
Outputs!
Trending
Example 1: New Login
Hot(/login.html)
Promoted
Sign up
(/) (/trending/vhdl) (/created/vhdl) (https://signup.steemit.com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search html) (/submit html)
(/) (/trending/vhdl) (/created/vhdl) (https://signup.steemit.com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search.html) (/submit.html)
The Circuit looks like this:
Testing out all Input Values I end up with this Truth Table:
Trending
Using those 3 Things weNew
can then writeLogin
Hot(/login.html)
down Promoted
Sign
the 3 Models upthat:
like
(/) (/trending/vhdl) (/created/vhdl) (https://signup.steemit.com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search html) (/submit html)
(/) (/trending/vhdl) (/created/vhdl) (https://signup.steemit.com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search.html) (/submit.html)
Behavioral:
library ieee;
use ieee.std_logic_1164.all;
entity c_behavioral is
port(
A, B, C: in std_logic;
Y: out std_logic
);
end c_behavioral;
begin
process(A, B, C)
begin
Y <= '0';
Y <= '0';
else
Y <= '1';
end if;
end process;
end arch;
Data ow:
library ieee;
use ieee.std_logic_1164.all;
port(
A, B, C: in std_logic;
Y: out std_logic
);
end c_dataflow;
begin
Structural:
You have to write and compile all Components before compiling and
simulating the main Circuit.
Not Gate
library ieee;
use ieee.std_logic_1164.all;
entity not_gate is
port(
a: in std_logic;
b: out std_logic
);
Trending New Login
Hot(/login.html)
Promoted
Sign up
(/) (/trending/vhdl) (/created/vhdl) (https://signup.steemit.com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search html) (/submit html)
(/) (/trending/vhdl) (/created/vhdl) (https://signup.steemit.com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search.html) (/submit.html)
end not_gate;
begin
b <= not a;
end arch;
Or Gate
library ieee;
use ieee.std_logic_1164.all;
entity or2_gate is
port(
a, b: in std_logic;
c: out std_logic
end or2_gate;
begin
c <= a or b;
end arch;
And Gate
library ieee;
use ieee.std_logic_1164.all;
entity and2_gate is
port(
a, b: in std_logic;
);
end and2_gate;
begin
c <= a and b;
end arch;
library ieee;
use ieee.std_logic_1164.all;
entity c_structural is
port(
Y: out std_logic
);
end c_structural;
component not_gate
port(
a: in std_logic;
b: out std_logic
);
end component;
port(
a, b: in std_logic;
c: out std_logic
);
end component;
component and2_gate
port(
a, b: in std_logic;
c: out std_logic
);
end component;
begin
end arch;
You can see that the Code becomes much larger, but we have a much
bigger in uence on the Connections between the Gates/Sub-Circuits and
Trending New Login
Hot(/login.html)
Promoted
Sign up
the whole Layout/Gating of our Circuit in general!
(/) (/trending/vhdl) (/created/vhdl) (https://signup.steemit.com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search html) (/submit html)
(/) (/trending/vhdl) (/created/vhdl) (https://signup.steemit.com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search.html) (/submit.html)
Simulating the Circuits in Modelsim we can see that they do the same
exact thing!
Example 2:
The Truth Table can be found out easily by testing out the 4 Input
Combinations and looks like this:
We don't need K-Map but get the Functions directly more easily and they
look like that:
The 3 Models can be written simply by using all those Things we have on
top!
Trending
Behavioral: New Login
Hot(/login.html)
Promoted
Sign up
(/) (/trending/vhdl) (/created/vhdl) (https://signup.steemit.com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search html) (/submit html)
(/) (/trending/vhdl) (/created/vhdl) (https://signup.steemit.com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search.html) (/submit.html)
This time we will have to use all possible input combinations and can't skip
any if them
library ieee;
use ieee.std_logic_1164.all;
entity f_behavioral is
port(
);
end f_behavioral;
begin
process(A(1), A(0))
begin
Trending New Login
Hot(/login.html)
Promoted
Sign up
(/) (/trending/vhdl) (/created/vhdl) (https://signup.steemit.com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search html) (/submit html)
(/) (/trending/vhdl) (/created/vhdl) (https://signup.steemit.com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search.html) (/submit.html)
if (A(1 downto 0)="00") then
else
end if;
end process;
end arch;
Data ow:
This representation is also not so dif cult and I will again use In-Between
Signals
Trending New Login
Hot(/login.html)
Promoted
Sign up
(/) (/trending/vhdl) (/created/vhdl) (https://signup.steemit.com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search html) (/submit html)
(/) (/trending/vhdl) (/created/vhdl) (https://signup.steemit.com)
(/hot/vhdl) (/promoted/vhdl)
(/static/search.html) (/submit.html)
library ieee;
use ieee.std_logic_1164.all;
entity f_dataflow is
port(
);
end f_dataflow;
begin
end arch;
Structural:
Let's skip the Components, cause we already have them set up and just
write the structural model!
library ieee;
use ieee.std_logic_1164.all;
entity f_structural is
port(
);
end f_structural;
component not_gate
port(
a: in std_logic;
b: out std_logic
);
end component;
component and2_gate
a, b: in std_logic;
c: out std_logic
);
end component;
begin
end arch;
You can see that for this Circuit the Structural Representation was not so
bad and also gives us more control so that we have less signals/cables
inside of our Circuit!
The Results for all those Circuits are again the same and look like this in
Modelsim:
Next time in VHDL we will get into Sequential Circuits that are much
more interesting to simulate and work with in Modelsim!
2 years ago by dri er1 (67) (/@dri er1) $23.46 113 votes 0 (/vhdl/@dri er1/logic-design-vhdl-behavioral-
dataflow-and-structural-models)
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!