Michael Vincent Juan Labayog
   ~    Hypr Jrny-mn

 

Resume

Projects

Interests

Family Pics

My Favorite Links

My Auctions

Internet Accounts

Back to Home Page

Click here to view Simulation Wave Form.     ( May require Acrobat Reader. File in .pdf form)

% ParkingMonitor.tdf %

INCLUDE "floorcounter.inc";

% FUNCTION floorcounter (flr1[7..0], flr2[7..0], flr3[7..0], flr4[7..0],

switch1, switch2, switch3, switch4, cntupdwn1, cntupdwn2, cntupdwn3, cntupdwn4,

loadflr1a, loadflr2a, loadflr3a, loadflr4a, loadflr1b, loadflr2b, loadflr3b, loadflr4b,

clearflr1, clearflr2, clearflr3, clearflr4, cnta, cntb)

RETURNS (flrcnt1[7..0], flrcnt2[7..0], flrcnt3[7..0], flrcnt4[7..0],

redlight1, redlight2, redlight3, redlight4);  %

INCLUDE "add8bit.inc";

% FUNCTION add8bit (a[7..0], b[7..0], cin)

RETURNS (f[7..0], cout);  %

INCLUDE "add12bit.inc";

% FUNCTION add12bit (a[7..0], b[7..0], cin)

RETURNS (f[11..0], cout);%

SUBDESIGN parkingmonitor

(     InFloor1[7..0], InFloor2[7..0], InFloor3[7..0], InFloor4[7..0],

Entrswitch1, Entrswitch2, Entrswitch3, Entrswitch4,

Cntup1, Cntup2, Cntup3, Cntup4,

Exitswitch1, Exitswitch2, Exitswitch3, Exitswitch4,

LoadFloor1a, LoadFloor2a, LoadFloor3a, LoadFloor4a,

LoadFloor1b, LoadFloor2b, LoadFloor3b, LoadFloor4b,

ClearFlr1, ClearFlr2, ClearFlr3, ClearFlr4:INPUT;

HighA, HighB : INPUT = VCC;

Floorcnt1[7..0], Floorcnt2[7..0], Floorcnt3[7..0], Floorcnt4[7..0],

Red1, Red2, Red3, Red4, Green1, Green2, Green3, Green4,

Fout[7..0], Foutb[7..0],BldgCount[11..0],

BldgRed, BldgGreen :OUTPUT;

)

VARIABLE

FloorCnter : floorcounter;

Adder : add8bit; Adder2 : add8bit; Adder3 : add12bit;

temp1[7..0], temp2[7..0],temp3[7..0], temp4[7..0],

temp5[7..0], temp6[7..0]%,temp7[7..0], temp8[7..0]%: NODE;

BEGIN

FloorCnter.flr1[7..0] = InFloor1[7..0];

FloorCnter.loadflr1a = LoadFloor1a;                                                  % load enable ACTIVE LOW%

FloorCnter.loadflr1b = LoadFloor1b;                                                  % load enable ACTIVE LOW%

FloorCnter.cnta = HighA;                                                                  %always Hi Regardless%

FloorCnter.cntb = HighB;                                                                   % Count Enable (ENT, ENP )%

FloorCnter.switch1 = Entrswitch1 # Exitswitch1;                         % # Exitrswitch1 ; Entrance Sensor%

FloorCnter.clearflr1 = ClearFlr1;

FloorCnter.cntupdwn1 = Cntup1;                                                      % Entrance Sensor%

FloorCnt1[7..0] = FloorCnter.flrcnt1[7..0];

Red1 = FloorCnter.redlight1;

Green1 = !Red1;

 

FloorCnter.flr2[7..0] = InFloor2[7..0];

FloorCnter.loadflr2a = LoadFloor2a;

FloorCnter.loadflr2b = LoadFloor2b;                                             % Active Low %

FloorCnter.cnta = HighA;                                                              %always Hi Regardless%

FloorCnter.cntb = HighB;

FloorCnter.switch2 = Entrswitch2 # Exitswitch2;                      % Entrance Sensor%

FloorCnter.clearflr2 = ClearFlr2;

FloorCnter.cntupdwn2 = Cntup2;                                             % Entrance Sensor%

FloorCnt2[7..0] = FloorCnter.flrcnt2[7..0];

Red2 = FloorCnter.redlight2;

Green2 = !Red2;

 

FloorCnter.flr3[7..0] = InFloor3[7..0];

FloorCnter.loadflr3a = LoadFloor3a;

FloorCnter.loadflr3b = LoadFloor3b;

FloorCnter.cnta = HighA;                                                                  %always Hi Regardless%

FloorCnter.cntb = HighB;

FloorCnter.switch3 = Entrswitch3 # Exitswitch3;                           % Entrance Sensor%

FloorCnter.clearflr3 = ClearFlr3;

FloorCnter.cntUpDwn3 = Cntup3;                                                   % Entrance Sensor%

FloorCnt3[7..0] = FloorCnter.flrcnt3[7..0];

Red3 = FloorCnter.redLight3;

Green3 = !Red3;

 

FloorCnter.flr4[7..0] = InFloor4[7..0];

FloorCnter.loadflr4a = LoadFloor4a;

FloorCnter.loadflr4b = LoadFloor4b;

FloorCnter.cnta = HighA;                                                                     %always Hi Regardless%

FloorCnter.cntb = HighB;

FloorCnter.switch4 = Entrswitch4 # Exitswitch4;                     % Entrance Sensor%

FloorCnter.clearflr4 = ClearFlr4;

FloorCnter.cntUpDwn4 = Cntup4;                                             % Entrance Sensor%

FloorCnt4[7..0] = FloorCnter.flrcnt4[7..0];

Red4 = FloorCnter.redLight4;

Green4 = !Red4;

 

Adder.cin = GND;

temp1[7..0] = FloorCnt1[7..0]; Adder.a[7..0]= temp1[7..0] ;

temp2[7..0] = FloorCnt2[7..0]; Adder.b[7..0] = temp2[7..0];

Fout[7..0] = Adder.f[7..0];

 

Adder2.cin = GND;

temp3[7..0] = FloorCnt3[7..0]; Adder2.a[7..0]= temp3[7..0] ;

temp4[7..0] = FloorCnt4[7..0]; Adder2.b[7..0] = temp4[7..0];

Foutb[7..0] = Adder2.f[7..0];

 

Adder3.cin = GND;

temp5[7..0] = Fout[7..0]; Adder3.a[7..0]= temp5[7..0] ;

temp6[7..0] = Foutb[7..0]; Adder3.b[7..0] = temp6[7..0];

BldgCount[11..0] = Adder3.f[11..0];

 

If BldgCount[11..0] > 240

THEN BldgRed = VCC;

ELSE BldgGreen = Vcc;

    END IF;

 

wpe5.jpg (6502 bytes)

END;

1