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 display fraction in VHDL simulation???

Status
Not open for further replies.

khaila

Full Member level 2
Joined
Jan 13, 2007
Messages
121
Helped
5
Reputation
10
Reaction score
1
Trophy points
1,298
Activity points
2,105
represent fractions in vhdl how

supposed an unsigned vector A_UNS which represent 4.3 in form q.r:
4 : represents 4-bit of the QUOTIENT
3 : represents 3-bit of the REMAINDER

for example:
decimal vector 9.125
is represented in binary as A_UNS="1001.001"
the simulator will show A_UNS as 73 =======> "1001001"b=73d
if I will apply grouping signal I may seperate the QUOTIENT and REMAINDER

QUOTIENT will reperesented as 9d
but
REMAINDER still represented as an integer which is 1d

my quastion is:
How I may dispaly REMAINDER as fraction form which is 0.125 or 125????
 

avimit

Banned
Joined
Nov 16, 2005
Messages
413
Helped
91
Reputation
182
Reaction score
23
Trophy points
1,298
Location
Fleet, UK
Activity points
0
Hi,
Declare a real number, say 'myfrac' then convert your faction part into 'real' type in your vhdl code,(as you would do using a paper and pencil) and store it into 'myfrac' then view 'myfrac' in waveform.
Kr,
Avi
http://www.vlsiip.com
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top