Replicate the following VHDL into Verilog?

Status
Not open for further replies.

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:


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

 
The solution above should use blocking assignments for combinational logic.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…