From 3b22be5507f064d34033e41dcdadc445762e3318 Mon Sep 17 00:00:00 2001 From: Cary R Date: Wed, 16 Dec 2009 18:14:07 -0800 Subject: [PATCH] A ternary can be signed. If the two branches of a ternary are signed then the result will also be signed. --- elab_expr.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/elab_expr.cc b/elab_expr.cc index 5d4f30bba..36e1f8766 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -3417,6 +3417,7 @@ NetExpr*PETernary::elaborate_expr(Design*des, NetScope*scope, fal = pad_to_width(fal, use_wid, *this); NetETernary*res = new NetETernary(con, tru, fal); + res->cast_signed(tru->has_sign() && fal->has_sign()); res->set_line(*this); return res; }