Carrier Generator

OP #2687911
i wish to design a digital carrier generator, the diagram of which i am 
attaching herein..
for the same i have used the following building blocks:

1> 2:1 Mux(multibit)
2> Digital Integrator (multibit)
3> A Delta function block (unit impulse function)
4> A Clock
5> A 4x4 bit multiplier, wherein only the first 4 bits of the product 
have been considered.

I ran the code and it synthesized perfectly well..but on generation of 
test bench waveform, the output ports were undefined..

i m unable to figure out as to how to supply the values to the building 
blocks through the signals...

Please suggest the required changes/errors..

Thanks.
#2688134
Difficult to say, a number of reasons may be the source:

- Testbench: Are all your inputs defined?
- Non-existing instances (e.g. is your multiplier instantiated?)
- Missing definition of initial values (ever propagating)

Just display the intermediate signals in your waveview and track the 
undefined signal(s) down to the root cause. Maybe (if existing) read the 
simulator compilation warnings and try to avoid them.
Moderator (Company: Titel) #2688154
> I ran the code and it synthesized perfectly well..
Are you sure?
This code IS ABSOLUTELY NOT synthesizeable!
1
  for i in 1 to 10 loop     
2
    clock_xhdl0 <= '1';
3
    wait for 100 ns;
4
    clock_xhdl0 <= NOT(clock_xhdl0);
5
    wait for 100 ns;
6
  end loop;

> but on generation of test bench waveform, the output ports
> were undefined..
I cannot see a testbench in your code. A testbench entity has NO ports. 
But each of your modules has ports...

BTW:
> A 4x4 bit multiplier
A multiplier is in VHDL usually done like this
   a <= b*c;

BTW:
Why using a
   GENERIC (  WIDTH  : INTEGER := 4 );
in your multiplexer, when you later use a fixed vector to extend /a/:
   c <= ("000" & a) WHEN (sel = '1') ELSE    b;

What, if i would take your generic code and write
   GENERIC (  WIDTH  : INTEGER := 6 );
OP #2689262
I am unable to update the 4-bit signals(a,b and c) which are used 
interchangeably as input and output in the connecting blocks.
Eg. The signal c which is the output of mux is also the input of the 1st 
integrator. Since the values are not being updated, as a result the 
signals are showing as undefined in the tbw simulation.
#2689499
Pratyush Anand wrote:
> I am unable to update the 4-bit signals(a,b and c) which are used
> interchangeably as input and output in the connecting blocks.
> Eg. The signal c which is the output of mux is also the input of the 1st
> integrator.

You do not need to update c by hand, this is the task of your 
"mux_2to1".

> Since the values are not being updated, as a result the
> signals are showing as undefined in the tbw simulation.

You have to find out why. Observe the signal(s) that influence your 
undefined one, e.g. c, in the waveview. In that case, observe a,b and 
sel.

Do so recursively with those of the 3 signals (a,b and sel), which are 
undefined, until you have found the origin of undefinedness. This will 
lead to the earlier posted possible reasons of problems:

- Testbench (not posted...): Are all your inputs defined?
- Non-existing instances (e.g. is your multiplier instantiated?)
- Missing definition of initial values (ever propagating)

Reply

A question of your own? This thread is over 14 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.