機能
非同期式4ビット加算器
信号機能
A_in[4] = 加算値A
B_in[4] = 加算値B
Q_out[4] = 結果出力
解説
A_inの値とB_inの値を加算し,Q_outに出力します。
NSL記述例
/* ************************************************************ */
declare ADDER4_async {
input A_in[4] ; // Add value input. Port-A
input B_in[4] ; // Add value input. Port-B
output Q_out[4] ; // Add result out
func_in exec( A_in, B_in ) ; // Add function execution request with parameter.
func_out done( Q_out ) ; // Add function complete acknowledge with parameter.
}
/* ************************************************************ */
// Declare module
module ADDER4_async {
/* ************************************************************ */
// Internal operation signals
/* ************************************************************ */
// Pallarel equation
/* ************************************************************ */
// Function independent equation
function exec {
done ( A_in + B_in ) ;
}
}
/* ************************************************************ */
Verilog変換例
/*
Produced by NSL Core, IP ARCH, Inc. Fri Jun 04 17:53:01 2010
Licensed to :EVALUATION USER:
*/
module ADDER4_async ( p_reset , m_clock , A_in , B_in , Q_out , exec , done );
input p_reset, m_clock;
input [3:0] A_in;
input [3:0] B_in;
output [3:0] Q_out;
input exec;
output done;
assign Q_out =
//synthesis translate_off
(exec)?
//synthesis translate_on
((exec)?(A_in)+(B_in):4’b0)
//synthesis translate_off
:4’bx
//synthesis translate_on
;
assign done = exec;
endmodule
/*
Produced by NSL Core, IP ARCH, Inc. Fri Jun 04 17:53:01 2010
Licensed to
*/