diff options
author | Benjamin Chausse <benjamin@chausse.xyz> | 2025-05-05 15:52:19 -0400 |
---|---|---|
committer | Benjamin Chausse <benjamin@chausse.xyz> | 2025-05-05 15:52:19 -0400 |
commit | 16757e30a81ca16749b1f8b948013edeaa5f17a1 (patch) | |
tree | 41890744aaeb7426a77f4f70ade2fdc87d845648 /pb_APP_log_comb.srcs/sources_1 | |
parent | bda427e5296a3388da59659c999f7bb1efa49eb3 (diff) |
MUX IS FUCKING DONE!!!!
Diffstat (limited to 'pb_APP_log_comb.srcs/sources_1')
-rw-r--r-- | pb_APP_log_comb.srcs/sources_1/new/Mux.vhd | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/pb_APP_log_comb.srcs/sources_1/new/Mux.vhd b/pb_APP_log_comb.srcs/sources_1/new/Mux.vhd index 0b0c2eb..5e5195a 100644 --- a/pb_APP_log_comb.srcs/sources_1/new/Mux.vhd +++ b/pb_APP_log_comb.srcs/sources_1/new/Mux.vhd @@ -39,7 +39,6 @@ entity Mux is port ( Unite_s : in STD_LOGIC_VECTOR (3 downto 0); BTN : in STD_LOGIC_VECTOR (2 downto 0); erreur : in STD_LOGIC; - S1 : in STD_LOGIC; S2 : in STD_LOGIC; DAFF0 : out STD_LOGIC_VECTOR (3 downto 0); DAFF1 : out STD_LOGIC_VECTOR (3 downto 0)); @@ -49,9 +48,8 @@ architecture Behavioral of Mux is constant pressed : STD_LOGIC := '1'; - constant msg_Err : STD_LOGIC_VECTOR(9 downto 0) := "01110" & "10001"; - -- constant char_neg : STD_LOGIC_VECTOR(4 downto 0) := "10000"; - -- constant char_ndef : STD_LOGIC_VECTOR(4 downto 0) := "10010"; + constant char_E : STD_LOGIC_VECTOR(3 downto 0) := "1110"; -- E + constant char_r : STD_LOGIC_VECTOR(3 downto 0) := "1111"; -- r (for "Er") signal break : BOOLEAN := FALSE; @@ -81,34 +79,34 @@ begin decide : process begin - -- HANDLE SWITCHES {{{ - if S2 = pressed then + -- HANDLE SWITCH {{{ + if ( (S2 = pressed) or (erreur = '1')) then break <= TRUE; -- Avoids double printing on 7seg - unit_input_buf <= msg_Err(9 downto 5); - tens_input_buf <= msg_Err(4 downto 0); - else - if S1 = pressed then - -- TODO: parité paire sur LD0 (Zybo) et DEL2 (carte thermo) - else - -- TODO: parité impaire sur LD0 (Zybo) et DEL2 (carte thermo) - end if; + tens_input_buf <= char_E; + unit_input_buf <= char_r; end if; -- }}} -- HANDLE BUTTONS {{{ if break = FALSE then case (BTN) is when "00" => - -- TODO: BCD sur 7Seg. + unit_input_buf <= Unites_ns; + tens_input_buf <= Dizaines; when "01" => - -- TODO: Hex sur 7Seg. + -- impossible de buster "C" en hex + -- encore moins avoir une deuxième décimale + -- on mets donc les "Dizaines" à zéro + unit_input_buf <= ADCbin; + tens_input_buf <= "0000"; when "10" => - -- TODO: (BCD-5) sur 7Seg. + unit_input_buf <= Unite_s; + tens_input_buf <= Code_signe; when "11" => - unit_input_buf <= msg_Err(9 downto 5); - tens_input_buf <= msg_Err(4 downto 0); + tens_input_buf <= char_E; + unit_input_buf <= char_r; when others => - unit_input_buf <= msg_Err(9 downto 5); - tens_input_buf <= msg_Err(4 downto 0); + tens_input_buf <= char_E; + unit_input_buf <= char_r; end case; end if; -- }}} |