Question

what is the essential difference between elsif and Else if? In VHDL

what is the essential difference between elsif and Else if?

In VHDL

Homework Answers

Answer #1

In VHDL every "if < condition> is followed by statement(s) which are executed in case of TRUE condition and "else" following statements are executed for FALSE condition.

Now to differentiate between elsif and else if let us take example as below:

P1: process(clk, rst)

begin

if (rst = '1') then

output <= '0';

else if rising_edge (clk) then

statement 1;

statement 2;

end if;

end if;

end process;

HERE in above process P1: statement 1 & 2 will be only executed only when rst is not 1.

------------------------------------------------------------------------------------------------------------------------

P2: process(clk, rst)

begin

if (rst = '1') then

output <= '0';

elsif rising_edge (clk) then

statement 1;

statement 2;

end if;

end if;

end process;

In the above process P2, statement 1 & 2 will get executed without checking condition of rst signal

HENCE WE CAN SAY ELSIF CLOSES THE PREVIOUS IF BLOCK AND OPENS ANOTHER IF BLOCK.

BUT ELSE IF OPENS A IF BLOCK WITHOUT CLOSING PREVIOUS IF BLOCK. ITS A NESTED IF STATEMENT type.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
what is the essential difference between asynchronous and synchronous signals? 
what is the essential difference between asynchronous and synchronous signals? 
Explain the difference between non-essential modifiers and essential modifiers in ICD10. How do you immediately recognize...
Explain the difference between non-essential modifiers and essential modifiers in ICD10. How do you immediately recognize a non-essential modifier?
VIVA QUESTIONS: 1. Implement the following function using VHDL coding. (Try to minimize if you can)....
VIVA QUESTIONS: 1. Implement the following function using VHDL coding. (Try to minimize if you can). F(A,B,C,D)=(A'+B+C). (A+B'+D'). (B+C'+D') . (A+B+C+D) 2. What will be the no. of rows in the truth table of N variables? 3. What are the advantages of VHDL? 4. Design Ex-OR gate using behavioral model? 5. Implement the following function using VHDL code f=AB+CD. 6. What are the differences between half adder and full adder? 7. What are the advantages of minimizing the logical expressions?...
True or False: All else being equal, the variance of the difference in means for paired...
True or False: All else being equal, the variance of the difference in means for paired data will be LARGER than the variance of the difference in means for unpaired data if there is a positive covariance between the pairs. A. True B. False
In the receiver VHDL code, what is the purpose of the statement:             elsif (Din =...
In the receiver VHDL code, what is the purpose of the statement:             elsif (Din = ‘1’) then timer <= 0     ? i.e. where does the ‘1’ in Din come from when a message is arriving?
1)What is the difference between a SYMLINK and a HARDLINK? 2) What is the difference between...
1)What is the difference between a SYMLINK and a HARDLINK? 2) What is the difference between a DAEMON and a SERVICE? 3) What is the difference between a DAEMON and a PROCESS?
What is the difference between an independent and a dependent t-test? What is the difference between...
What is the difference between an independent and a dependent t-test? What is the difference between a one-tailed and two-tailed test? What is the difference between a t-test and ANOVA?
. What is the difference between hedging and speculating? . What is the difference between “margin”...
. What is the difference between hedging and speculating? . What is the difference between “margin” and “maintenance margin” on a futures contract?
What is the difference between "large particle composite materials" and "dispersion-strengthened composite materials"? Is it related...
What is the difference between "large particle composite materials" and "dispersion-strengthened composite materials"? Is it related to size of reinforcement(dispersion phase) or else?
What is the difference between ”AND” and ”OR”? For example, is there a difference between ”rolling...
What is the difference between ”AND” and ”OR”? For example, is there a difference between ”rolling an Even AND an Odd,” and ”rolling an Even OR an odd.” Explain