-
Thread
latch bei synthese mit bedingter zuweisung
takt: std_logic; begin process(clk, reset) begin if( reset = '1') then r_reg <= (others => '0'); elsif rising_edge(clk) then r_reg <= r_next; end if; end process; r_next <= r_reg +1; q <= std_logic_vector(r_reg); takt <= not takt when r_reg=(2**N-1) else
r_next <= r_reg +1; q <= std_logic_vector(r_reg); -- flag erzeugen flag <= '1' when r_reg=(2**N-1) else '0'; max_tick <= takt; end arch; [/vhdl] lg Mchii
-
Thread
Frage zu VHDL Code für Up-Down Counter
begin --register process(count,reset) begin if(reset='1')then r_reg <= (others=>'0'); elsif(count'event and count = '1')then r_reg <= r_next; end if; end process; --next state logic r_next <= r_reg+1 when updown = '1' else r_next <= r_reg-1 when
richtigerweise aussehen (wenn updown nur '1' oder '0' sein kann)? Doch etwa so: [vhdl] r_next <= r_reg+1 when updown='1' else r_reg-1; [/vhdl] BTW: warum zählst du nicht direkt im getakteten Teil? [vhdl] process(count,reset) begin if(reset='1')then r_reg <= (others=>'0');
-
Thread
Countdown Zähler mit Abbruchbedingung, Initialisierungsproblem
counter_p : process (CLK,RST_N,EN,D) variable zeros : std_logic_vector(TAPS downto 0) := (others => '0'); begin if RST_N = '0' then d_int <= (others => '0'); RDY <= '0'; elsif (CLK='1' and CLK'event) then d_int <= D;-- Latch ? if (EN = '1') then if ( d_int = zeros) then
: std_logic_vector(TAPS downto 0); constant zeros : std_logic_vector(TAPS downto 0) := (others => '0'); begin RDY <= '1' when d_int = zeros else '0'; -- Kombinatorik für Zähler counter_comb_p : process(D, EN, d_int) begin -- process counter_comb_p if (EN = '1') and
-
Thread
[VHDL] FSM springt in states ohne trigger
tmp_test_led3 <= '0'; when others => -- ERROR-STATE end case; -- ready_state when SENDING_ADDRESS_BITS => if(push_button2 = '1') then
tmp_test_led2 <= '1'; tmp_test_led3 <= '0'; when others => -- It should not occur to come into this state here. sig_state <= IDLE; SDI <= '0';
-
Thread
finite state machine
new_state <= IDLE; end if; when others => new_state <= IDLE; end case; end process -- Zustandsspeicher process(reset, clk, new_state) begin if reset = '1' then state <= IDLE; elsif clk = '1' and clk'event
end if; end process; -- Ausgabe-Logik process(state, start) begin case state is when IDLE => if start = '1' then d_out <= DATA1; end if; when B1 => d_out <= DATA2; when others => null; end case; end process;
-
Thread
Implementierung Bytes Demultiplexer
USE ieee.numeric_std.ALL; ... PROCESS(clk,reset) BEGIN IF reset='1' THEN gpo <= (others => '0'); wb_ack_o <= '0'; tvor <= (others => '0'); ELSIF rising_edge(clk) THEN IF wb_stb_i='1' THEN --Hier müssten die Zuweisungen gem Adresse rein case to_integer(unsigned(w_adr_i)) is when 0 => tvor (7 downto 0) <= wb_dat_i; when 1 => tvor (15 downto 8) <= wb_dat_i; when 2 => tvor (23 downto 16) <= wb_dat_i; when 3 => tvor (31 downto 24) <= wb_dat_i; when OTHERS
-
Thread
4-Bit-Register in VHDL
strukturierter. Duke Scarring schrieb im Beitrag #5873259: > if CLR = '1' then > Q <= (others => '1'); Auf die Gefahr hin, dass meine Frage dumm erscheint … … bitte was genau bedeutet: Q <= (others => '1'); Der rest ist sonnenklar, aber diese Zeile … ??? Eine Zuweisung zu
ausschweifend? Das geht doch auch als Einzeiler ohne diese Herumprozessiererei ;-) [vhdl] Q <= (others=>'0') when CLR = '1' else D when rising_edge(CLK) and CE = '1'; [/vhdl]
-
Thread
YCrCB zu RGB, Problem mit VHDL-Mathematik
(27/16)*(unsigned(Cb)-128)); IF(Rv<255)THEN R<=STD_LOGIC_VECTOR(to_unsigned(Rv,8)); ELSE R<=(others=>'1'); END IF; IF(Gv<255)THEN G<=STD_LOGIC_VECTOR(to_unsigned(Gv,8)); ELSE G<=(others=>'1'); END IF; IF(Bv<255)THEN B<=STD_LOGIC_VECTOR(to_unsigned(Bv,8)); ELSE B<=(others=>'1'); END
the modules and compare them. for i in 0 to 2 loop case i is when 0 => temp1 <= a*data; when 1 => temp2 <= temp1*b; when 2 => result <= temp2*c; when others => null; end case; end loop;
-
Thread
VHDL: kurzen Impuls halten, um State Machine zu steuern
if rising_edge(CLKRAM) then statealt <= stateneu; case statealt is when init => cnt <= cnt + 1; when w5 => addr <= std_logic_vector(unsigned(addr) + 1); when idle => cnt <= 0; when others => null; end case; end
end if; when w1 => xx <= xx --zuweisungen stateneu <= w2; when w2 => xx <= xx --zuweisungen stateneu <= w3; when w3 => xx <= xx --zuweisungen
-
Thread
Don't care in VHDL
aus: [c] TickCntrl:process(INSTR_IN(7 downto 0)) begin case INSTR_IN(7 downto 0) is when "1110----"=> pc_tick_int <= '1'; when "000011--"=> pc_tick_int <= '1'; when others => pc_tick_int <= '0'; end case; end process; [/c] Oder wird dieses
ved=0CCwQFjAC&usg=AFQjCNH4LYzoms_9Gw0AhMWlofPR4sa-Sw das sieht dort so aus: >case? sel is > when "1---" => > o <= "11"; > when "01--" => > o <= "10"; > when "001-" => > o <= "01"; > when "0001" => > o <= "00"; > when others => > null; > end case; Wenn es VDHL-2008
-
Thread
Warnung bei Statemachine (Synplify / IspLever)
if falling_edge(sys_clk25M) then if sys_en = '1' then clk_cnt_i <= (others => '0'); smpl_cnt_i <= (others => '0'); neg_cnt_i <= (others => '0'); rlock <= '0'; STATE <= CNT_STATE; elsif sys_en = '0' and all_enable = '1' then case STATE is when CNT_STATE =>.... when SMPL_STATE => .... when NEG_STATE =>.... when RESET_STATE => .... end case; ......... [/vhdl] da ich gerade
-
Thread
VIVADO Simulation
der Simulation sind die LEDs immer auf '1'. Init: signal pwm_zaehler: unsigned(15 downto 0):=(others => '0'); signal sw_tb : std_logic_vector(15 downto 0):=(others => '0'); Auführung: RGB1_Red <= '1' when pwm_zaehler <= unsigned(sw); RGB1_Green <= '1' when pwm_zaehler <= unsigned(sw); RGB1_Blue <= '1' when pwm_zaehler <= unsigned(sw); da zum Zeitpunkt 0 beide Werte 0 sind, sind folglich deine LEDs auf 1
-
Thread
verschiedene Teile von std_Ulogic_vector aus mehreren Processen zuweisen
<= (others=>'1'); elsif rising_edge(clk) then s_data(15 downto 8) <= i_data_byte_high; end if; end process; end architecture rtl; >>>>>>>>>>>>>>>>> Bei mir, mit aktuellem Synplify und
4.2.13 hat was: [vhdl] process (Clk, Clr) begin case To_X01( Clr ) is when '1' => Q <= '0'; QBar <= '1'; when '0' => if rising_edge( Clk ) then -------- na toll !!!!! Q <= D; QBar <= not D; end
-
Thread
VHDL - FSM mit for schleife
end loop; when others => null; end case ; [/vhdl] Man könnte das ganze einfach von Hand entrollen, dann sollte (verkürzt) sowas bei rauskommen: [vhdl] case( v.state ) is when 0 => read_in
(2,v); v.state := 0; when others => null; end case ; [/vhdl] Wäre toll, wenn mir jemand helfen könnte. (calculate() und read_in() sind paar kombinatorische Dinge)
-
Thread
Problem beim Hochzählen
, "1100100" WHEN "0111", "1100100" WHEN "1000", "1100100" WHEN "1001", "0000000" WHEN OTHERS; end Behavioral; [/vhdl]
, "1110000" WHEN "0111", "1111111" WHEN "1000", "1110011" WHEN "1001", "0000000" WHEN OTHERS; --CNT <= sig_Seg; end Behavioral; [/vhdl]
-
Thread
Lauflicht mit vorgegbenen Clkgen
" =>LED_out <="00100000"; when "00100000" =>LED_out <="01000000"; when "01000000" =>LED_out <="10000000"; when "10000000" =>LED_out <="00000001"; when others => null; end case; end if;
<="00100000"; when"00100000"=>LED_out<="01000000"; when"01000000"=>LED_out<="10000000"; when"10000000"=>LED_out<="00000001"; when others => null; end case; end if; end
-
Thread
Beschreibung eines Srams Fehler in VHDL-Code?
Numeric_Std.html Und wenn dir das zu umständlich ist, dann schreib wenigstens: [vhdl] wait_cnt <= (others =>'0'); [/vhdl]
etwa: [vhdl] sram_data(7 downto 0) <= deinedatenzumram when sram_output_enable_input='1' else (others=>'Z'); [/vhdl] BTW: das hier ist sehr, sehr unglücklich sram_output_enable_input <= '0'; denn ein normaler Mensch denkt, irgenwas sei /aktiv/ oder
-
Thread
Problem: Latches oder unkorrektes Verhalten
ALU_OP : process (A_reg, B_reg, u_instruction) begin CASE u_instruction is when op_lda => alu_out <= A_reg; when op_ldb => alu_out <= A_reg; when op_add => ALU_out <= (A_reg + B_reg); ------------------------------------------
---------------------------------------------------------------------- when others => ALU_Out <= (others => '0'); end CASE; end process ALU_OP; [/vhdl] Die Flags kommen da nicht rein. Z und C kann man einfach so dekodieren [vhdl] Z <=0 when alu_out =0 else
-
Thread
wWarum wird nicht geschoben
0):= (others => '0'); begin Clock_LR: Vorwzhl Port map ( Clk => CLK, Rst => RESET, CTL_DOTO => CTL_TODO, ZClk => CLK_LR ); Process (CLK, RESET) begin
(CLK)) then case state is when idle => byte_count <= 0; bit_count <= 0; trigger_count <= 0; value_count <= 0;
-
Thread
FIFO Implementierung in BlockRAM
ram_type is array (255 downto 0) of STD_LOGIC_VECTOR(15 downto 0); signal RAM : ram_type := (others => (others => '0')); [/vhdl] Gibt es evtl. noch Rückmeldungen zum konzeptionellen Aufbau meines FIFOs? Oder hat gar einer einen VHDL Beispielcode? Über Sinn oder Unsinn möchte ich mich nicht
if reset = '1' then -- sync reset addr_rd <= (others =>'0'); addr_wr <= (others =>'0'); underflow <= '0'; overflow <= '0'; else -- process inputs
-
Thread
VHDL: Zufallswerte für die Initialisierung erzeugen
array_t is array (0 to 2**data_select'length) of integer; constant const_array : array_t := (others => random); begin -- Damit nicht alles wegoptimiert wird data_out <= to_unsigned(const_array(to_integer(data_select)), data_out'length); end architecture; [/vhdl]
Just like other pseudo-random number generators, uniform will generate the same sequence of numbers when called with the same initial seed values. Because of this behavior, you can rerun the testbench and get the same result when using the same seed values." Da in den hier gezeigten Codes die Seeds fest
-
Thread
NAND-Flash Reader mit FTDI-USB
einem FTDI schon mal (möglichst einfach) gelöst? Knulli case FIFOWriteStatus is when FIFO_WR_IDLE => if STA = '0' then FIFOWriteStatus <= FIFO_WAIT_TXE; FIFO_Data <= (others => 'Z'); ByteCNT <= (others => '0'); end if; when FIFO_WAIT_TXE => if TXE = '0' then FIFOWriteStatus <= FIFO_WR_DATA; end
-
Thread
Timing Simulation Quartus+ModelSim mit Testbench - Signale gehen in unbesimmten Zusand
reset) begin if reset = '1' then currentstate <= resetSTATE; frame_addr <= (others => '0'); failure <= "000"; elsif rising_edge(clk) then case currentstate is when resetSTATE => -- alle Signales werden resettet-spar ich an der Stelle
<= '0'; currentCYCO <= execCYCO; end if; when execCYCO => rst_n_cnt <= '1'; if (ctrl_in(2)) = '0' then currentCYCO <= idleCYCO; end if; when others => end case;
-
Thread
Fehler bei Synthese
COMB:process(zustand,counter) begin case zustand is when S0 => folge<=S1; a<='0'; when S1 => if counter< 7 then folge<=S0; a<='0'; else folge<=S2; a<='0'; end if; when S2 => folge<=S0; a<='1'; end case; end process COMB; [/vhdl] MFG
-
Thread
Using the 7-segment Displays/ 7 Segment Anzeige
" => a <= '1'; b <= '1'; c <= '1'; d <= '1'; e <= '1'; f <= '1'; g <= '1'; when "1001" => a <= '1'; b <= '1'; c <= '1'; d <= '1'; e <= '0'; f <= '1'; g <= '1'; when others => a <= '0'; b <= '0'; c <= '0'; d <= '0'; e <= '0'; f <= '0'; g <= '1'; END case;
" => a <= '1'; b <= '1'; c <= '1'; d <= '1'; e <= '1'; f <= '1'; g <= '1'; when "1001" => a <= '1'; b <= '1'; c <= '1'; d <= '1'; e <= '0'; f <= '1'; g <= '1'; when others => a <= '0'; b <= '0'; c <= '0'; d <= '0'; e <= '0'; f <= '0'; g <= '1'; END case;
-
Thread
Komplexe Pipeline mit AXI-Stream: Ready-Signal kombinatorisch?
-- reset definition constant REG_RESET : reg_t := ( fsm => S_0, set0_data => (others => 'U'), set1_data => (others => 'U') ); -- functions function mult(a, b : std_ulogic_vector(DATA_WIDTH - 1 downto 0)) return std_ulogic_vector is begin return std_ulogic_vector
when S_0 => a_ready_o <= b_valid_i; b_ready_o <= a_valid_i; c_data_o <= (others => 'U'); c_valid_o <= '0'; when S_1 => a_ready_o <= b_valid_i;
-
Thread
Hyperram ohne nios 2 ?
SDRAM1; architecture Behavioral of SDRAM1 is signal x : std_logic_vector (3 downto 0) := (others=>'0'); type state_type is (state_decision, state_read, state_write); signal state : state_type; --für Ram signal myAddress : std_logic_vector (9 downto 0) := (others=>'0'); signal
; when others => state <= state_decision; end case; end if; end process; leds <= not x; -- Signal x an LEDs ausgeben end Behavioral; [/
-
Thread
FSM Beschreibung in VHDL (registered, combinatorial)
----------------------- WHEN OTHERS => state <= idle; END CASE; END IF; END PROCESS fsm; [/vhdl] Jetzt finde ich vor allem bei älteren Kollegen immer auch eine kombinatorische Variante, wo alle Signale in einem
--------------------------- WHEN OTHERS => s_state <= idle; END CASE; END PROCESS fsm; sync : PROCESS(CLK, NRES) BEGIN IF (NRES = '0') THEN state <= idle; ELSIF rising_edge(CLK) THEN state
-
Thread
noch keine Angst vor chatGPTs Programmierkünsten
timer_counter <= RED_ON_TIME; when others => next_state <= GREEN_ON; -- Default state end case; end process; -- LED driving logic green_led <= '1' when (current_state
timer_counter <= RED_ON_TIME; when others => next_state <= GREEN_ON; -- Default state end case; end process; -- LED driving logic green_led <= '1' when (current_state
-
Thread
VHDL Anfänger: Problem mit Xilinx9.2
Du brauchst einen default case beim when (when others), da std-logic ausser 0 und 1 auch unbestimmt, hochohmig usw. annehmen kann.
Gast wrote: > Du brauchst einen default case beim when (when others), da std-logic > ausser 0 und 1 auch unbestimmt, hochohmig usw. annehmen kann. Danke, bin auch grad fündig geworden. Aber das erklärt nicht, warum das Programm nicht mit bit und bit_vector
-
Thread
LCD 2Zeilige Augabe
end_Addr then address <= address + 1; else address <= (others => '0'); end if; case address is when "00000" => data <= x"68"; when "00001" => data <= x"61"; when "00010" => data <= x"6C"; when "00011" => data <= x"6C"; when "00100" => data <= x"6F"; when others => data <= x"23"; end case; end if; end process; [/vhdl] Schreibt 'Hallo
-
Thread
Automaten(FSM) und die verschiedenen Prozess Modelle
Initialisierung (signal state : state_type := s0;) geht natürlich gar nicht. Und dann habe ich auch kein "when others" in der FSM, weil alle definierten States bereits abgehandelt werden. => Ganz böse!!
<= st3_<name>; end if; when st3_<name> => next_state <= st1_<name>; when others => next_state <= st1_<name>; end case; end process; [/vhdl]
-
Thread
Ecoo-Signal vom PS2 abfangen.
rxtimeout : integer range 0 to 500000 := 0; signal rxregister : std_logic_vector(10 downto 0) := (others=>'1'); signal datasr : std_logic_vector(1 downto 0) := (others=>'1'); signal clksr : std_logic_vector(1 downto 0) := (others=>'1'); type ps2rxstatetype is (idle, receive, ready);
clk rxregister <= datasr(1) & rxregister(10 downto 1); end if; case ps2rxstate is when idle => rxregister <= (others=>'1'); rxactive <= '0'; dataready <= '0'; rxtimeout <= 0; if (datasr(1) = '0' and clksr(1) = '1') then ps2rxstate <= receive;
-
Thread
VHDL: UART State Machine
next_state <= s_tx; when AKN => data_out <= x"55"; next_tx_state <= idle; next_state <= s_tx; when s_tx => next_state <= s_tx; if BUSY = '0
when s_tx_done => if BUSY = '0' then valid_out <= '0'; state <= next_tx_state; end if; when others => state <= idle;
-
Thread
FSM mit taktflankengesteuerten Zustandsübergängen
else state <= Z1; end if; when others => state <= warten; end case; end if; end process; MFG Falk
else state <= Z1; end if; when others => state <= warten; end case; end if; end if; Grüße, Kest
-
Thread
Beschreibung funktioniert nach Synthese nicht
begin if rising_edge(CLK) then case StateMachine is -- Senden when 1 => if NewTransmitACK = '0' then -- Ist der Sender frei? Transmit <= (others => '0'); -- Nachricht pauschal löschen Transmit(7 downto
begin if rising_edge(CLK) then case StateMachine is -- Senden when 0 => if NewTransmitACK = '0' then -- Ist der Sender frei? Transmit <= (others => '0'); -- Nachricht pauschal löschen Transmit(7 downto
-
Thread
Suche max. Bitvektor
rising_edge(CLK); comparison <= (value1 > value2) & (value3 > value4); case comparison is when "00" => result <= value2 > value4; when "01" => result <= value2 > value3; when "10" => result <= value1 > value4; when others => result <= value1 > value3; end case; end Behavioral
process (CLK) comparison <= (value1 > value2) & (value3 > value4); case comparison is when "00" => result <= value2 > value4; when "01" => result <= value2 > value3; when "10" => result <= value1 > value4; when others => result <= value1 > value3; end case; end process;
-
Thread
FSM Implementierung
die Zustände S0 bis S3 explizit > auswerten (Variante 1) oder S0 bis S2 explizit und S3 über ein 'others' > abfangen (Variante 2)? Wenn dein Typ genau mit den Zuständen s0..3 definiert ist, und du alle vier möglichen Zustände in der FSM abfrägst, gibt es keine "anderen" Zustände mehr, die mit "when others" abgefragt werden könnten: http://www.lothar-miller.de/s9y/categories/25-when-others *ABER ACHTUNG* Wie diese FSM mit 4 Zuständen /realisiert/ wird, steht auf einem ganz ANDEREN Blatt, nämlich
-
Thread
Signal multiplexen
sel --Internes Auswahlsignal F_out1<= pin_outA1 when sel='0'else pin_outB1 ; --Modul A F_out2<= pin_outA2 when sel='0'else pin_outB2 ; --Modul B --Eingänge-- pin_inA <= F_in when sel='0' else 'Z'; --Modul A pin_inB <= F_in when
'Z', das geht nur an den Pins direkt, und da nur an > INOUT oder OUT. Wenn, dann auf '0' bzw. (others => '0') bei einem Bus > umschalten. Danke für deine Antwort. Damit ich zwischen beide Eingänge korrekt umschalte wäre dann: --Eingänge-- pin_inA <= F_in when sel='0' else '0';
-
Thread
[VHDL] Status speichern
else STATE <= LED_OFF; end if; end process; with STATE select LED(4) <= '0' when LED_ON, '1' when others; achja benutze Xilinx Webpack 11 Bitte um HILFE :-) Danke Grüße balou
Zähler wait until rising_edge(CLK); if OneSecond='1' then case DIRECTION is when '0' => if (COUNTERX = 63) then -- Überlauf COUNTERX <= 0; else COUNTERX <= COUNTERX + 1; end if; when others => if (COUNTERX = 0) then
-
Thread
Tristate Bus Umschaltzeitpunkt
Das könntest du auch abkürzen und ohne Prozess schreiben: [vhdl] ram_do <= RAM_DB; RAM_DB <= (others => 'Z') when (ram_oe = '0') else ram_di; [/vhdl] Dabei angenommen, do wäre der Eingang ins FPGA und di der Ausgang... :-/ > sollte ich in diese Umschaltung noch jeweils 1 Takt Verzögerung einbauen
rising_edge(CLK) then ram_oe_last <= ram_oe; end if; end process; RAM_OE <= '1' when (ram_oe_last = '1') else ram_oe; RAM_DB <= (others => 'Z') when (ram_oe = '0') or (ram_oe_last = '0') else ram_di; ram_di <= RAM_DB; [/vhdl] (großgeschrieben sind die Ports nach aussen)
-
Thread
Umwandlung Verilog / VHDL, kann man das einfacher machen?
reset : in std_logic := '0'; ReadReg1 : in std_logic_vector(4 downto 0) := (others => '0'); ReadReg2 : in std_logic_vector(4 downto 0) := (others => '0'); WriteReg : in std_logic_vector(4 downto 0) := (others => '0'); WriteData : in std_logic_vector(31 downto
type reg_t is array (0 to 31) of std_logic_vector(31 downto 0); signal registers : reg_t := (others => (others => '0')); begin -- Sequential (clocked) write. -- 'WriteReg' is the register index to write. 'RegWrite' is the command. process (clock) begin if (rising_edge
-
Thread
RAM: warum nicht synthetisierbar?
#6280347: > Die Tristate Geschichte musst du ausserhalb des Prozesses machen. [vhdl]data_q <= data when ce = '1' and rd = '0' and wr = '1' else (others => 'Z');[/vhdl] Da meckert mir das Radiant: [pre] (VHDL-1576) this construct is only supported in VHDL 1076-2008 [/pre] Habe ich nicht ganz
deine Arrays kannst du auch mit der folgenden Zeile Code initialisieren: signal cells: ram_t := (others => ( others => '0') );
-
Thread
Multiplikation mit DSP Block auf Cyclone V
EN2:=EN1; when 3=> IF(Rv<255)THEN R<=STD_LOGIC_VECTOR(to_unsigned(Rv,8)); ELSE R<=(others=>'1'); END IF; DATAVALID<=EN2; when others=> NULL; end case; end loop; [/vhdl] Wie man sieht, ich habe eine Art Pipeline Konstruktion. Das Problem ist jetzt folgendes: manchmal sind die RGB Daten noch nicht bereit, obwohl
-
Thread
SRAM wird nicht gelesen vom DE1
if counter(4) = '0' then sram_io <= "0000000000000111"; else sram_io <= (others => 'Z'); end if; end if; end process; sram_o <= sram_io; end Behavioral; [/vhdl] Danke. Gruss
musst also zwischen lesen und schreiben unterscheiden. Ganz grob: [vhdl] sram_io <= daten_out when lesenschreiben = '0' else (others => 'Z'); daten_in <= sram_io when lesenschreiben = '1'; [/vhdl] daten_out sind std_logic_vector und zwar die Daten die geschrieben werden sollen, daten_in ist
-
Thread
Multiplexer - Problem
Passend zu deinem ersten Ansatz: [vhdl] data3 <= data1 when sel = '0' else (others=>'Z'); data2 <= data3 when sel = '1' else (others=>'X'); [/vhdl] Bei data2 wird ein Latch verhindert und in der Simulation sollte es auffallen wenn der Pfad im deselektierten
one_to_two_mux_inout_input is signal data2_i : std_logic_vector(7 downto 0) := "00000000"; begin data3 <= data1 when sel = '0' else "ZZZZZZZZ"; data2 <= data3 when sel = '1' else "ZZZZZZZZ"; end Behavioral; [/vhdl] und synthese funzt super
-
Thread
Frequenzteiler
clock='1' ; count := count+1 ; CASE count IS WHEN 0 => t_clk <= NOT t_clk ; WHEN 2604/2 => t_clk <= NOT t_clk ; WHEN 2604 => count := 0; WHEN OTHERS => NULL ;
clock='1' ; count := count+1 ; CASE count IS WHEN 0 => t_clk <= NOT t_clk ; WHEN 500000/2 => t_clk <= NOT t_clk ; WHEN 500000 => count := 0; WHEN OTHERS => NULL ;
-
Thread
Probleme beim Verbinden der Signale zwischen zwei Modulen
z1:zaehler port map(clk, rst, enable, s); p2:process(s) begin case s is when "0000" => display <= "1111110"; when "0001" => display <= "0110000"; when "0010" => display <= "1101101"; when
when others => display <= "0000001"; end case; end process p2; end bevofsegment; -------------------------------------------------------------------------- ----
-
Thread
Binär Dividierer: Restoring Methode
y; two_r <= r&'0'; dif <= two_r - long_y; WITH dif(n) SELECT next_r <= dif(n-1 DOWNTO 0) WHEN '0', two_r(n-1 DOWNTO 0) WHEN OTHERS; remainder_register: PROCESS(clk) BEGIN IF clk'EVENT AND clk = '1' THEN IF load = '1' THEN r <= x; ELSIF update = '1' THEN r <= next_r
current_state <= 0; ELSIF clk'EVENT AND clk = '1' THEN CASE current_state IS WHEN 0 => IF start = '0' THEN current_state <= 1; END IF; WHEN 1 => IF start = '1' THEN current_state <= 2; END IF; WHEN 2 => current_state <= 3; WHEN 3 => IF count = p-1 THEN
-
Thread
64-Bit breites Datenwort via NIOS II auf Avalon schreiben?
data_buffer_nxt <= data_buffer; data_valid_nxt <= data_valid; state_nxt <= state; case state is when INIT => avs_s0_waitrequest <= '0'; state_nxt <= IDLE; when IDLE => if (avs_s0_write = '1') then if (avs_s0_address = 0x"01000000") then avs_s0_waitrequest <= '1'; state_nxt <= READ; end if; end if; when READ => avs_s0_waitrequest <= '1'; data_buffer_nxt <= avs_s0_writedata; state_nxt <= READ_WAIT; when READ_WAIT => avs_s0_waitrequest <= '0'; state_nxt <= IDLE