0
\$\begingroup\$

In adder.vhd

  H1: half_Adder generic map ( gate_delay => 6 ns );      
  port map ( a => ln1, b => ln2, ... );

half_adder.vhd

  Ex1 : xor generic map ( gate_delay => gate_delay );
  A1  : and generic map ( gate_delay => gate_delay );

and.vhd

  entity and is generic ( gate_delay : Time := 2 ns );

xor.vhd

  entity xor is generic ( gate_delay : Time := 3 ns );

I gave four files.

My question is, how much should one wait to see correct result ? In other words, what is the total time delay for each file?

\$\endgroup\$
2
  • \$\begingroup\$ If one doesn't understand what I try to ask, feel free when you say something \$\endgroup\$
    – user5140
    Commented Aug 15, 2011 at 8:37
  • 1
    \$\begingroup\$ Are you asking which definition of "gate_delay" will take precedence? The value from half_adder's generic map will be passed down into 'and' and 'xor'. \$\endgroup\$
    – fbo
    Commented Aug 15, 2011 at 21:09

1 Answer 1

1
\$\begingroup\$

Since the longest path in a half adder is only one gate, the delay of the entire circuit will be equal to the gate delay. In this case, the gate delay is 6 ns. The default values for gate_delay of both gate entities are overridden in the instantiations you write.

Note that your code will not work since and and xor are reserved words in VHDL. You will need to rename to something like and_gate and xor_gate

Another side note: VHDL code like this is only used for gate level simulation with timing annotations, usually after synthesis and place and route. If you want to write an adder in VHDL, you should write a <= b + c;

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.