當前位置:首頁 » 軟體設計 » vhdl設計

vhdl設計

發布時間: 2020-12-11 17:20:43

『壹』 VHDL軟體設計

8-3編碼器的設計實例
編碼器設計方案之一:
mole encoder1(none_on,out,in);
output none_on;
output [2:0] out;
input [7:0] in;
reg [2:0] out;
reg none_on;
always @(in)
begin: local
integer i;
out = 0;
none_on = 1;
/*returns the value of the highest bit
number turned on*/
for( i=0; i<8; i=i+1 )
begin
if( in[i] )
begin
out = i;
none_on = 0;
end
end
end
endmole
編碼器設計方案之二:
mole encoder2 ( none_on, out2, out1, out0, h, g, f,
e, d, c, b, a);
input h, g, f, e, d, c, b, a;
output none_on, out2, out1, out0;
wire [3:0] outvec;
assign outvec= h? 4'b0111 : g? 4'b0110 : f? 4'b0101:
e? 4'b0100 : d? 4'b0011 :c? 4'b0010 : b? 4'b0001:
a? 4'b0000 : 4'b1000;
assign none_on = outvec[3];
assign out2 = outvec[2];
assign out1 = outvec[1];
assign out0 = outvec[0];
endmole
編碼器設計方案之三:
mole encoder3 (none_on, out2, out1, out0, h, g,
f, e, d, c, b, a);
input h, g, f, e, d, c, b, a;
output out2, out1, out0;
output none_on;
reg [3:0] outvec;
assign {none_on,out2,out1,out0} = outvec;
always @( a or b or c or d or e or f or g or h)
begin
if(h) outvec=4'b0111;
else if(g) outvec=4'b0110;
else if(f) outvec=4'b0101;
else if(e) outvec=4'b0100;
else if(d) outvec=4'b0011;
else if(c) outvec=4'b0010;
else if(b) outvec=4'b0001;
else if(a) outvec=4'b0000;
else outvec=4'b1000;
end
endmole

『貳』 VHDL設計用什麼軟體

設計軟體常用的無非是 ISE 和 quartus ,具體要用哪個是根據你所使用的器件決定的,比如你用Altera的器件你就要用quartus和nios。

『叄』 vhdl的簡單alu設計

額,再設計之前首先要了解ALU的特性,最重要的一個特性就是選擇性回執行運算,即時說一次執行答一個選擇的運算。
所以再看樓主的程序,使用的是多個並行的PROCESS來實現,這種方法我覺得就有問題,並且用兩個運算單位X和Y來作為RPOCESS的敏感變數就更有問題了。。。最重要的是要記住,ALU執行的不是順序邏輯,而是組合邏輯,所以不要加PROCESS,因為加了PROCESS就引入了時間的概念,就成了順序邏輯了。

我把我寫的一個ALU發到樓主郵箱了,是VHD文件,這個ALU可以實現9種運算,當然也包括加減乘除,其餘的是一些邏輯運算,樓主也可以看看,這個ALU是完美運行,並且我GENERIC了一個變數來控制運算的位數,程序里我我取得是4位,樓主可以根據自己需求來改

PS:你的郵箱是不是打錯了啊。。。應該是352016927吧。。。我說怎麼一直發送失敗。。。
好了,呵呵,說了這么多,希望對你有所幫助啊

『肆』 VHDL設計

樓主的意思比較簡單 是兩道題吧?
1,代碼
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity ornot3 is
port( a0,a1,a2 :in std_logic; ---3 inputs
y:out std_logic --- output
);
end entity ornot3;
architecture arc of ornot3 is
begin
process(a0,a1,a2)
begin
y<= not(a0 or a1 or a2);
end process;
end arc;
2.代碼
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity sel2 is
port( sel :in std_logic; ---3 inputs
a0,a1: in std_logic_vector(3 downto 0);
y:out std_logic_vector(3 downto 0) --- output
);
end entity sel2;
architecture arc of sel2 is
begin
process(a0,a1,sel)
begin
if sel = '0'then
y <= a0;
elsif sel = '1' then
y <= a1;
else y <= "ZZZZ";
end if;
end process;
end arc;

『伍』 用vhdl設計四輸入與門,兩種方法

第一種方法,程序如下:
library ieee;
use ieee.std_logic_1164.all;

entity and4 is
port (a,b,c,d : in std_logic;
z : out std_logic );
end and4;

architecture medied of and4 is
begin
z <= (a and b) and (c and d);
end medied;

第二種方法,程序如下:
library ieee;
use ieee.std_logic_1164.all;

entity and4 is
port (a,b,c,d : in std_logic;
z : out std_logic );
end and4;

architecture medied of and4 is
signal abcd : std_logic_vector(3 downto 0);
begin
abcd <= a&b&c&d;
process(abcd)
begin
case abcd is
when "1111" => Z <= '1';
when others => z <= '0';
end case;
end process;
end medied;

此外還有很多寫法可以實現4輸入與門這個功能。
這樣的程序並不復雜,建議樓主多動手寫寫,不能總依賴別人,自己摸索出來的東西才印象深刻。
希望你認真學習,學有所成。

『陸』 VHDL簡單計算器設計

先算一下1+1=0,進1
1+0=1,進0
0+1=1,進0
0+0=0,進0
減法也是。然後用二進制與門,非門啥的拼一內下。VHDL沒學過,數字電容路總會吧。通過二進製表示十進制數。就像1010B=10D。

然後就組織成C語言的樣子。用IF就能完成。這個直接用十進制計算就行了。實體上看你怎麼輸入了,是直接十進制輸入呢?還是二進制輸入呢?二進制輸入的話,結構體里還要做個換算。

『柒』 用VHDL設計一個八選一電路

LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
ENTITY div_8 IS
PORT( clk:IN std_logic;
y:OUT std_logic);
END;
ARCHITECTURE bhv OF div_8 IS
SIGNAL d,q:std_logic_vector(2 DOWNTO 0);
BEGIN
d <= NOT q;
PROCESS(clk)
BEGIN
IF rising_edge(clk) THEN
q(0) <= d(0);
END IF;
END PROCESS;
PROCESS(q(0))
BEGIN
IF rising_edge(q(0)) THEN
q(1) <= d(1);
END IF;
END PROCESS;
PROCESS(q(1))
BEGIN
IF rising_edge(q(1)) THEN
q(2) <= d(2);
END IF;
END PROCESS;
y <= q(2);
END bhv;

『捌』 VHDL程序設計

完成100計數器的設計,計數值范圍0~99(二進制 0000000~1100011,注意寬度7比特);並進行120個周期以上的波形模擬。

『玖』 設計vhdl語言用哪個軟體啊

常用的編譯環境有Altera公司的Quartus和Xilinx公司的ISE兩款軟體。當然編譯環境你可以選擇notepad++或者Vi編輯工具。

『拾』 vhdl設計程序~

iouiuiuooiu

熱點內容
美發店認證 發布:2021-03-16 21:43:38 瀏覽:443
物業糾紛原因 發布:2021-03-16 21:42:46 瀏覽:474
全國著名不孕不育醫院 發布:2021-03-16 21:42:24 瀏覽:679
知名明星確診 發布:2021-03-16 21:42:04 瀏覽:14
ipad大專有用嗎 發布:2021-03-16 21:40:58 瀏覽:670
公務員協議班值得嗎 發布:2021-03-16 21:40:00 瀏覽:21
知名書店品牌 發布:2021-03-16 21:39:09 瀏覽:949
q雷授權碼在哪裡買 發布:2021-03-16 21:38:44 瀏覽:852
圖書天貓轉讓 發布:2021-03-16 21:38:26 瀏覽:707
寶寶水杯品牌 發布:2021-03-16 21:35:56 瀏覽:837