// Qucs analogue pad3bit model // The structure and theoretical background to the pad3bit // Verilog-a model are presented in the Qucs digital tutorial. // // This is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2, or (at your option) // any later version. // // Copyright (C), Mike Brinson, mbrin72043@yahoo.co.uk, December 2008. // `include "disciplines.vams" `include "constants.vams" module pad3bit (C, B, A); inout C, B, A; electrical C, B, A; // `define attr(txt) (*txt*) parameter integer Number = 0 from [0 : 15] `attr(info="pad output value"); // real IA, IB, IC; // analog begin case (Number) 0 : begin IA = 0; IB = 0; IC = 0; end 1 : begin IA = 1; IB = 0; IC = 0; end 2 : begin IA = 0; IB = 1; IC = 0; end 3 : begin IA = 1; IB = 1; IC = 0; end 4 : begin IA = 0; IB = 0; IC = 1; end 5 : begin IA = 1; IB = 0; IC = 1; end 6 : begin IA = 0; IB = 1; IC = 1; end 7 : begin IA = 1; IB = 1; IC = 1; end endcase I(A) <+ -IA; I(A) <+ V(A); // I(B) <+ -IB; I(B) <+ V(B); // I(C) <+ -IC; I(C) <+ V(C); // end endmodule