Dec 25, 2017 #1 L LearningSoMuch Newbie level 2 Joined Dec 25, 2017 Messages 2 Helped 0 Reputation 0 Reaction score 0 Trophy points 1 Activity points 18 How would I replicate this VHDL process into Verilog Code VHDL - [expand]1 2 3 4 5 6 7 8 9 10 adding : process(a, b, inaddress, out) is variable addm :unsigned(32 downto 0); begin addm := ('0' & a) + ('0' & b) + inaddress; out <= addm(31 downto 0); inout_t <= addm(32); backout <= (addm(31) and not a(31) and not b(31)) or (not out(31) and a(31) and b(31)); end process; I am kind of new to this so I was just confused on this part. If someone could please show me how this process in Verilog would look, that would be helpful. Last edited by a moderator: Dec 25, 2017
How would I replicate this VHDL process into Verilog Code VHDL - [expand]1 2 3 4 5 6 7 8 9 10 adding : process(a, b, inaddress, out) is variable addm :unsigned(32 downto 0); begin addm := ('0' & a) + ('0' & b) + inaddress; out <= addm(31 downto 0); inout_t <= addm(32); backout <= (addm(31) and not a(31) and not b(31)) or (not out(31) and a(31) and b(31)); end process; I am kind of new to this so I was just confused on this part. If someone could please show me how this process in Verilog would look, that would be helpful.
Dec 25, 2017 #2 D dave_59 Advanced Member level 3 Joined Dec 15, 2011 Messages 838 Helped 365 Reputation 734 Reaction score 360 Trophy points 1,353 Location Fremont, CA, USA Activity points 7,369 Code Verilog - [expand]1 2 3 4 5 6 7 always @(*) begin : adding reg [32:0] adds; addm := a + b + inaddress; out <= addm[31:0]; inout_t <= addm[32]; backout <= (addm[31] && ! a[31] && !b[31]) || (! out[31] && a[31] && b[31]); end
Code Verilog - [expand]1 2 3 4 5 6 7 always @(*) begin : adding reg [32:0] adds; addm := a + b + inaddress; out <= addm[31:0]; inout_t <= addm[32]; backout <= (addm[31] && ! a[31] && !b[31]) || (! out[31] && a[31] && b[31]); end
Dec 26, 2017 #3 T ThisIsNotSam Advanced Member level 5 Joined Apr 6, 2016 Messages 2,549 Helped 397 Reputation 794 Reaction score 464 Trophy points 1,363 Activity points 14,768 The solution above should use blocking assignments for combinational logic.