Re: how to translate statement to logic statement?
You should start thinking of hardware a bit different. For example, in software:
you test cond and depending on its value you execute either doSomething() or doSomethingElse(). In hardware, you basically execute both at the same time and then choose which which answer to propagate and which to ignore.
You may also find it easier to visualize this using gates instead of HDL. A good tool for this is logisim.
When you are first starting out with this stuff, going to the basics is often a good way to go. With practice and experience you will quickly get to the point where these things are pretty obvious.
The basics in digital logic comes down to truth tables (for combinatorial logic) and state diagrams (for sequential logic).
For this problem, set up a truth table for each possible value of your inputs and the corresponding output.
a b out
0 0 0
0 1 0
1 0 0
1 1 1
Now loot at your available logic gates and see if you can produce that output using just those gates. I'm guessing at the point you are doing this you only have the Nand gate and the Not gate.
a b out
0 0 1
0 1 1
1 0 1
1 1 0
Now comes the "intuition" part of it. Notice that if you invert the value in the 'out' column for the Nand gate, you get what you are looking for in the 'out' column of the And gate, so running the output of and And gate through a Not gate will yield what you want.
Another way is to think of the names involved -- the names of the gates were not chosen randomly.
Nand = Not And
You should be comfortable with the notion of "double negative" from everyday usage, both in math and in English conversation. In math -(-5) = 5, the two negatives cancel. In conversation saying, "I'm not going to not do something," means that you are going to do something, again the two negatives cancel.
So if we want to get rid of the Not in front of the And in our Nand statement, we simply preceed it with another Not.
And = Not Not And
Since the Not And at the end is a component, we can't break it up, so we surround it by parens to make this explicit.