⑴ 排隊叫號電路設計
總的來看,就是構建一個加法計數器,(還可有預置開始計數號的功能),然後是專將這些二進屬制數轉換為十進制數顯示出來,一個數碼管(7段)顯示一位十進制數;
採用 LS160----構成十進制計數器,計數脈沖產生電路就是叫號按鈕;
然後 LS47/48----構成BCD轉7段數碼管電路;
附加上復位、預置開關;
⑵ FPGA 優先權排隊電路
abc={100,010,001} 剩下狀態 out=000
電路圖如下 (!為NOT)
GND VCC
| ::|
======
=1 0 = - a!b!c
======
|
a_out
GND VCC
| ::|
======
=1 0 = - !ab!c
======
|
b_out
GND VCC
| ::|
======
=1 0 = - !a!bc
======
|
c_out
⑶ verilog的優先權排隊電路
mole Priority(a,b,c,rst,clk,oa,ob,oc);
input a,b,c;
input rst,clk;
output oa,ob,oc;
reg oa,ob,oc;
always @(posedge clk or posedge rst) begin
if(rst)
begin
oa<=0;ob<=0;oc<=0;
end
if(a)
begin
oa<=1;ob<=0;oc<=0;
end
else if(!a&b)
begin ob<=1;oa<=0;oc<=0;
end
else if(!a&!b&c)
begin
oc<=1;oa<=0;ob<=0;
end
else
begin
oa<=0;ob<=0;oc<=0;
end end
endmole
下面是功能模擬測試文件
`timescale 1ns/1ns
mole Priority_t();
reg a,b,c,rst,clk;
wire oa,ob,oc;
parameter step=100;
Priority u(a,b,c,rst,clk,oa,ob,oc);
always #(0.5*step) clk=~clk;
initial begin
rst=1;
#(step) rst=0;
end
initial begin
a=0;b=0;c=0;clk=0;
#(5*step) a=1;b=0;c=0;
#(5*step) a=0;b=1;c=0;
#(5*step) a=0;b=0;c=1;
#(5*step) a=1;b=1;c=0;
#(5*step) a=1;b=0;c=1;
#(5*step) a=0;b=1;c=0;
end
endmole
測試文件模擬結果本人已實際操作,結果正確
⑷ 用verilog中的if 語句設計一個優先排隊電路
mole test(ia,ib,ic,oa,ob,oc);
input wire ia,ib,ic;
output reg oa,ob,oc;
always @(ia or ib or ic)
begin
if (ia==1 && ib==0 && ic==0) begin oa=1;ob=0;oc=0;end
else if (ia==0 && ib==1 && ic==0) begin oa=0;ob=1;oc=0;end
else if (ia==0 && ib==0 && ic==1) begin oa=0;ob=0;oc=1;end
end
endmole
⑸ 用verilog中的if 語句設計一個優先排隊電路,其框圖如下: 排隊順序: A=1 最高優先順序 B=1 次高優先順序 C=
moleSQE(
input[2:0]abc_in;
outputreg[2:0]abc_out;
always@*
begin
if(abc_in>=3'b100)
abc_out<=3'b100;
elseif(abc_in<=3'b001)
abc_out<=3'b001;
else
abc_out<=3'b010;
end
endmole
模擬波形自己畫,沒那個工具
⑹ FPGA的優先權排隊電路
試驗的波形取決於你的輸入激勵,即取決於a,b,c的輸入狀態,畫了一個圖,請參考.
這部分代碼的分析比較簡單,A=1的時候,A_out為1,B_out和C_out為0;A不為1而且B=1時,B_out為1,A_out和C_out為0;A和B都不為1而且C=1時,C_out為1,A_out和B_out為0;因為語句中的ifelse是先判斷A,再判斷B,最後判斷C,所以A的優先順序最高,B次之,C最低.