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.

Representing fractional numbers in Verilog

Status
Not open for further replies.

jameela

Junior Member level 2
Joined
Mar 1, 2010
Messages
24
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Pakistan
Activity points
2,467
e_xk1={1/8};

and

e_xk2={-1/8};

1) what are the resulting values in binary in e_xk1 and e_xk2??

2) how are they calculated?

3) what should be the correct declarations for e_xk1 and e_xk2?
 

division in verilog

You missed to specify a data type for the parameters e_xk1 and e_xk2. A quotient of two integer values is an integer as well, so both values would be 0.

I guess, you are intending something like fractional numbers...
 

Re: division in verilog

If you are interested in representing fractional numbers, there are libraries for that.
--
Amr
 

division in verilog

THE ANSWER IS COMING 0 , BUT I WANT IT TO BE IN EXACT FRACTIONS

WHAT WOULD BE THE FRACTIONAL BINARY ANS??

HOW CAN I DO IT WITH HELP OF LIBRARIES.....??

Added after 2 minutes:

WHAT WOULD BE THE DATA TYPE TO STORE FRACTIONAL NUMBERS?
 

Re: division in verilog

Please search for floating point arithmetic libraries, you will find many implementing them in your favorite HDL
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top