- function valid_char (x : std_logic_vector(7 downto 0); last : std_logic_vector(7 downto 0)) return boolean is
- variable y : boolean;
- begin
- case x is
- -- nur gueltig wenn davor ein numpad-mod byte gekommen ist
- -- 0 - 4
- when x"30" | x"31" | x"32" | x"33" | x"34" => y := last = x"e0";
- -- 5 - 9
- when x"35" | x"36" | x"37" | x"38" | x"39" => y := last = x"e0";
- -- *, +, -, /
- when x"2a" | x"2b" | x"2d" | x"2f" => y := last = x"e0";
-
- -- immer gueltig
- when x"20" => y := true; -- ' '
- when x"1c" => y := true; -- enter
- when x"0e" => y := true; -- backspace
-
- -- alle anderen zeichen sind immer ungueltig
- when others => y := false;
- end case;
- -- assert(false) report "x: " & integer'image(to_integer(unsigned(x))) & ", last: " & integer'image(to_integer(unsigned(last))) & ", result: " & boolean'image(y);
- return y;
- end function;
-