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.

[SOLVED] VERILOG (divide by zero condition)

Status
Not open for further replies.

dipin

Full Member level 4
Joined
Jul 16, 2014
Messages
223
Helped
14
Reputation
28
Reaction score
14
Trophy points
18
Activity points
1,731
hi
i am designing an alu using verilog .in alu ,in division, how can i handle divide by zero condition. in this

Code:
$display("error");

is not allowed. can i do anything with high impedence state 'z'.
or do i need to use any flags i hardware.

plz help me im confused .in internet they are saying that u need to do it in hard ware
thanks & regards,
 
Last edited by a moderator:

Let me venture a guess...you've been writing software and thought to yourself Verilog looks like C and I'm good at software so I can now write Verilog software for FPGAs?

Well let me tell you. No it's not for writing software programs. Verilog and VHDL are hardware description languages so unless you know what the underlying logic circuit looks like you shouldn't be writing code.

You should also study the LRM or tutorials and understand the difference between synthesizable and non-sythesizable constructs.
$display is not synthesizable it's a simulation task to show a text string to the simulator's standard out. As you've read elsewhere you need to generate a hardware status flag.

Regards
 
  • Like
Reactions: dipin

    dipin

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top