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.

Help me with my Verilog code that concatenate data bits

Status
Not open for further replies.

Bartart

Full Member level 2
Joined
Feb 20, 2002
Messages
124
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Location
Europt
Activity points
1,107
need help with verilog

hola!


this is my code, as you can see my job is to concate the partial data bits

XXX1XXXX where x is data from cntDataIn

MCirqMask[7:5] <= cntDataIn[7:5];
MCirqMask[3:0] <= cntDataIn[3:0];
MCirqMask[4] <= 1;

is there any easyiest way to do this?

thanks, Bart
 

need help with verilog

Hello
you can just write as
MCirqMask <= {cntDataIn[7:5], 1'b1, cntDataIn[3:0]};



Thanx and Regards
Dinnu
 

Re: need help with verilog

The easiest way would be, in that case:

MCirqMask <= cntDataIn | 8'b00010000;
 

Re: need help with verilog

Big Boy said:
The easiest way would be, in that case:

MCirqMask <= cntDataIn | 8'b00010000;

may be this is the easiest way .. but at an extra area of 8 OR gates aprroximately 40 transisitros extra :)
 

Re: need help with verilog

If this is translated as a LUT or discrete OR, indeed!

But many of today's synthesizers will be able to translate OR gates, with constant inputs, to simple logic (x or 0 will turn to simply x, and x or 1 will turn so a single internal Vcc).

So, this could be a simple way to test your synthesizer :) Looking at the generated RTL code.
 

need help with verilog

This is not a big issue. I agree to the point of dinnu:

MCirqMask <= {cntDataIn[7:5], 1'b1, cntDataIn[3:0]};

This is the basic way of verilog to concentrate multiple data in a single data.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top