powerful you have become !
why is the 10 us delay necessary?
First, Keyboard_read is asynchronous, to keep the logic synchronous, you need to synchronize the inputs (by adding a DFF (D Flip Flop))
Better is to put at least 2 DFF on inputs to prevent metastability.
Because, In the process, " Keypad_write <= "0111"; " means that Keypad_write is updated at the end or process and NOT immediately.
So when you read "Keypad_read", your read the state of your keypad when keypad_write is in the state BEFORE "0111".
To read "Keypad_read" with correct Keypad_write, you have to wait the next clock.
Examples are available :
http://www.coe.montana.edu/ee/lameres/courses/eele367_spring13/misc_handouts/chapter_08_notes.pdf http://www.cems.uwe.ac.uk/~ngunton/worksheets/keypad.vhd EDIT:
Some tricks:
PROCESS (clock_50)
BEGIN
If (clock_50'EVENT AND clock_50 = '1' ) THEN
-- it is a count down here
-- produce pulse when reach 0
If (count = 0) THEN -- little better to compare to 0
count<= 500;
pulse_10us <= '1';
ELSE
count <= count -1;
pulse_10us <= '0'
END IF;
END IF;
END PROCESS;
Usually, you miss the last ELSE statement in IF...THEN...ELSIF...ELSE....END IF;
This missing can produce
lacthes or combinatory loops which are very bad.