P
particleynamics
Guest
Jag försöker lägga till en undertecknad och en osignerad nummer i Verilog. Kan någon berätta för mig hur? Är inte göra .. : (
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Reg undertecknat [31:0] resultat, reg undertecknat [31:0] operand1, reg [15:00] operand2, alltid [...] börja ... result = operand1 + operand2; ... slutet
C = $ signerad (A)
modul toppen, reg undertecknat [31:0] operand1, reg [15:00] operand2, reg undertecknat [31:0] resultat, första börjar operand1 = -1; operand2 = 10; resultat = operand1 + operand2, $ display (resultat, operand1, operand2), slutet endmodule
# 9 -1 10
-modul adderare (input kabel undertecknat [31:0] operand1, ingång tråden [15:0] operand2, utgång reg undertecknat [31:0] resultat), alltid @ (operand1 eller operand2) result = operand1 + operand2; endmodule Modulen toppen, reg undertecknat [31:0] OP1, reg [15:00] OP2, wire undertecknat [31:0] resultat, huggorm A1 (OP1, OP2, resultat); första börjar OP1 = -1; OP2 = 10; # 10 $ display (resultat, OP1, OP2), slutet endmodule