K
KJ
Guest
"Amit" <amit.kohan@gmail.com> wrote in message
news:1194495166.085775.169570@v23g2000prn.googlegroups.com...
if rising_edge(Clock) then
if (Input_String = "000010000100") then
Led_Display <= Whatever you need to display a '5'
elsif (Input_String = "000010000110") then
Led_Display <= Whatever you need to display a '7'
end if;
end if;
end process;
KJ
news:1194495166.085775.169570@v23g2000prn.googlegroups.com...
Hello group,
I'm writing a code to recognize two strings of 0s and 1s base on a
Moore machine.
Not how I would approach it, but OK.
beginThe goal is to wait for two numbers (let's say 75). One
string will represent 7 and the other represents 5.
Let's say:
5= 000010000100
7= 000010000110
Now, when the appropriate string (digit) is recongnized the number
must be displayed on an LED on Altera board (DE2). I understand that
I have to add a mulitplexer to do this but the thing I am not sure
that how can I keep the number (7) intact till recognizing the next
appropriate number (5)? (other numbers must be ignored)
process(Clock)
if rising_edge(Clock) then
if (Input_String = "000010000100") then
Led_Display <= Whatever you need to display a '5'
elsif (Input_String = "000010000110") then
Led_Display <= Whatever you need to display a '7'
end if;
end if;
end process;
Do I need a latch?
A flip flop(s) to hold the data.
statements.if this is right, then can I only simulate it using
if statement?
Why restrict yourself to only one statement type. Use the appropriate
KJ