Jump to content
    

Сортировка в VHDL

" как мне сделать скалабилити. я хочу задать d0 - dN.  generate cell_0 - cell_N "

если Вы это сделаете, выложите пожалуйста здесь

PS Сейчас по работе сильно загружен...

Share this post


Link to post
Share on other sites

1 hour ago, Maverick_ said:

" как мне сделать скалабилити. я хочу задать d0 - dN.  generate cell_0 - cell_N "

если Вы это сделаете, выложите пожалуйста здесь

PS Сейчас по работе сильно загружен...

спасибо

Share this post


Link to post
Share on other sites

В 07.04.2020 в 12:16, jenya7 сказал:

месье. жё не манж па си жур. предложите рабочий вариант пожалуйста.


    process(rst,clk)  
    begin 
        if rst = '1' then    
            cnt_s <= x"0";    
            cnt_s0 <= x"5";    
            fl0 <= '0';     
            run_s <= '1';
        elsif clk = '1' and clk'event then      
            if start = '1' then cnt_s <= x"0";
            elsif cnt_s = cnt_s0 then cnt_s <= x"0"; 
            elsif run_s = '1' then cnt_s <= cnt_s + 1; 
            end if;            
            
            if start = '1' then cnt_s0 <= x"5";
            elsif cnt_s = cnt_s0 then cnt_s0 <= cnt_s0 - 1; 
            end if;    
                
            if d_s(conv_integer(cnt_s)) > d_s(conv_integer(cnt_s + 1)) then
               d_s(conv_integer(cnt_s)) <= d_s(conv_integer(cnt_s + 1));
               d_s(conv_integer(cnt_s+1)) <= d_s(conv_integer(cnt_s));
            end if;      
            
            if cnt_s = cnt_s0 then fl0 <= '1'; 
            elsif d_s(conv_integer(cnt_s)) > d_s(conv_integer(cnt_s + 1)) then fl0 <= '0';
            end if;         
            
            if start = '1' then run_s <= '1'; 
            elsif cnt_s = cnt_s0 and fl0 = '1' then run_s <= '0'; 
            end if;
        end if;
    end process;    
                 
            fin <= not run_s;    

 

Пузырьковый метод, на массив в 6 элементов ( cnt_s0 <= x"5";). 

Если что не понятно, пишите.

Share this post


Link to post
Share on other sites

11 hours ago, vt313 said:


  

Пузырьковый метод, на массив в 6 элементов ( cnt_s0 <= x"5";). 

Если что не понятно, пишите.

спасибо. а можно энтити для полноты картины?

Edited by jenya7

Share this post


Link to post
Share on other sites

12 часов назад, jenya7 сказал:

спасибо. а можно энтити для полноты картины?

 

Вы, каким-то образом, задаете массив и получаете результат. Это Ваши протоколы.

Опишите их.

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...