Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] An equivalent circuit for the simple code below

Status
Not open for further replies.

vaah

Member level 3
Member level 3
Joined
May 24, 2012
Messages
67
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
US
Activity points
1,785
Hi guys,

I have a simple code and I want to simulate it in cadence but I'd rather not use Verilog-A. I appreciate your thoughts and comments if anything crosses your mind!

Code:
if ((V(WL)-Vth)>0) VDC=2;
else VDC = 0;

Also, during the simulation, if one time "VDC=2" happens I don't want it to change "VDC" anymore.

Thank you.
 

Use a comparator to compare V(WL)(+) against Vth(-) . If V(WL)>Vth, the comparator output is high. That turns on a switch to pass 2V. If not, turns off the switch and ground the switch output.
 

Use a comparator to compare V(WL)(+) against Vth(-) . If V(WL)>Vth, the comparator output is high. That turns on a switch to pass 2V. If not, turns off the switch and ground the switch output.

Thank you very much for the reply.
There is only one problem, the output will change every time V(WL)>Vth. But I want it to keep the value.

- - - Updated - - -

You could use a comparator and a switch.

Thanks a lot. Doesn't it change the output for every cycle? I am looking for sth that keep the value after the first time V(WL)>VTH.

I actually want to use the minimum # of elements as it will drastically increase my simulation time.
 

Thanks a lot. Doesn't it change the output for every cycle? I am looking for sth that keep the value after the first time V(WL)>VTH.

I actually want to use the minimum # of elements as it will drastically increase my simulation time.

What do you mean "every cycle"? The answer fits your original equation. Are you changing the equation??
 

Thank you very much for the reply.
There is only one problem, the output will change every time V(WL)>Vth. But I want it to keep the value.

- - - Updated - - -



Thanks a lot. Doesn't it change the output for every cycle? I am looking for sth that keep the value after the first time V(WL)>VTH.

I actually want to use the minimum # of elements as it will drastically increase my simulation time.

Do not understand it either.
 

My bad, I forgot to add this part. I think you got my point now.

While (Clock) being
if ((V(WL)-Vth)>0) VDC=2;
else VDC = 0;
end

Assuming VDC=2, I want it to happen only one time. For example, a capacitor can store the value. The thing is that I don't have ideal elements and I have to use actual transistors and capacitors.
 

So use a comparator AND a latch. When the comparator toggles the first time, it will trigger the latch that can control a switch.
 

So use a comparator AND a latch. When the comparator toggles the first time, it will trigger the latch that can control a switch.

Thanks, "barry".

That works but a comparator needs at least 4 elements and a latch 8 elements. It doesn't work for me as it needs at least 10 elements. I was thinking of sth with less than 10 elements.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top