The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Aug 16th, 2024, 7:44pm
Pages: 1
Send Topic Print
HOw  to declare a  bit (Read 2256 times)
zahrein
Junior Member
**
Offline



Posts: 14

HOw  to declare a  bit
Sep 29th, 2011, 12:04am
 
Hi

Is this  how  you declare a bit?
real d_enable =1b'1;



CODE


module  measure_voh_vol (pad,data);

input pad;
//input d_enable;
input data;


parameter real voh=0.9;
parameter real  vol=0.3;
real d_enable =1b'1;
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: HOw  to declare a  bit
Reply #1 - Oct 7th, 2011, 7:42am
 
Without thinking too hard about it, I would have said

integer d_enable = 1b'1;
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
boe
Community Fellow
*****
Offline



Posts: 615

Re: HOw  to declare a  bit
Reply #2 - Oct 7th, 2011, 8:08am
 
In Verilog(-AMS) integers are (at least) 32 bit wide. If you want a single bit you should use a reg/wire.
-B O E
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.