1

I'm new to VHDL and I've been trying to finish my combinatorial code in an assignment, however I don't know how to make cases account for specific combinations of the two 1-bit outputs: Permit and ReturnChange. My concern is is with the WHEN statements. Looking at this block, for example, does that WHEN line work?

            WHEN NoBill => Permit <= '0'; ReturnChange <= '0'; 
                IF (Input = "000") THEN NextState <= NoBill;
                ELSIF (Input = "001") THEN NextState <= Rec5;
                ELSIF (Input = "010") THEN NextState <= Rec10;
                ELSIF (Input = "100") THEN NextState <= Rec20;
                END IF;

The ReturnChange <= '0'; part is what I'm unsure about. Because I know that WHEN NoBill => Permit <= '0'; would work. However I needed those if-statements to apply when that combination of Permit and ReturnChange outputs are both 0. I wasn't sure how to include both, so I kind of just guessed the ReturnChange <= '0'; part. If my guess is incorrect, how would I properly do it?

I'm unsure if seeing the entire file or my state diagram would be helpful, but if it can help you understand anything better, just let me know. Thanks in advance!

Eric
  • 117
  • 1
  • 2
  • 12
  • "My concern is is with the WHEN statements. Any suggestions?" This is not a question. What is the actual problem that you are having? Where is your test bench? Please improve your question. See [How to ask a question](https://stackoverflow.com/help/how-to-ask). – JHBonarius Jan 30 '18 at 07:34
  • Sorry I didn't realize how vague my question was. Edited it! – Eric Jan 30 '18 at 07:48
  • Hmm, this is not really an improvement. It's still vague, as you are referring to a number of code statement without explaining what you really want to do. Furthermore, you removed the [mcve]. This sounds like an [XY problem](http://xyproblem.info/) to me. What do you **really** want to accomplish? – JHBonarius Jan 30 '18 at 08:13
  • By the way, the code seems correct. Does it compile? You should test it with a test bench. – JHBonarius Jan 30 '18 at 08:20
  • 1
    You can see what it does in simulation much more easily than asking here. –  Jan 30 '18 at 11:19

0 Answers0