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.

Verilog syntax query!

Status
Not open for further replies.

UFK

Member level 3
Member level 3
Joined
Mar 8, 2010
Messages
60
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Pakistan
Activity points
1,728
Hello all
Can someone please help me write the piece of code for the following lines in Verilog.


if either 'a' or 'b' or 'c' is greater than X
Y=X;
else
Y=P;
See if i try writing my way it ends up like this

if a^b^c > X
begin

Y=X

else

Y=P

This however would perform the 'OR' operation on a, b, c not the "either this or this or this" statement.

Please help me with it. I hope iv managed to convey my question. Thanks in advance
 

answer

if (a > X || b>x || c >x)
begin

Y=X;

else

Y=P;

end


here if any one of the
a,b,c is greater than x then y=x; else y=p;
 

    UFK

    Points: 2
    Helpful Answer Positive Rating
Thankyou for your help magesh87ece and amraldo. Its very kind of you.
 

Hi

I need help with a particular Verilog syntax.
I made a block RAM and loaded a coe file in to it. Then using wires i connected the douta of my bram to wire w1 so i could load the values in an array. Problem is that ISE does not let me part select the vector array. what i want to do is load the decimal values from my coe file in to an array, location wise. Eg Adress 0,1,2,3 from bram should go in address location 4,5,6,7 of my array.

Please help. part of myy code is as follows:

Quote:


reg [31:0] LIP [0:31];

FiveA M1 (.douta(w1[1023:00]));
initial
begin
initial
begin


LIP [01:00] = w1[01:00];
LIP [03:02] = w1[09:08];
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top