Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > a Sample and hold circuit model

Reply
Thread Tools

a Sample and hold circuit model

 
 
Manivannan
Guest
Posts: n/a
 
      09-26-2004
Hi,

i am trying to model a Sample and hold device for a ADC, using
VHDL-AMS on Cadence.I used the Zero Order Hold attribute ('zoh()) to
sample the inputs. The code had no problems running on Mentor Graphics
System Vision, but when i ported the code to Cadence it did not. I
seems that the 'zoh() function is not yet built into Cadence VHDL-AMS
Simulator.
Now my question is that is there any equivalent function for 'zoh() ?

I have posted this query in comp.lang.cad.Cadence , but no reply as of
now!

will be happy if somebody could clear this..

Cheers
Manivannan
 
Reply With Quote
 
 
 
 
cdbular cdbular is offline
Junior Member
Join Date: Mar 2008
Posts: 1
 
      03-05-2008
I had the same problem. To addres the problem I decided to make a ZOH block.

I made the code using quantity inputs and outputs. The code was tested unsign a sinuosidal signal and it worked fine.


Code:
--- CODE OF ZOH BLOCK
library IEEE;                
use IEEE.MATH_REAL.all;
USE IEEE.STD_LOGIC_1164.ALL;        
                     
USE IEEE.ELECTRICAL_SYSTEM.ALL;          

ENTITY ZOHF IS                                    
	GENERIC (Ts: TIME:= 10 us);                                       
	PORT(signal clkout : out bit;
		 QUANTITY Vin : IN REAL:=0.0;                    
		 QUANTITY Vout: OUT REAL:=0.0);
END ZOHF;                                                                      
             
                                                                  
ARCHITECTURE behavior_sampler OF ZOHF IS                                                                                        
    shared variable Vin_HOLD : REAL:=0.0;
	SIGNAL clk: bit :='1';                                                
BEGIN                                                                                    
clock: process (clk)                                                                         
    BEGIN                                                     
        clk <= not clk after Ts/2;             
     END PROCESS clock;                                   
     
samp:PROCESS (clk)               
     BEGIN                                                                                                             
        IF (clk'EVENT AND clk='1') THEN              
        Vin_HOLD:= vin;
        END IF;                                     
    END PROCESS samp;                        
Vout==Vin_HOLD;                                     
clkout<=clk;                               
END behavior_sampler;

The testbench
Code:
--Testbench                                                                       
                
LIBRARY DISCIPLINES, IEEE;                               
    USE DISCIPLINES.ELECTROMAGNETIC_SYSTEM.ALL;
    USE IEEE.MATH_REAL.ALL;    
	USE IEEE.STD_LOGIC_1164.ALL;   
                                                
ENTITY bench IS END ENTITY bench;                
                                                                                                               
ARCHITECTURE sample OF bench IS                                           
                                                                                                       
    QUANTITY vin1, n2 : REAL:=0.0;                                                         
	CONSTANT f   : REAL := 1.0E3;
	signal clk : bit;        
                                                                         
BEGIN                                            
                                                                       
     vin1 == 2.0;                                           
ZOH1: ENTITY ZOHF(behavior_sampler)                                
       GENERIC MAP (Ts => 0.05e-3 sec)                 
       PORT MAP (clk,Vin1, n2);                   
END ARCHITECTURE sample;
I hope that will help you
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Circuit diagram for Proview PK 772 model M monitor? GraB NZ Computing 1 03-31-2010 07:35 PM
Framework or sample site for SaaS model? Mike Cain ASP .Net 0 07-18-2007 03:50 PM
Convert Java Model to Java Model without XML erinbot@gmail.com Java 1 10-06-2006 09:00 PM
looking for asp.net sample with vb.net backend sample is there one? Jake ASP .Net 0 02-09-2006 10:44 PM
Sample Circuit Board Scam? The Bit Bandit NZ Computing 4 08-24-2004 06:31 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57