the synthesis difference

  • Thread starter bigcaterpillar@gmail.com
  • Start date
B

bigcaterpillar@gmail.com

Guest
I synthesis the verilog code .
e.g1. I find so many latches.e.g2. I find a multiplexer
I want to know the difference bewteen them ,such as area,
power,latency and speed .....

verilog code:
input[1:0] sela;
input[63:0] x,mc;
output[63:0]a;

e.g.1.
assign a = ({64{sela[0]}}&x)|({64{sela[1]}}&mc);
e.g.2
always@(sela)
case(sela)
2'b01: a<=x;
2'b10: a<=mc;
default:a<=0;
endcase
 
On Thu, 15 May 2008 20:15:50 -0700 (PDT),
<bigcaterpillar@gmail.com> wrote:

e.g1. I find so many latches.e.g2. I find a multiplexer
Are you sure you have this the right way round?

I want to know the difference bewteen them ,such as area,
power,latency and speed .....
This is unlikely to be affected by the way you code
a given logic function. Identical combinational
functionality (same truth table) will in most cases
synthesise the same way regardless of how you code it.

The result is affected by target technology, synthesis
tool optimisation and settings, the surrounding design
in which this block is instantiated, and a host of
other things. Your question makes no sense in isolation.

sela;
input[63:0] x,mc;
output[63:0]a;

e.g.1.
assign a = ({64{sela[0]}}&x)|({64{sela[1]}}&mc);
This one looks fine, although it's a good example of
code that is unnecessarily obscure and confusing.

e.g.2
always@(sela)
case(sela)
2'b01: a<=x;
2'b10: a<=mc;
default:a<=0;
endcase
In this example your sensitivity list is broken; it
should include "x" and "mc". Also, it's unnecessary
and usually inappropriate to use nonblocking assignment
in a combinational block.

Assuming you fix the sensitivity list, there is one key
difference between your two examples. What is the output
if sela==2'b11 ?????
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.bromley@MYCOMPANY.com
http://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 
Thank you so much.you are right.if sela==2'b11 , there is a difference
between them.

a)assign a = ({64{sela[0]}}&x)|({64{sela[1]}}&mc);
//equal to a = x|mc

b)
always@(sela or x or mc)
case(sela)
2'b01: a = x;
2'b10: a = mc;
default:a = 0;
endcase
//equal to a =0;
 

Welcome to EDABoard.com

Sponsor

Back
Top