I need to clarify a question about verilog

Guest #6757146
Hello everybody,

I'm studying the primitives in verilog and I don't really see any use 
for them. I explain:

Imagine you want to describe an AND gate, what would you do?

a) assign OUT = A & B;

b) and (OUT, A, B);

So what is the true power of primitives? Why do they exist?

I have seen that users can create our own primitives (UDP), but the 
reasoning I have is the same: Why use this option of the verilog if we 
can describe our circuit with a "module"?

Thanks
Guest #6757267
But, if we have:

a) assign OUT = A & B;

b) and (OUT, A, B);

both are gate-level descriptions, aren't they?
Guest #6757450
Black wrote:
> a) assign OUT = A & B;
>
> b) and (OUT, A, B);
>
> both are gate-level descriptions, aren't they?


a) looks more behavioral, it could be iplemented with a mux-module also; 
i.e.

mux(OUT (OUT), .sel (a), IN1 ('0'), IN2 (B))
and therefore with a different gate
Guest #6757665
I think I understand your explanation, so if I want to implement an AND 
gate in an FPGA it is absurd to use primitives right? Because FPGAs are 
going to use their Logic Blocks for it.

Then, the use of primitives is done in the description of ASICs, right?
Guest #6757956
As i understand it, primitives can be defined for much more complex 
descriptions. It makes no sense for a simple gate, but this is a very 
simple primitive.

With complexer primitives it will save you writing efford as you just 
have to use the primitive.

For an FPGA it will somehow be mapped to ressorces available in the 
FPGA. For an ASIC it will be mapped to structure components in some Cell 
library.
Guest #6758045
What is the purpose of C-Code? - to be translated by a compiler from a 
high level description into executable binary code

What ist the purpose of a verilog description? -
A) to VERIfy LOGic, regardless if given as a netlist of circuitry or 
logic-equation
AND ALSO
B) to be translated from a (more or less) abstract description into a 
netlist
describing (real) circuitry.

The purpose (A)-Simulation of handwritten or generated netlist (with 
back propagation) was the first when verilog was 'invented', verilog was 
intended to be run in a simulator only.

The purpose (B) -Synthesize were later add to the 'use-case' of 
verilog-coded hardware descriptions.

It seems, that purpose (A) is mostly forgot by today's user, they are 
confused with the use of computer programming language as C.

Reply

A question of your own? This thread is over 5 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.