OmegaRazr
Newbie level 3
Hello.
I have a big problem. I have to work on a ATM machine that can store at least 99 data (in this case passwords for 99 different users) and i have no clue on how to do this.
So, i started by attaching a 4X4 Keyboard to the FPGA (Altera DE2), then i programmed it and made it show the input number on the 7 segment display. However, i have no clue on what to do next, i've been thinking about creating 99 passwords that will be pre-defined, so that would be like making 99 different cases for the 99 passwords that will be 4 digits. But, even if it works, makes no sense. The user should be able to set the password so the machine remembers it. I've been thinking about doing a "master password" that will allow the user to generate one password that will be stored somewhere for the machine to read it later, and of course a reset button.
Here is the code for the 4x4 keyboard:
So, the next step would be creating the password mechanism, but i don't know how to do that. Can someone help me? I've asked my teacher and he tells me that i should try reading about sorting mechanisms...well...i did, but i just don't understand how they work and how those mechanisms could help me.
Thanks for your time.
I have a big problem. I have to work on a ATM machine that can store at least 99 data (in this case passwords for 99 different users) and i have no clue on how to do this.
So, i started by attaching a 4X4 Keyboard to the FPGA (Altera DE2), then i programmed it and made it show the input number on the 7 segment display. However, i have no clue on what to do next, i've been thinking about creating 99 passwords that will be pre-defined, so that would be like making 99 different cases for the 99 passwords that will be 4 digits. But, even if it works, makes no sense. The user should be able to set the password so the machine remembers it. I've been thinking about doing a "master password" that will allow the user to generate one password that will be stored somewhere for the machine to read it later, and of course a reset button.
Here is the code for the 4x4 keyboard:
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity teclado is Port ( columnas : in std_logic_vector(3 downto 0); ck : in std_logic; filas : out std_logic_vector(3 downto 0); dato : out std_logic_vector(6 downto 0); pulso : out std_logic); end teclado; architecture Behavioral of teclado is signal cont: std_logic_vector(1 downto 0); signal dec_filas: std_logic_vector(3 downto 0); signal dec_dato: std_logic_vector(6 downto 0); signal c3, c2, c1, c0: std_logic; signal pulsoT: std_logic; begin Process(ck) begin if (ck'event and ck='0') then cont<=cont+1; end if; end process; Process(ck) begin if (ck'event and ck='1') then if (columnas="1000") then c3<='1'; pulsoT <= '1'; elsif(columnas="0100") then c2<='1'; pulsoT <= '1'; elsif(columnas="0010") then c1<='1'; pulsoT <= '1'; elsif (columnas="0001") then c0<='1'; pulsoT <= '1'; elsif(cont = "11" and(c3='1' or c2='1' or c1='1' or c0='1'))then c0<='0'; c1<='0'; c2<='0'; c3<='0'; elsif(cont = "11" and c3='0' and c2='0' and c1='0' and c0='0')then pulsoT <= '0'; end if; end if; end process; process(ck) begin if(ck'event and ck='0')then if (columnas/="0000" and(c0='1' or c1='1' or c2='1' or c3='1') ) then dato<=dec_dato; end if; end if; end process; dec_filas <= "0001" when cont="00" else "0010" when cont="01" else "0100" when cont="10" else "1000" when cont="11" else "0000"; filas<= dec_filas; dec_dato <= "0000001" when dec_filas="0100" and columnas="0001" else --0 "1001111" when dec_filas="1000" and columnas="1000" else --1 "0010010" when dec_filas="0100" and columnas="1000" else --2 "0000110" when dec_filas="0010" and columnas="1000" else --3 "1001100" when dec_filas="1000" and columnas="0100" else --4 "0100100" when dec_filas="0100" and columnas="0100" else --5 "1100000" when dec_filas="0010" and columnas="0100" else --6 "0001111" when dec_filas="1000" and columnas="0010" else --7 "0000000" when dec_filas="0100" and columnas="0010" else --8 "0001100" when dec_filas="0010" and columnas="0010" else --9 "0111111" when dec_filas="0001" and columnas="1000" else --A "1011111" when dec_filas="0001" and columnas="0100" else --B "1101111" when dec_filas="0001" and columnas="0010" else --C "1110111" when dec_filas="0001" and columnas="0001" else --D "1111011" when dec_filas="0010" and columnas="0001" else --# "1111101" when dec_filas="1000" and columnas="0001" else --* "0000000"; pulso<= pulsoT; End Behavioral;
So, the next step would be creating the password mechanism, but i don't know how to do that. Can someone help me? I've asked my teacher and he tells me that i should try reading about sorting mechanisms...well...i did, but i just don't understand how they work and how those mechanisms could help me.
Thanks for your time.
Last edited by a moderator: