2020年4月11日 星期六

1 bit comparator 比較器 in Verilog with gate level

1 bit comparator 比較器 in Verilog  with gate level




module compare(a, b, L, E,G);
input a, b;
output L, E, G;
wire s1, s2;

not X1(s1, a);
not X2 (s2, b);

and X3 (L,s1, b);
and X4 (G,s2, a);
xnor X5 (E, a, b);


endmodule


// 時間單位 100ns, 時間精確度100 ps
`timescale 100ns/100ps 
module TB;
/*
module b_comp1 (a, b, L, E,G);
input a, b; 
output L, E, G;
*/
reg a=1'b0;
reg b=1'b0;
wire L,E,G;

compare UUT(a, b, L, E,G);
initial
begin
#50 
a=1'b0;b=1'b1;
#50 
a=1'b1;b=1'b0;
#50 
a=1'b1;b=1'b1;
#50 
$stop;

end
endmodule


沒有留言:

張貼留言

台中公車雙向即時資訊系統 (TaichungBusLiveQuery)- Node-red 程式

  台中公車雙向即時資訊系統 ( TaichungBusLiveQuery )   Node-red 程式 Python Tkinter 是單機桌面 UI 程式,主動發起 API 請求並渲染視窗。 Node-RED 是基於事件驅動的流程(Flow-based)系統,適合在背...