-- Copyright (C) 1999-2002 The University of Cincinnati. -- All rights reserved. -- This file is part of VESTs (Vhdl tESTs). -- UC MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE -- SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -- IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, -- OR NON-INFRINGEMENT. UC SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY -- LICENSEE AS A RESULT OF USING, RESULT OF USING, MODIFYING OR -- DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -- By using or copying this Software, Licensee agrees to abide by the -- intellectual property laws, and all other applicable laws of the U.S., -- and the terms of this license. -- You may modify, distribute, and use the software contained in this -- package under the terms of the "GNU GENERAL PUBLIC LICENSE" version 2, -- June 1991. A copy of this license agreement can be found in the file -- "COPYING", distributed with this archive. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: bjt_pnp_gen.ams,v 1.1 2002-03-27 22:11:16 paw Exp $ -- $Revision: 1.1 $ -- -- --------------------------------------------------------------------- ----------------------------------------------------------------------------- -- Ebers-moll Model for a transistor -- -- VHDL-AMS Implementation -- -- Developed at the Distributed Processing Lab at the University -- -- of Cincinnati -- -- by VishwaShanth Kasula on May 10, 1999 -- -------------------------------------------------------------------- -- Circuit Topology -- -- BJT Ebers-Moll static model -- Testbench Ckt to evaluate the DC operatioing point of an pnp BJT, -- Sedra smith page no. 155, fig 4.11 -------------------------------------------------------------------- PACKAGE electricalSystem IS NATURE electrical IS real ACROSS real THROUGH ground reference; FUNCTION SIN(X : real) RETURN real; FUNCTION EXP(X : real) RETURN real; END PACKAGE electricalSystem; use work.electricalsystem.all; entity bjt_pnp is generic(isat : real := 1.0e-16; -- Saturation Current bf : real := 100.0; -- Ideal maximus forward current br : real := 1.0; -- ideal maximum reverse current rb : real := 1.0e-5; -- Base resistance rc : real := 1.0e-5; -- collector resistance re : real := 1.0e-5; -- emmiter resistance vaf : real := 100.0); -- Forward Early Voltage port(terminal e,b,c : electrical); end bjt_pnp; architecture structure of bjt_pnp is terminal b1, c1, e1 : electrical; quantity vbo across ib through b1 to b; quantity vco across ic through c1 to c; quantity veo across ie through e1 to e; quantity vct across Ict through e1 to c1;--current source quantity vbe across ibe through e1 to b1; quantity vbc across ibc through c1 to b1; quantity vce : real := 1.0; -- used to calculate VCE constant gmin : real := 1.0e-12; -- condutsnce in parallel with every pn junction constant vt : real := 0.02589; -- thermal voltage begin brk : break vbe => 1.0, vbc => -1.0; diodecond1 : if(vbe > -5.0*vt) use diodebef : ibe == ((isat*(exp(vbe/vt) - 1.0)) + (gmin*vbe))/bf; elsif(vbe <= -5.0*vt ) use diodeber: ibe == ((-1.0*isat) + (gmin*vbe))/bf; end use; diodecond2 : if(vbc > -5.0*vt) use diodebcf : ibc == ((isat*(exp(vbc/vt) - 1.0)) + (gmin*vbc))/br; elsif(vbc <= -5.0*vt) use diodebcr : ibc == ((-1.0*isat) + (gmin*vbc))/br; end use; bres : vbo == ib * 1.0e-6; cres : vco == ic * 1.0e-6; eres : veo == ie * 1.0e-6; kcl_eqn : ie == -1.0*(ib + ic); vcevolt : vce == vbe - vbc; ictdep : Ict == ((Ibe*bf) - (Ibc*br)) * (1.0 -(vbc/vaf)); end architecture structure; --***************************************************** --TEST BENCH use std.textio.all; use work.electricalsystem.all; entity bjt_testbench is end bjt_testbench; architecture structure of bjt_testbench is terminal t1, t2, t3, t4 : electrical ; component bjt_pnp_comp generic(isat : real := 1.0e-16; -- Saturation Current bf : real := 100.0; -- Ideal maximus forward current br : real := 1.0; -- ideal maximum reverse current rb : real := 1.0e-5; -- Base resistance rc : real := 1.0e-5; -- collector resistance re : real := 1.0e-5; -- emmiter resistance vaf : real := 100.0); -- Forward Early Voltage port(terminal e,b,c : electrical); end component; for all : bjt_pnp_comp use entity work.bjt_pnp(structure); quantity vcc across icc through t4 to electrical'reference; quantity vrc across irc through t3 to t4; quantity vee across iee through t1 to electrical'reference; quantity vre across ire through t1 to t2; begin bjt : bjt_pnp_comp generic map (isat => 1.8104e-15) port map(t2,ground,t3); emres : vre == ire * 2.0e3; ccurr : vcc == -10.0; ecurr : vee == 10.0; cores : vrc == irc * 1.0e3; end architecture structure;