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.

How to code a mathematical set equations using verilog

Status
Not open for further replies.

dineshprasad

Newbie level 4
Joined
Sep 8, 2005
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,343
verilog code for mathematical

hi,

I have to compare 2 mathematical sets( set has no's) and have to get 2 different results

1. The intersection of tehe 2 sets

2. The Union of the 2 set.

Can any one please guide me to how to code this in verilog HDL.

Thanks a lot in advance


dp
 

Please clarify: Sets of what? What are "no's"?
Perhaps give an example.
 

first, you must code those set that you have defined, then you can use the current logic operator to programing.
 

hi ,

The example set may be 2 signals a and b
let
a={4,7} which means (4,5,6,7} (the set are continues and sequential series}
b ={5,9} which is expanded as {5,6,7,8,9)

a union b , should give a signal(out) c={5,7} which means {5,6,7}

Thanks

dp
 

I think you mean "a intersect b", not union. Yes?

How do you want to express the null set (no members common to both sets)?

Have you coded that in any other language? It sounds like a few comparison operators. That would be easy to translate to HDL.
 

hi

yes "intersection" , but the result should be a set which has no's in set a, but not in set b.
I have not coded that in any other language till now, is there any pre defined function for this similar operations in verilog HDL

Thanks a lot
dp
 

Still not clear. Numbers in set a that are not in set b? Your example sets would give {4} not {5,6,7}.

I don't think any common programming language has built-in set manipulation functions. Same with Verilog. You'll have to write your own expressions using conditional operators such as < > >= <=. The Verilog syntax would be similar to C syntax.
 

Thanks a lot........ it seems to be working....

dp
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top