; when x"03" => digital_o_reg <= as_writedata; when others => null; end case; end if; -------------------------------------------------------------------------
as_read; if as_chipselect = '1' and as_read = '1' then case as_address is when x"00" => reg_readdata <= Input_register(31 downto 0); when x"01" => reg_readdata <= digital_i_reg; when x"02" => reg_readdata(15 downto 0) <= cBOARD_REVISION; when
: process (sclk_in, nreset) begin if nreset='0' then state_reg <= idle; right_reg <= (0 => '1', others => '0'); left_reg <= (0 => '1', others => '0'); ready <= '0'; else if rising_edge(sclk_in) then state_reg <= state_reg; case state_reg is when idle => ready <= '0'; if falling_edge(lrck_in) then state_reg
end if; end process; process (state) begin followingstate <= state; case state is when 1 => ... when 2 => ... ... when others => ... end case; end process; Vielleicht kann mir ja jemand weiterhelfen und sagen was ich falsch mache! Vielen Dank im Voraus Andi
= '1') then state <= "00000"; elsif (rising_edge(clk)) then case state is when "00000" => ... state <= "0001"; when "00001" => ... state <= ... when others => ... state <= ... end case;
else RD_EN_A <= '0'; RD_EN_B <= '0'; PDATA <= (others => 'Z'); end if; -- WARTE when WARTE => if (PCS1 = '0' and POEn = '0' and PRnW = '1') then RD_EN_A <= '0'; RD_EN_B <= '
auch wirklich wartest. derzeit machst du eigentlich das selbe wie in LESEN... [vhdl] when WARTE => RD_EN_A <= '0'; RD_EN_B <= '0'; PDATA <= (others => 'Z'); if (PCS1 = '1') then -- deselektiert -> bereit für nächsten Lesezugriff
w_ptr_reg; r_ptr_next <= r_ptr_reg; full_next <= full_reg; empty_next <= empty_reg; case wr_op is when "00" => -- no op when "01" => -- read if (empty_reg /= '1') then -- not empty r_ptr_next <= r_ptr_succ; full_next <= '0'; if (r_ptr_succ=w_ptr_reg) then empty_next <='1'; end if; end if; when "10" =
Bsp.: CASE p1 IS WHEN "00000" => y <= '0'; WHEN "10000" => IF x >= z THEN y <= '1'; ELSE y <= '0'; END IF; WHEN OTHERS => y <= '0'; END CASE; Bsp.1: CASE p1 IS WHEN "00000" => y <= '0'; WHEN "10000" => IF x >= z THEN y <= '1'; ELSE y <= '0'; END IF; WHEN OTHERS => y <= '0'; END CASE; Bsp.2: y <= '0' CASE p1 IS WHEN "00000" => NULL; WHEN "10000" => IF x >= z THEN y <= '1'; END IF; WHEN OTHERS => NULL; END CASE;
green <= "0000"; blue <= "0000"; case zeilenpuffer1(signCounter) is when 0 => if ascii_a(bm_pixelCounter, bm_lineCounter) = '1' then green <= "1111"; else green <= "0000"; end if; when 1 => green <= "0000"; when OTHERS => green <= "0000"; end case; else red <= "0000"; green <= "0000"; blue <= "0000"; end if; ------------------------------------------------ end if;
10": And, "11": Or process (iALUControl,iSrcA, iSrcB) begin case iALUControl is when "00" => -- A + B addBV(iSrcA, iSrcB, Result); when "01" => -- A - B bzw. (A + (-B)) --subBV(iSrcA, iSrcB, Result); when "10" => -- A AND B Result <= iSrcA and iSrcB; when "11" => -- A OR B Result <= iSrcA or iSrcB; when others => Result <= (others => '0'); end case; end process; Output: process (Result) begin oALUResult
ZERO) then -- if no CS for CPLD active, set Databus to high Z DATA <= (others =>'Z'); elsif (nRD'EVENT and nRD='0') then case CS is when (SHIFT_PATTERN sll START_CS_NR) => DATA <= CONV_STD_LOGIC_VECTOR(CPLD_VER, 8);--CPLD version register when (SHIFT_PATTERN sll (START_CS_NR +1))=> DATA <= CONV_STD_LOGIC_VECTOR(HW_VER, 8);--HW version register when (SHIFT_PATTERN sll (START_CS_NR +2))=> DATA <= CONV_STD_LOGIC_VECTOR(HW_TYPE, 8);--HW type register when others => DATA <= (others =>'Z'); end case; end if; end process; end BEHAVIOR;
CS2 SRAM 011 CS_Latch <= "011"; if AVR_AH(7 downto 2) = "000001" then case AVR_AH(1 downto 0) is when "01" => CS_Latch <= "111"; when "10" => CS_Latch <= "110"; when "11" => CS_Latch <= "101"; when others => NULL; end case; end if; end if; end process; process(AVR_WR, AVR_RD, AVR_AD, CS_Latch, Bank_Register
getaktet. process begin wait until rising_edge(clk); -- spart die Sensitivity-List case (state) is when st0_idle => if (num1 /= (others=>'0') ) then state <= st0_idle; end if; when st1_calc1 => mu1_a <= num1; mu1_b <= num2; state <= st2_calc2; when st2_calc2 => result12 <= mu1_product; state <= st3_calc3; when st3_calc3 => mu1_a <= num3; mu1_b <= num4; state <= st4_calc4; when st4_calc4 => result34 <= mu1_product; state <= st5_calc5; when st5_calc5 => result <= result12 + result34; state <= st0_idle; end
clk_register) then if (reset_n_in = '0') then pia_crb2 <= '0'; pia_ddrb <= (others => '0'); pia_portb <= (others => '0'); else if (rw = '0') then case adr is when x"D301" => if (pia_crb2 = '0') then
data_in; else pia_portb <= data_in; end if; when x"D303" => pia_crb2 <= data_in(2); when others => null; end case; end if; end if; end if; -- simulate pull-ups on inputs (ddrb is set to
port map (not a, b, '1', nicht_a_minus_b (n-1 downto 0), nicht_a_minus_b (n)); with s select z1 <= (others => '0') when "0000", '0' & a when "0001", '0' & b when "0010", a_negativ when "0011", b_negativ when "0100", '0' & (not a) when "0101", '0' & (not b) when "0110", a_plus_b when "0111", a_minus_b when "1000", b_minus_a when "1001", nicht_a_minus_b when "1010", '0' & (a or b) when "1011", '0' & (a and b) when "1100", '0' & (a xor b) when "1101", '0' & (not (a xor b)) when "1110", (others => '1') when others; cout <= z1(
S15 => count <= "1111"; if ain = '1' then yout <= '1'; else yout <= '0'; end if; when others => count <= "0000"; end case; end process; next_state_decode : process(state, ain) begin case(state) is when S0 => if ain = '1' then next_state <= S1; else next_state <= state; end if; when S1
; end if; when wait_for_falling => if (V_Sync_VideoIn = '0') then state_Set_WrAddrOffset <= wait_for_rising; end if; when others => state_Set_WrAddrOffset <= wait_for_rising; end case; end if; end process; -- Count
idle; signal dly : integer range 0 to 15 := 0; signal start_sr : std_logic_vector (3 downto 0) := (others=>'0'); signal result : std_logic_vector (3 downto 0) := (others=>'0'); begin -- Startknopf eintakten start_sr <= start_sr(2 downto 0)&START when rising_edge(CLK); process begin wait until rising_edge
push2, push3); signal state : state_type := idle; signal counter : unsigned(8 downto 0) := (others => '0'); begin process begin wait until rising_edge(clk); case state is when idle => counter <= (others => '0'); if push(0) = '1' then state <= push0;
; end if; when push3 => counter <= counter + 1; cfg <= config4rom(to_integer(counter(8 downto 1))); cfgclk <= counter(0); if counter(8 downto 1) = 145 then state <=
Anbindung einer 8 Bit CPU an den 16 Bit SRAM auf dem DE1: [vhdl] RAM_D <= SRAM_DQ(7 downto 0) when A(0)='0' else SRAM_DQ(15 downto 8); SRAM_DQ(7 downto 0) <= CPU_DO when WR_n='0' and RAM_CS_n='0' else (others => 'Z'); SRAM_DQ(15 downto 8) <= CPU_DO when WR_n='0' and RAM_CS_n='0' else (others => 'Z'); SRAM_UB_N <= not A(0); SRAM_LB_N <= A(0); SRAM_ADDR(13 downto 0) <= A(14 downto 1); [/vhdl]
HCounter : process (clk25, reset) begin if reset = '1' then horizontal_counter <= (others => '0'); elsif clk25'event and clk25 = '1' then if EndOfLine = '1' then horizontal_counter <= (others => '0'); else horizontal_counter <= horizontal_counter + 1; end if; end if; end process HCounter; EndOfLine <= '1' when horizontal_counter = HTOTAL - 1 else '0'; VCounter: process (clk25, reset) begin if reset = '1' then vertical_counter <= (others => '0'); elsif clk25'event and clk25 = '1' then
a <= '0' & unsigned(x); -- b <= '0' & unsigned(y); -- c <= a + b; -- carry <= c(c'high) when enable = '1' else '-'; -- z <= std_logic_vector(c(n-1 downto 0)) when enable = '1' else (others => '-'); end Behavioral; [/vhdl]
if enable = '1' then c <= '0' & unsigned(x) + '0' & unsigned(y); else c <= (others=>'0'); end if; end process; : [/vhdl] Das gibt zum guten Ende dann "nur" Kombinatorik. Und sowas >> carry <= c(c'high) when enable = '1' else '-'; '-', 'h', 'l', 'x'... kann die
; tick_counter <= (others=>'0'); tx<='0'; end if; if tick_counter=tick then tick_counter <= (others=>'0'); case state is when start => state <= data0; tx<=data_in(0); when data0 => state <= data1; tx<=data_in(1); when data1
,GREEN,BLUE,MUL_VAL); ENABLE<=MUL_VAL; IF(BT656_VIDEN='1')THEN CASE STATE IS WHEN GETCB=> MUL_EN<='0'; CB<=BT656_DATA; STATE<=GETY; STATE_FLAG<='1'; WHEN GETCR=> MUL_EN<='0'; STATE<=GETY; CR<=BT656
,GREEN,BLUE,MUL_VAL); ENABLE<=MUL_VAL; IF(BT656_VIDEN='1')THEN CASE STATE IS WHEN GETCB=> MUL_EN<='0'; CB<=BT656_DATA; STATE<=GETY; STATE_FLAG<='1'; WHEN GETCR=> MUL_EN<='0'; STATE<=GETY; CR<=BT656
Sel, CIn, Oa, Ob) Variable TempAdd : std_logic_vector(32 downto 0); begin --Default Werte = Y <= (Others => '0'); COut <= '0'; TempAdd := (Others => '0'); Z <= '0'; case Sel is when "0000" => Y <= Ob; when "0001" => TempAdd := Oa + Ob + CIn; Y <= TempAdd(31 downto 0); COut <= TempAdd(32); if TempAdd(31
std_logic_vector(31 downto 0); begin process(clk,enable,reset,switches,count) begin case switches is when "0001" => q <= count(7 downto 0); when "0010" => q <= count(15 downto 8); when "0100" => q <= count(23 downto 16); when "1000" => q <= count(31 downto 24); when others => q <= (others => 'Z'); --Tristate end case; if reset = '1' then --Asynchroner Reset q <= (others => '0'); count <= (others => '0'); elsif rising_edge(clk) then if enable = '0' then --Synchroner Zähler mit enable count <= count +1; end if; end if; end process; end Behavioral;
end process anode_selector; segment_mux : process begin wait until rising_edge(clk); anodes <= (others=>'0'); anodes(anode_cnt) <= '1'; case anode_cnt is when 0 => bcd_val<=dat(3 downto 0); when 1 => bcd_val<=dat(7 downto 4); when 2 => bcd_val<=dat(11 downto 8); when 3 => bcd_val<=dat(15 downto 12);
y_int := conv_integer(a(4)); when "101" => y_int := conv_integer(a(5)); when "110" => y_int := conv_integer(a(6)); when "111" => y_int := conv_integer(a(7)); when others => null; end case; y <= y_int; end
y <= a(to_integer(unsigned(sel)); [/vhdl] BTW: [vhdl] when others => null; [/vhdl] Das gibt in der Simulation ein Latch. In der Hardware ist es zum Glück egal, denn da gibt es nur '0' und '1' in einer Abfrage... BTW2: wozu der unnötige Umweg über y_int
"1111101" when 6, -- 6 "0000111" when 7, -- 7 "1111111" when 8, -- 8 "1101111" when 9, -- 9 "1000000" when 10, -- KP+ "0110111" when 11, -- Enter "0111001" when 12, -- C "1111001" when 13, -- E "0000001" when others; --X -- PS2 Keyboard Scanner C1 : PS2_reader port map (mclk=>mclk, PS2C=>PS2C, PS2D=>PS2D, rst=>rst, Ps2Dout
; else state <= idle; end if; end if; when repeat => if (necsr = "11") then -- warten auf 1 --> erstes Bit cnt <= 0; if (cnt>rptlen) then -- Neue Übertragung state <= rx; bits <= (0=>'1', others=>'0'); else Repeated <= '1'; -- wiederholte Übertragung
p_divide_sys_clk : PROCESS (NRES, CLK) BEGIN IF NRES = '0' THEN sys_clk_cnt <= (OTHERS => '0'); sys_clk_divide <= '0'; ELSIF rising_edge(CLK) THEN sys_clk_cnt <= sys_clk_cnt + 1; CASE FREQ_DIVIDE IS WHEN "11" => sys_clk_divide <= sys_clk_cnt(3); -- divide by 16 WHEN "10" => sys_clk_divide <= sys_clk_cnt(2); -- divide by 8 WHEN "01" => sys_clk_divide <= sys_clk_cnt(1); -- divide by 4 WHEN OTHERS => sys_clk_divide <= sys_clk_cnt(0); -- divide
std_logic_vector (4 downto 0); begin if (DIR='1') then -- construction of a look-up-table for the next state when counting up case count is when "1001" => next_state<="0000"; when others => next_state<=count+1; end case; end if; if (DIR='0') then -- construction of a look-up-table for the next state when counting
THEN --reset system busy <= '1'; --set busy signal ss_n <= (OTHERS => '1'); --deassert all slave select lines mosi <= 'Z'; --set master out to high impedance rx_data <= (OTHERS => '0'); --clear receive data port state <= ready; --go to ready state when reset is exited ELSIF(clock'EVENT AND clock = '1') THEN CASE state IS --state machine WHEN ready => busy <= '0'; --clock out not busy signal
signal read_bit :STD_LOGIC :='0'; begin P1:process(ASI_ASIC_IN_DUTY) begin case ASI_ASIC_IN_DUTY is when "01" => duty_cycle <=3300; when "10" => duty_cycle <=6600; when "11" => duty_cycle <=10000; when others => duty_cycle <=0; end case; end process P1; P2:process(CLK,reset) begin if (reset='1') then current_s
signal read_bit :STD_LOGIC :='0'; begin P1:process(ASI_ASIC_IN_DUTY) begin case ASI_ASIC_IN_DUTY is when "01" => duty_cycle <=3300; when "10" => duty_cycle <=6600; when "11" => duty_cycle <=10000; when others => duty_cycle <=0; end case; end process P1; P2:process(CLK,reset) begin if (reset='1') then current_s
011 512Kb SRAM CS_Latch <= "011"; if AVR_AH(7 downto 2) = "000001" then case AVR_AH(1 downto 0) is when "01" => CS_Latch <= "111"; when "10" => CS_Latch <= "110"; when "11" => CS_Latch <= "101"; when others => NULL; end case; end if; end if; end process; process(AVR_WR, AVR_RD, AVR_AD, CS_Latch, Bank_Register