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.

In VHDL language what the underscore exactly mean in natural no.

Status
Not open for further replies.

rourabpaul

Member level 3
Joined
Aug 14, 2010
Messages
67
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
kolkata
Activity points
1,747
I have a Syntax in VHDL from net

generic(

FREQ : natural := 100_000
);

I cnt understand the natural value of FREQ,what the underscore exactly meaning in that case
 

The underscore is just used for readability, in your code it is probably used as a thousand separator, the number is 100000 , you could even write it as 10_00_00 and it would still be the same number.

Alex
 

Thank you Alex,
one another syntax meaning i want to know

parity <= sc_r(scancode'high+1);
here scancode is a 8 bit ,sc_r is 10 bit and parity is one bit std logic type
 

when you have a scancode (7 downto 0) then scancode'high=7

Alex

---------- Post added at 13:24 ---------- Previous post was at 13:19 ----------

I think will help you with some examples
VHDL Resolution and Signatures

Alex
 

I have another syntax problem
the code is
" scancode <= sc_r(scancode'range);"
here scan code is 8 bit,and sc_r is 10 bit
thank you in advance
 

In the link i have provided above there are examples for this also

Code:
[B]A : std_logic_vector(31 downto 0)[/B] := x"FEDCBA98"; -- 'downto'
[B]B : std_logic_vector( 4 to    27) [/B]:= x"654321";   -- 'to'
C       a literal constant                  x"321"

Name  bitstring (attributes on following lines)

 A    11111110110111001011101010011000
      A'left=31     A'right=0      A'low=0      A'high=31
      A(A'left)=1   A(A'right)=0   A(A'low)=0   A(A'high)=1
      [B]A'range=(31 downto 0)[/B]        A'reverse_range=(0 to 31) 
      A'length=32                  A'ascending=false

 B    011001010100001100100001                  B'ascending=true
      B'left=4      B'right=27     B'low=4      B'high=27
      B(B'left)=0   B(B'right)=1   B(B'low)=0   B(B'high)=1
      [B]B'range=(4 to 27) [/B]           B'reverse_range=(27 downto 4) 
      B'length=24                  B'ascending=true

 C    001100100001
      C'left=0      C'right=11     C'low=0      C'high=11
      C(C'left)=0   C(C'right)=1   C(C'low)=0   C(C'high)=1
      [B]C'range=(0 to 11) [/B]           C'reverse_range=(11 downto 0) 
      C'length=12                  C'ascending=true

Alex
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top