Command Decoder?

Joined
Apr 6, 2007
Messages
4
Reaction score
0
Hello all,

I'm a new member and fairly new to VHDL. I have a question and I was hoping someone can help? I'm trying to write a command decoder for a communication protocol. The decoder reads in the last 5 bits of the data line and outputs the corresponding commands based on the defined bits/constants. The problem I have is with the first Signal : PON (Power On Reset). The requirement is that if the local pon message is already asserted, the pon command (once again written) simply has to clear the local pon message. How do I do that?

Here is what I have:

DECODER: PROCESS (I_HRST, I_DIN)

BEGIN

IF (I_HRST = '0') THEN

I_IEPON <= '0';
O_SRST <= '0';
.
.
.
.

ELSE

CASE I_DIN (4 DOWNTO 0) IS

WHEN IEPON_C =>

I_IEPON <= '1';

WHEN SRST_C =>

O_SRST <= '1';
.
.
.
.
.

WHEN OTHERS =>

NULL;

END CASE;

END IF;

END PROCESS; -- DECODER

Any help will be greatly appreciated.
 
Joined
Apr 6, 2007
Messages
4
Reaction score
0
Never mind everyone. I figured it out. I changed my process from Case Statement to If Statements. Then I created a dummy signal I_IEPON so that my dummy signal is readback before it is assigned to the output port. Here it is:

O_IEPON <= I_IEPON;

PROCESS (HRST, I_DIN)

BEGIN

IF (HRST = '0') THEN

I_IEPON <= '0';

ELSIF (I_DIN (4 DOWNTO 0) = "00000") THEN

I_IEPON <= '1' XOR I_IEPON;

ELSE
NULL;
END IF;

END PROCESS;

When I simulate my design it works. On the first demand, it activates IEPON and on the second demand, it deactivates. Now my question is whats the difference? Why it didn't work when using case Statement?

Unity
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top